Latest 2.0.4
Homepage https://github.com/simformsolutions/SSTwitterLogin
License MIT (LICENSE)
Platforms ios 9.0
Dependencies TwitterKit
Frameworks TwitterKit
Authors

The reusable Twitter login components for iOS is the easiest way to get data from Twitter.

Features

• Get default user data from Twitter

Requirements

• iOS 10.0+

• Xcode 9.0

Installation

Take TwitterLoginHelper.swift, and TwitterConstant.Swift
Import two files in your project and it’s done

Manually

  1. Configure Twitter App Settings for iOS (https://apps.twitter.com/)
  2. Download TwitterKit SDK
  3. Add SDK to Project
  4. Configure Xcode Project
  5. Connect App Delegate Using TwitterLoginManger.swift Methods
  6. Congratulations!

CocoaPods

  1. Configure Twitter App Settings for iOS (https://apps.twitter.com/)
  2. Install Pod ‘SSTwitterLogin’
  3. Configure Xcode Project
  4. Connect App Delegate Using TwitterLoginManger.swift Methods
  5. Congratulations!

Usage example

Add following in your application:didFinishLaunchingWithOptions launchOptions:

  TwitterLoginHelper.sharedInstance.twitterStartwith(consumerKey: "YOUR_APP_CONSUMER_KEY", consumerSecret: "YOUR_APP_CONSUMER_SECRET")

Add following in your application:openURL:options function

  return TwitterLoginHelper.sharedInstance.twitterConfigurationWithOptions(application,open: url, options:options)

To Do Twitter Login

TwitterLoginHelper.sharedInstance.doLoginWithTwitter { (isSuccess, error) in
            if isSuccess {
               // Fetch LoggedIn User's Details
            } else {
                print(error?.localizedDescription ?? "")
                TwitterLoginHelper.sharedInstance.logoutFromTwitter()
            }
}

To Fetch LoggedIn User’s Details

TwitterLoginHelper.sharedInstance.getLoggedInUserDetailswith(completion: { (userData, error) in
            if userData != nil {
                print("UserData: (userData?.userID ?? 0)")
            } else {
                print(error?.localizedDescription ?? "")
            }
        })

Latest podspec

{
    "name": "SSTwitterLogin",
    "version": "2.0.4",
    "summary": "The reusable Twitter login components for iOS is the easiest way to get data from Twitter.",
    "description": "The reusable Twitter login components for iOS is the easiest way to get data from Twitter. It will reduce developers time to integrate Twitter login in their app. Just add two files to your project and it's done.",
    "homepage": "https://github.com/simformsolutions/SSTwitterLogin",
    "license": "MIT (LICENSE)",
    "platforms": {
        "ios": "9.0"
    },
    "swift_versions": "5.0",
    "authors": {
        "Darshit Vadodaria": "[email protected]"
    },
    "source": {
        "git": "https://github.com/simformsolutions/SSTwitterLogin.git",
        "tag": "2.0.4"
    },
    "source_files": "SSTwitterLogin",
    "dependencies": {
        "TwitterKit": [
            "3.4.2"
        ]
    },
    "frameworks": "TwitterKit",
    "swift_version": "5.0"
}

Pin It on Pinterest

Share This