This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import WatchKit; | |
@interface CachingInterfaceController : WKInterfaceController | |
- (void)updateLabel:(WKInterfaceLabel *)label withString:(NSString *)string; | |
- (void)updateLabel:(WKInterfaceLabel *)label asHidden:(BOOL)hidden; | |
- (void)updateImage:(WKInterfaceImage *)image withImageNamed:(NSString *)imageName; | |
- (void)updateImage:(WKInterfaceImage *)image withBaseNameForAnimation:(NSString *)baseName withRange:(NSRange)range duration:(NSTimeInterval)duration repeatCount:(NSInteger)repeatCount; | |
- (NSString *)currentImageNameForImage:(WKInterfaceImage *)image; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Appends a value to an array within a dictionary without triggering a copy. | |
/// Necessary in Swift 3 but expected to be obsoleted as the way inout works | |
/// will be changed (eliminating the need for the write-back copy) | |
func append<K, V>(value: V, toKey key: K, in dict: inout [K : Array<V>]) { | |
var a: [V]? = [] | |
swap(&a, &dict[key]) | |
a = a ?? [] | |
a!.append(value) | |
swap(&a, &dict[key]) |
OlderNewer