Git Product home page Git Product logo

if-tweet-feed-ios's Introduction

IFTweetFeed

An example on MVVM(protocol) for architecturing iOS projects

Swift Version License PRs Welcome

Provide an example implementation of MVVM(protocol) for reference on how to architecture iOS projects

Requirements

  • iOS 11.0+
  • Xcode 8

Getting Started

Obtain Application Key & Secret

Twitter requires that all API requests be authenticated with tokens that can be traced back to an individual Twitter App. If you already have keys for a Twitter app you can pass them directly to the Twitter.sharedInstance().start() method.

To create a new Twitter app or use existing Twitter app, visit Twitter apps dashboard and copy the keys from the “Keys and Access Tokens” tab of your app page.

To add call back URL:

  1. In Twitter apps dashboard, find your application and go to the permissions tab.

  2. Select the appropriate permissions for your needs (e.g. “Read and write”)

  3. If you are using login, add a placeholder URL in the Callback URL field (eg. “http://placeholder.com”).

  4. Click update settings.

    Although the callback URL will not be requested by Twitter Kit in your app, it must be set to a valid URL for the app to work with the SDK.

Initialize Twitter Kit

Inside your App Delegate, initialize Twitter Kit with your application key and secret (paste your own key and secret).

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    Twitter.sharedInstance().start(withConsumerKey:"hTpkPVU4pThkM0", consumerSecret:"ovEqziMzLpUOF163Qg2mj")

    return true
}

Configure Info.Plist

Twitter Kit looks for a URL scheme in the format twitterkit-<consumerKey>, where consumerKey is your application’s Twitter API key, e.g. twitterkit-dwLf79lNQfsJ.

You can find your consumer key in the Twitter app dashboard.

In your app’s Info.plist, add URL Schemes by adding code below after <dict>

<key>CFBundleURLTypes</key>
<array>
  <dict>
    <key>CFBundleURLSchemes</key>
    <array>
      <string>twitterkit-<consumerKey></string>
    </array>
  </dict>
</array>
<key>LSApplicationQueriesSchemes</key>
<array>
    <string>twitter</string>
    <string>twitterauth</string>
</array>

Run It!

Meta

Ivan Foong – @vonze21[email protected]

Distributed under the MIT license. See LICENSE for more information.

https://github.com/ivanfoong/

if-tweet-feed-ios's People

Contributors

ivanfoong avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.