Skip to content

Instantly share code, notes, and snippets.

@welbesw
Created June 7, 2016 17:26
Show Gist options
  • Save welbesw/ebf5867ca981962ecd03e60492f7ff86 to your computer and use it in GitHub Desktop.
Save welbesw/ebf5867ca981962ecd03e60492f7ff86 to your computer and use it in GitHub Desktop.
SalesforceManager singleton class
import SalesforceSDKCore
import SalesforceRestAPI
public class SalesforceManager : NSObject {
//Define a shared instance for singleton
static let sharedInstance = SalesforceManager()
let errorDomain = "com.centare.contactforce.salesforcemanager"
var consumerKey:String = ""
var redirectUrl:String = ""
private override init() {
super.init()
//Perform any setup - load the salesforce configuration
SFLogger.setLogLevel(.Debug)
consumerKey = "YOUR-CONSUMER-KEY-HERE" //Loaded from Configuration class in my example app
redirectUrl = "YOUR-REDIRECT-URL-HERE" //Loaded from Configuration class in my example app
}
//...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment