问题
We are implementing TWTRComposerViewController in our landscape App for posting tweets from the App using videos created within the App. We're using the below written code:
if (Twitter.sharedInstance().sessionStore.hasLoggedInUsers()) {
let txtString = "App-Name"
let composer = TWTRComposerViewController(initialText:txtString, image:nil, videoURL:nil)
composer.delegate = self
viewController.present(composer, animated: false, completion: {
completion(true)
})
} else {
Twitter.sharedInstance().logIn { session, error in
if(error != nil){
print(error?.localizedDescription)
Error(error! as NSError)
}
if session != nil {
let txtString = "Voki"
let composer = TWTRComposerViewController(initialText: txtString, image: nil, videoURL:nil)
composer.delegate = self
viewController.present(composer, animated: false, completion: {
completion(true)
})
}
else {
completion(false)
}
}
}
This works fine in all phones, iPhone 6, 6S, 7, 7 plus but in iPhone X, the composer doesn't appear. If we check presentedViewController then it shows that TWTRComposerViewController is presented but nothing appears on App and the screen freezes out.
来源:https://stackoverflow.com/questions/48831671/twtrcomposerviewcontroller-not-appearing-in-iphone-x-landscape