How do I correctly use “openParentApplication” and “handleWatchKitExtensionRequest” so that “reply()” is called?

When the main app on the iPhone is not active, reply() may not be reached because the background task is killed by the OS before. The solution is to explicitly start a background task in handleWatchKitExtensionRequest as specified in the documentation. If a background task is initiated like this, it can run up to 180 … Read more

How can I change image tintColor in iOS and WatchKit

iOS For an iOS app, in Swift 3, 4 or 5: theImageView.image = theImageView.image?.withRenderingMode(.alwaysTemplate) theImageView.tintColor = UIColor.red For Swift 2: theImageView.image = theImageView.image?.imageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate) theImageView.tintColor = UIColor.redColor() Meanwhile, the modern Objective-C solution is: theImageView.image = [theImageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; [theImageView setTintColor:[UIColor redColor]]; Watchkit In WatchKit for Apple Watch apps, you can set the tint color for a template … Read more