Skip to content

Instantly share code, notes, and snippets.

@HBehrens
Created June 5, 2014 02:17
Show Gist options
  • Save HBehrens/bb4a52b1d8d57ba4b661 to your computer and use it in GitHub Desktop.
Save HBehrens/bb4a52b1d8d57ba4b661 to your computer and use it in GitHub Desktop.
Install pbw with UIDocumentInteractionController
- (void)deployToPebbleControl:(UIView *)control delegate:(id<UIDocumentInteractionControllerDelegate>)delegate {
NSString *baseName = @"peebhole-1_x";
#if !TARGET_IPHONE_SIMULATOR
PBFirmwareVersion *version = PEBAppDelegate.instance.watch.versionInfo.runningFirmwareMetadata.version;
if(version.os >= 2) {
baseName = @"peebhole-2_x";
}
#endif
NSURL *url = [NSBundle.mainBundle URLForResource:baseName withExtension:@"pbw" subdirectory:@"PebbleBuild"];
if (url) {
PEBNSLog(@"url: %@", url);
_documentController = [UIDocumentInteractionController interactionControllerWithURL:url];
_documentController.delegate = delegate;
[_documentController presentOpenInMenuFromRect:control.frame inView:control.superview animated:YES];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment