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
- (void)doSomething { | |
NSOperationQueue *queue = [[NSOperationQueue alloc] init]; | |
[queue addOperationWithBlock:^{ | |
// load data from disk | |
NSLog(@"done"); | |
}]; | |
} |
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
class FileWriter { | |
func writeDocument(text: String?, completion((Bool, NSError?) -> Void)?) -> NSError? { | |
var error: NSError? | |
if let cText = text { | |
dispatch_async(myQueue) {() -> Void in | |
let error = writeAndSaveFile(cText) | |
completion?((error == nil), error) | |
} | |
} else { | |
error = NSError.dataEmptyError() |
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
@interface MyTVC : UIViewController | |
@property (strong, nonatomic) NSMapTable switchesToIndexPaths; | |
@end | |
@implementation MyTVC | |
- (void)viewDidLoad { | |
[super viewDidLoad]; |
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
data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAoHBwgHBgoICAgLCgoLDhgQDg0NDh0VFhEYIx8lJCIfIiEmKzcvJik0KSEiMEExNDk7Pj4+JS5ESUM8SDc9Pjv/2wBDAQoLCw4NDhwQEBw7KCIoOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozv/wAARCAEsASwDASIAAhEBAxEB/8QAHAABAAEFAQEAAAAAAAAAAAAAAAECBAUGBwMI/8QATRAAAgEDAQQFCAMMBwcFAAAAAAECAwQRBQYSITEHQVFhgRMiMkJxkbHRFKHBFRYjM1JicoOSssLwFyQ0NWRzoiUmRXSC0uFDVFVjs//EABoBAQADAQEBAAAAAAAAAAAAAAABAwQCBQb/xAAxEQEAAgIBAwIEBAQHAAAAAAAAAQIDEQQSITEFQRMUUZEiMmGBBnHB0RUWQlKhsfD/2gAMAwEAAhEDEQA/AOzAAAAAAAAAAAAAAAAAplKMIuUpKMVxbbwkYXWdstA0GlGd9qVJOXowpvfm/BdXeBnAc8uumnZylB/R7a+rzXJbkYp+O99hg7rpyrOLVpolOEup1a7kvckviTodfIbwcPrdNGv3EacaVtaWzjUTnOEXLejw4Yk3jr4mS276VJV4S0zZ2q405w/C3ceEnlcYx7O9+7tIF70l9J70WX3I0CvF3sZfh7hJSVL81Z4N9vZy58tq6Ptpqm1Wy1G+uMfSqc3RrtLClJYeUu9NeOTjn9Eu19/QheU7ehKNaKqRTuIqTTWVzJ2R221bYL6bprtaNaHlXv05yfmzXB4aeOr6gafRQOHR6a9fU23aWDTfBeTlw/1F3R6btTTXltKtJrr3JSj8wOzA5bYdNltUuFHUNJnRpNcZ0aqm14NL4m2bM7daXtXeVrawp14So01UfloxW8s44Yb7veBswAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwO |