How to prevent Fabric from launching when building your XCode project

Recently, Fabric has been acting really buggy freezing up and mass opening many browser tabs.  If you use Fabric and don’t use the app or don’t want it to launch everytime you build your XCode project, you have a couple options.

Option #1 Prevent Fabric from launching after uploading your project’s DSYM file.

Open up the run script: Pods/Fabric/run and change:

eval $DIR$PATH_SEP$UPLOAD_COMMAND > /dev/null 2>&1 &

To:

eval $DIR$PATH_SEP$UPLOAD_COMMAND;killall Fabric > /dev/null 2>&1 &

 

Option #2 Only upload DSYM when archiving builds for release.

Check the “Run script only when installing” option under Build Phases:

Screen Shot 2016-04-23 at 5.30.21 AM

 

Cheers!

Advertisements

How to speed up slow Swift compile times

Swift code compiling slowly? Here’s how to find out what’s causing it.

Under Build Settings, add “-Xfrontend” “-debug-time-function-bodies” to your Other Swift Compiler flags.

Open terminal.

List files sorted by slowest compile time:

$ xcodebuild -workspace MyProject.xcworkspace -scheme MyProject clean build | grep [1-9].[0-9]ms | sort -n

List functions grouped by slowest compile time:

$ xcodebuild -workspace MyProject.xcworkspace -scheme MyProject clean build | grep [1-9].[0-9]ms | awk '{arr[$2]+=$1} END {for (i in arr) {print arr[i], i}}' | sort -n

Print total compile time:

$ xcodebuild -workspace MyProject.xcworkspace -scheme MyProject clean build | grep [1-9].[0-9]ms | sort -n | awk '{SUM+=$1}END{print SUM}'

More here: http://irace.me/swift-profiling/

XCode 4 style tab views

We needed tab views that look and feel just like the ones in XCode 4. Our first attempt trying to override NSTabView’s styles failed. Instead, we found it easier to make NSTabView tabless and control it using a customized NSSegmentedControl. What’s nice is we can set it all up inside Interface Builder.

Instructions:

  • Open the nib file that will contain the tab view
  • Drag a NSTabView from the Object Library onto the stage
  • Change its class from NSTabView to WILLTabView
  • Add however many tab items you want and edit their labels to match up with an image filename


Check it out:

https://github.com/aaroncrespo/WILLTabView/