Multiple line comment in Xcode 8

In Xcode7 and earlier versions, the commenting option was available in Editor > Structure > Comment Selection. In Xcode 8 this option is disabled. To enable these options run sudo /usr/libexec/xpccachectl and restart your Mac. There is thread on Apple Developer Forums regarding this issue and several possible fixes. For me running the above command … Read more

Can I delete data from the iOS DeviceSupport directory?

The ~/Library/Developer/Xcode/iOS DeviceSupport folder is basically only needed to symbolicate crash logs. You could completely purge the entire folder. Of course the next time you connect one of your devices, Xcode would redownload the symbol data from the device. I clean out that folder once a year or so by deleting folders for versions of … Read more

iOS 10 and Permissions localization description

I faced the same issue and I was able to resolve it because I noticed that the InfoPlist.strings wasn’t member of any target. So setting the Target Membership on the file (which puts it into the Copy Bundle Resources build phase) fixed it. And for anyone googling here: https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/AboutInformationPropertyListFiles.html Scroll down to “Localizing Property List … Read more

Tests stop working under xcode 8 TEST_HOST error

For some reason the “Host Application” setting in the picture below was the problem for me. Selecting the proper target fixed this. This ended up modifying the following values in my xcodeproj: BUNDLE_LOADER = “$(TEST_HOST)”; TEST_HOST = “$(BUILT_PRODUCTS_DIR)/myappname.app/myappname”;

UITextView with hyperlink text

Set isEditable = false or the text view will go into text-editing mode when user taps on it. Swift 4 and later let attributedString = NSMutableAttributedString(string: “Just click here to register”) let url = URL(string: “https://www.apple.com”)! // Set the ‘click here’ substring to be the link attributedString.setAttributes([.link: url], range: NSMakeRange(5, 10)) self.textView.attributedText = attributedString self.textView.isUserInteractionEnabled … Read more