0
我正在尋找關於如何填充文本到Twitter發佈一點點幫助,使用下面的按鈕,我可以得到一個標籤,以顯示IOS填充Twitter發佈
當「爲00:35' 的目標」點擊按鈕我想打開我可以製作出來的twitter,然後填充它以準備發送推文。
@IBAction func goalClicked(_ sender: UIButton) {
tempTimelineLbl.text = "\(stopWatchString)' \("Goal for")"
}
我會用下面的代碼打開Twitter的
let twUrl: URL = URL(string: "twitter://user?screen_name=\(club.twitter)")!
let twUrlWeb: URL = URL(string: "https://twitter.com/\(club.twitter)")!
if (UIApplication.shared.canOpenURL(twUrl)) {
UIApplication.shared.open(twUrl, options: [:], completionHandler: {
(Sucess) in
})
} else {
UIApplication.shared.open(twUrlWeb, options: [:], completionHandler: {
(Sucess) in
})
}