Skip to content
Browse files

add/improve BVMOpenLinkManager documentation

  • Loading branch information...
1 parent c284655 commit f40b376cef23a9407fc1e89a20f7780388da8a3e @cdzombak committed Mar 29, 2013
Showing with 15 additions and 1 deletion.
  1. +14 −1 buyvmmanager/BVMLinkOpenManager.h
  2. +1 −0 buyvmmanager/BVMLinkOpenManager.m
View
15 buyvmmanager/BVMLinkOpenManager.h
@@ -9,19 +9,32 @@ typedef NS_ENUM(NSInteger, BVMBrowser) {
@interface BVMLinkOpenManager : NSObject
+/**
+ * Returns YES if the given browser is available on this device.
+ */
+ (BOOL)browserAvailable:(BVMBrowser)browser;
+/**
+ * Returns the user's selected default browser.
+ */
+ (BVMBrowser)selectedBrowser;
+
+/**
+ * Sets the user's selected default browser.
+ */
+ (void)setSelectedBrowser:(BVMBrowser)browser;
/**
- * Open the given URL.
+ * Opens the given URL.
*
* If HTTP or HTTPS, uses the defaut browser.
*/
+ (void)openURL:(NSURL *)url;
+ (void)openURLString:(NSString *)urlString;
+/**
+ * Returns the human-friendly name for the given browser.
+ */
+ (NSString *)nameForBrowser:(BVMBrowser)browser;
@end
View
1 buyvmmanager/BVMLinkOpenManager.m
@@ -36,6 +36,7 @@ + (BOOL)browserAvailable:(BVMBrowser)browser
#pragma mark Default browser management
+ (BVMBrowser)selectedBrowser {
+ // note: if not set, this falls back to 0 == BVMBrowserSafari
return [[NSUserDefaults standardUserDefaults] integerForKey:kBVMBrowserPrefsKey];
}

0 comments on commit f40b376

Please sign in to comment.
Something went wrong with that request. Please try again.