Code folding in Xcode 8

Tags: xcode
By : Luiz
Source: Stackoverflow.com
Question!

Is anyone having problem with code folding in Xcode 8? Every time I fold GameScene.swift (or any other file), switch to, for example, AppDelegate.swift, and switch back to GameScene.swift (which were folded before), it unfolds.

By : Luiz


Answers

Xcode unfortunately neither store nor remembers code folding. It actually resets folded parts after losing focus that file.

Since the code folding is reset all the time, I personally use this way of refolding:

To fold all the methods: Shift + Alt + Cmd + <- left

Place cursor onto the desired method and unfold it by clicking or using shortcut: Alt + Cmd + -> right

By : pedrouan


I hope following code will help you i try this code and it reset the form, so user can add new value.

 $('#reset-textbox').click(function() {
    document.getElementsByClassName("comment_form").reset();
});

or this code also work for you.

  $('#reset-textbox').click(function() {
    $('.comment_form')[0].reset();
});


Disable attribute only associates button and input filelds, the thing you want to do here is , event.preventDefault . It will work like disable, but it will depend upon your coding, if you want to show it disabled, you have to add add via jquery



This video can help you solving your question :)
By: admin