Xcode rebuilds constantly after class implementation

I recently used this iOS Color Picker (top answer) from StackOverflow to my project. It's absolutely fantastic and draws right in the Builder interface - however, it also seems to make Xcode constantly rebuild.

As soon as I type in one single character, Xcode rebuilds the whole project and it becomes incredibly tedious. All the information I could find on the subject tells me to disable "Live Issues" under Xcode prefixes, but as a relative newbie to coding, I rely heavily on being able to see errors as they appear.

My question is, is there a way to disable this persistent rebuild WITHOUT disabling "live issues"? (either by changing the iOS Color Picker code or some other option in the Xcode itself?)

Thank!

+3


source to share


1 answer


This is caused by the definitions IB_DESIGNABLE

in the original header file s. Probably it makes problem only if the header file containing

IB_DESIGNABLE is included (even implicitly) in the source file you are currently editing.

I have not found a definitive solution on how to disable IB_DESIGNABLE

and thus permanently compile the storyboard and source files. I would appreciate an Xcode flag to temporarily disable it. I also tried to surround with IB_DESIGNABLE

macros #ifdef

, but they are considered even if #ifdef is false. Commenting one by one, IB_DESIGNABL

E helps, but it is not a feasible solution with many IB_DESIGNABLEs

.

Update

I finally found a quick way to avoid this annoying behavior. With the storyboard open in the active window, turn off Auto Refresh Views from the Editor menu. This will stop updating the views in the storyboard editor that use your own code and thus greatly speed up your development. When you need just-in-time compilation again to have a visual preview of your custom code, enable this option again (it looks like you also need to reopen the storyboard for it to work again).

enter image description here

You might want to add keybindings to a command like command-option-control-A to easily toggle the behavior on / off. To add keybindings in Xcode, press the command comma for settings, select the Keybindings tab, use the search bar to find a command, then double-click the right pane to add your desired keypress.



"Leave it" approach

Turn on "Automatically update views" and do not enable it.

Make a convenient refresh all views key press, say command-option-shift-R

enter image description here

While working, just touch the-option-shift-R command from time to time or as needed. Usually you only need to touch the-option-shift-R command when you are working on a storyboard.

+1


source







All Articles