SwiftUI tappable subtext

Update for iOS 15 and higher: There is a new Markdown formatting support for Text, such as: Text(“Some text [clickable subtext](some url) *italic ending* “) you may check WWDC session with a timecode for details The old answer for iOS 13 and 14: Unfortunately there is nothing that resembles NSAttributedString in SwiftUI. And you have … Read more

How to disable no inverse relationship warning for CoreData in Xcode 4.2?

In XCode 5, 6 and 7, you can still set the variable. Navigate to Build Settings A. Select your project on the left side bar under Project Navigator. B. Select the “Build Settings” tab. Find and set MOMC_NO_INVERSE_RELATIONSHIP_WARNINGS A. Select ‘All’ in the upper left of the main screen. B. Search for MOMC_NO_INVERSE_RELATIONSHIP_WARNINGS by pasting … Read more

iPhone : How to set BackgroundColor of UIButton with buttonType UIButtonTypeCustom

You could create an image programmatically and so have the ability to use your colors in a dynamic way: Create a category for UIButton with this method and be sure to have QuartzCore lib imported via @import QuartzCore: – (void)setColor:(UIColor *)color forState:(UIControlState)state { UIView *colorView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 1, 1)]; colorView.backgroundColor = color; … Read more

Give warning when [super method] is not called

Recent versions of llvm have added an attribute that indicates that subclasses must call super: @interface Barn:NSObject – (void)openDoor NS_REQUIRES_SUPER; @end @implementation Barn – (void) openDoor { ; } @end @interface HorseBarn:Barn @end @implementation HorseBarn – (void) openDoor { ; } @end Compiling the above produces the warning: Method possibly missing a [super openDoor] call

iOS Designated Initializers : Using NS_DESIGNATED_INITIALIZER

The use of NS_DESIGNATED_INITIALIZER is nicely explained in http://useyourloaf.com/blog/2014/08/19/xcode-6-objective-c-modernization.html: The designated initializer guarantees the object is fully initialised by sending an initialization message to the superclass. The implementation detail becomes important to a user of the class when they subclass it. The rules for designated initializers in detail: A designated initializer must call (via super) … Read more

Xcode 4 plugin development

As far as I know there is no official way to create Xcode 4 plugins (just like there wasn’t one for v3.x). Here is an openradar on Xcode’s lack of plugin support: Please support the ability for 3rd parties to extend Xcode via a public plugin API. Aperture, Visual Studio, Eclipse, TextMate and other applications … Read more

IBOutletCollection set ordering in Interface Builder

EDIT: Several commenters have claimed that more recent versions of Xcode return IBOutletCollections in the order the connections are made. Others have claimed that this approach didn’t work for them in storyboards. I haven’t tested this myself, but if you’re willing to rely on undocumented behavior, then you may find that the explicit sorting I’ve … Read more