Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added another alternate way using block to run the save panel modal (.m)

  • Loading branch information...
commit 73159a5de0792587798d0ceb3ffe471c19e2759c 1 parent 313cbe9
Vincent Wayne authored
Showing with 12 additions and 0 deletions.
  1. +12 −0 JFImageSavePanel/JFImageSavePanel.m
View
12 JFImageSavePanel/JFImageSavePanel.m
@@ -67,6 +67,18 @@ - (NSInteger)runModalForImage:(NSImage *)image error:(NSError **)error
return result;
}
+- (void)beginWithImage:(NSImage *)image completionHandler:(void (^)(NSInteger result))block
+{
+ [self configureSavePanel];
+ [self.savePanel beginWithCompletionHandler:^(NSInteger result) {
+ if (result == NSFileHandlingPanelOKButton) {
+ [self saveImage:image];
+ }
+
+ block(result);
+ }];
+}
+
- (void)configureSavePanel
{
[self.savePanel setAccessoryView:self.accessoryView];
Please sign in to comment.
Something went wrong with that request. Please try again.