I use the SDK for Twitter and the Twitter SDK for login and registration.
But they both do not open url from one common method. As I wrote below code for Facebook,
func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject) -> Bool { if(url.scheme == "fb1651015905222312") { return FBSDKApplicationDelegate.sharedInstance().application(application, openURL: url, sourceApplication: sourceApplication, annotation: annotation) } return true }
This works great, and for twitter I have to comment on this method above and write it like,
func application(app: UIApplication, openURL url: NSURL, options: [String : AnyObject]) -> Bool { if Twitter.sharedInstance().application(app, openURL:url, options: options) { return true } return true }
This works just fine for Twitter.
The problem is that I need to write one common method to open my url in appDelegate. So how do I overcome it?
Thanks in advance.
NOTE. We cannot write both methods in the application delegate.
source share