TWTRComposerViewController not appearing in iPhone X landscape

浪尽此生 提交于 2019-12-13 03:25:10

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!