AppDelegate.swift
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
MySizeIdSDK.sharedInstance().initialize(withKey: "YOUR_KEY", andSecret: "YOUR_SECRET")
return true
}
ViewController.swift
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
}
@IBAction func start(_ sender:UIButton){
if MySizeIdSDK.sharedInstance().isDeviceSupported(){
MySizeIdSDK.sharedInstance().start(self, andUserID: "USER_ID")
}
}
@IBAction getSize(_ sender:UIButton){
MySizeIdSDK.sharedInstance().getSize("SIZE_CHART", andUserID: "USER_ID", onComplete: { (size) in
print(size)
}) { (error) in
print(error?.localizedDescription)
}
}
}
Comments
0 comments
Please sign in to leave a comment.