Created
January 31, 2013 00:28
-
-
Save rustle/4678755 to your computer and use it in GitHub Desktop.
Couple of typedefs that I think make the NSFilePresenter block APIs a little easier to read
This file contains 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
typedef void (^FilePresenterReacquirerBlock)(void); | |
typedef void (^FilePresenterReaderBlock)(FilePresenterReacquirerBlock reacquirer); | |
typedef void (^FilePresenterWriterBlock)(FilePresenterReacquirerBlock reacquirer); | |
typedef void (^FilePresenterCompletionHandler)(NSError *errorOrNil); | |
- (void)relinquishPresentedItemToReader:(FilePresenterReaderBlock)reader | |
{ | |
// Do stuff here ahead of reading | |
reader(^{ | |
// Do stuff here after reading is done | |
}); | |
} | |
- (void)relinquishPresentedItemToWriter:(FilePresenterWriterBlock)writer | |
{ | |
// Do stuff here ahead of writing | |
writer(^{ | |
// Do stuff here for after writing is done | |
}); | |
} | |
- (void)savePresentedItemChangesWithCompletionHandler:(FilePresenterCompletionHandler)completionHandler | |
{ | |
completionHandler(nil); | |
} | |
- (void)accommodatePresentedItemDeletionWithCompletionHandler:(FilePresenterCompletionHandler)completionHandler | |
{ | |
completionHandler(nil); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment