Twitter.sharedInstance().logIn completion twice and dismiss my viewController

ios

#1

Hi, I need your help.
I’m using a Twitter kit, and I’m having trouble signing in.

Twitter.sharedInstance().logIn(with: self, completion: {
session, error in
if(session != nil) {
self.loginType = SignType.twitter
if let tempToken = session?.authToken { self.snsToken = tempToken }
if let tempTokenS = session?.authTokenSecret { self.snsTokenSecret = tempTokenS }
self.myFunction()
}
})

When I try to log in using a Twitter kit
Completion is called twice
then my viewController is dismiss

If you have a solution
I want you to tell me Plese
I always thank you for your efforts.