Documentation Archive Developer
Search

WatchKit Changes for Objective-C

WatchKit

WKAlertAction.h (Added)

WKAudioFilePlayer.h (Added)

WKAudioFilePlayerItem.h (Added)

WKDefines.h

Added #def WK_AVAILABLE_IOS_ONLY
Added #def WK_AVAILABLE_WATCHOS_IOS
Added #def WK_AVAILABLE_WATCHOS_ONLY

WKError.h

WKInterfaceController.h

Declaration
From
- (void)presentControllerWithNames:(NSArray *)names contexts:(NSArray *)contexts
To
- (void)presentControllerWithNames:(NSArray<NSString *> * _Nonnull)names contexts:(NSArray * _Nullable)contexts

Declaration
From
- (void)presentTextInputControllerWithSuggestions:(NSArray *)suggestions allowedInputMode:(WKTextInputMode)inputMode completion:(void (^)(NSArray *results))completion
To
- (void)presentTextInputControllerWithSuggestions:(NSArray<NSString *> * _Nullable)suggestions allowedInputMode:(WKTextInputMode)inputMode completion:(void (^ _Nonnull)(NSArray * _Nullable results))completion

Declaration
From
+ (void)reloadRootControllersWithNames:(NSArray *)names contexts:(NSArray *)contexts
To
+ (void)reloadRootControllersWithNames:(NSArray<NSString *> * _Nonnull)names contexts:(NSArray * _Nullable)contexts

Designated Initializer
From--
Toyes

WKInterfaceDevice.h

Declaration
From
@property(nonatomic, readonly, strong) NSDictionary *cachedImages
To
@property(nonatomic, readonly, strong, nonnull) NSDictionary<NSString *,NSNumber *> *cachedImages

WKInterfaceGroup.h

Removed -[WKInterfaceGroup startAnimating]
Removed -[WKInterfaceGroup startAnimatingWithImagesInRange:duration:repeatCount:]
Removed -[WKInterfaceGroup stopAnimating]
Protocols
From--
ToWKImageAnimatable

WKInterfaceImage.h

Removed -[WKInterfaceImage startAnimating]
Removed -[WKInterfaceImage startAnimatingWithImagesInRange:duration:repeatCount:]
Removed -[WKInterfaceImage stopAnimating]
Protocols
From--
ToWKImageAnimatable

WKInterfaceObject.h

Declaration
From
- (void)setAccessibilityImageRegions:(NSArray *)accessibilityImageRegions
To
- (void)setAccessibilityImageRegions:(NSArray<WKAccessibilityImageRegion *> * _Nonnull)accessibilityImageRegions

WKInterfaceTable.h

Declaration
From
- (void)setRowTypes:(NSArray *)rowTypes
To
- (void)setRowTypes:(NSArray<NSString *> * _Nonnull)rowTypes