title: twitter login swift 4
body: <p>I want to implement twitter login in my app but i get error.</p>
  
  <pre><code>Class TWTRAppAuthProvider is implemented in both /Users/mohamedeldewaik/Library/Developer/CoreSimulator/Devices/1F7EFA9B-EB86-4E18-8386-284E21A73F92/data/Containers/Bundle/Application/37DD8EB8-2854-44CB-ABAD-3FDADA0FCD1E/alharamin pass.app/Frameworks/TwitterKit.framework/TwitterKit (0x105296548) and /Users/mohamedeldewaik/Library/Developer/CoreSimulator/Devices/1F7EFA9B-EB86-4E18-8386-284E21A73F92/data/Containers/Bundle/Application/37DD8EB8-2854-44CB-ABAD-3FDADA0FCD1E/alharamin pass.app/Frameworks/TwitterCore.framework/TwitterCore (0x10510e370). One of the two will be used. Which one is undefined.
  </code></pre>
  
  <p><strong>I tried this below code but it crashes</strong></p>
  
  <pre><code>TWTRTwitter.sharedInstance().logIn(completion: { (session, error) in
              if (session != nil) {
                  print("signed in as \(session?.userName)");
              } else {
                  print("error: \(error?.localizedDescription)");
              }
          })
  </code></pre>
  
  <p>This is my app delegate </p>
  
  <pre><code>import TwitterKit
  
  
  @UIApplicationMain
  class AppDelegate: UIResponder, UIApplicationDelegate {
  
  
  var window: UIWindow?
  
  
  func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -&gt; Bool {
  
  TWTRTwitter.sharedInstance().start(withConsumerKey:"XzbZgtanfchiPGRRpII1gu70Z",consumerSecret: "4cNlyYssitGQjoWob4eGnBYeCVP20yVNL9P7w9fI4TzhO4RGKg")
  
      return true
  }
  
  func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -&gt; Bool {
      if TWTRTwitter.sharedInstance().application(app, open: url, options: options) {
          return true
      }
  
      return true
    }
  }
  </code></pre>
  
  <p>so how can i implement twitter without this error i searched more and more for a solution but i don't get a correct answer.</p>