Skip to content

Instantly share code, notes, and snippets.

@cosbor11
Created October 23, 2015 06:45
Show Gist options
  • Select an option

  • Save cosbor11/758211a70a0e53837ee7 to your computer and use it in GitHub Desktop.

Select an option

Save cosbor11/758211a70a0e53837ee7 to your computer and use it in GitHub Desktop.
AppDelegate configuration for PersistenceManagerAPI
@interface AppDelegate ()
@property (nonatomic, strong) SWGPersistenceManagerApi* persistenceManager;
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Get the configuration and set the credentials, and endpoint
SWGConfiguration *config = [SWGConfiguration sharedConfig];
[config setUsername:@"admin"];
[config setPassword:@"admin"];
[config setHost:@"http://localhost:8080/web"];
// Create a persistence manager with credentials
self.persistenceManager = [SWGPersistenceManagerApi apiWithHeader:[config getBasicAuthToken] key:@"Authorization"];
// Override point for customization after application launch.
return YES;
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment