0
私はTwitter用のソーシャルフレームワークをインポートして、ソーシャルボタンが押されたときにビューを呼び出そうとしています。これは私のコードであり、 "Value of type 'GameOverScene'にはメンバーが存在しません"というビューを表示しようとしています。現在表示:Swift 3
if SLComposeViewController.isAvailable(forServiceType: SLServiceTypeTwitter) {
let tweetController = SLComposeViewController(forServiceType: SLServiceTypeTwitter)
tweetController?.setInitialText("I Scored \(scoreNumber) on Gone Dots! You can try by downloading Gone Dots from the app store for free")
self.present(tweetController, animated: true, completion: true)
} else {
let alert = UIAlertController(title: "Account", message: "Plese log into Twitter", preferredStyle: UIAlertControllerStyle.alert)
alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: nil))
alert.addAction(UIAlertAction(title: "Settings", style: UIAlertActionStyle.default, handler: {
(UIAlertAction) in
let settingsURL = NSURL(string: UIApplicationOpenSettingsURLString)
if let url = settingsURL{
UIApplication.shared.openURL(url as URL)
}
}))
self.present(alert, animated: true, completion: true)
}
ありがとう、私はUIActivityViewControllerとその作業を使用しています –