DBDesktopSharedApplication
Objective-C
@interface DBDesktopSharedApplication : NSObject <DBSharedApplication>
Swift
class DBDesktopSharedApplication : NSObject, DBSharedApplication
Platform-specific (here, macOS) shared application.
Renders OAuth flow and implements DBSharedApplication
protocol.
-
Delegate to handle loading status during auth flow.
Declaration
Objective-C
@property (nonatomic, weak) id<DBLoadingStatusDelegate> _Nullable loadingStatusDelegate;
Swift
weak var loadingStatusDelegate: DBLoadingStatusDelegate? { get set }
-
Returns the shared instance of
DBDesktopSharedApplication
.Declaration
Objective-C
+ (nullable DBDesktopSharedApplication *)desktopSharedApplication;
-
Sets the shared instance of
DBDesktopSharedApplication
.Declaration
Objective-C
+ (void)setDesktopSharedApplication: (nonnull DBDesktopSharedApplication *)desktopSharedApplication;
Swift
class func setDesktopSharedApplication(_ desktopSharedApplication: DBDesktopSharedApplication)
-
Full constructor.
Declaration
Objective-C
- (nonnull instancetype) initWithSharedApplication:(nonnull NSWorkspace *)sharedApplication controller:(nonnull NSViewController *)controller openURL:(void (^_Nonnull)(NSURL *_Nonnull))openURL;
Swift
init(sharedApplication: NSWorkspace, controller: NSViewController, openURL: @escaping (URL) -> Void)
Parameters
sharedApplication
The
NSWorkspace
with which to render the OAuth flow.controller
The
NSViewController
with which to render the OAuth flow. The controller reference is weakly held.openURL
A wrapper around app-extension unsafe
openURL
call.Return Value
An initialized instance.