我创建了一个小的应用程序使用SWIFT来获得IOS剪贴板,但是当我尝试鸣叫的变量,它不会显示为一个字符串,它显示为鸣叫没有显示字符串变量?
<UILabel: 0x146db1a30; frame = (78.6667 229; 257 147); text = 'I'm on my way right now'; opaque = NO; autoresize = RM+BM; userInteractionEnabled = NO; layer = <_UILabelLayer: 0x146db1fd0>>
代替
\(clipText)
我得剪贴板内容的代码是
let pasteboardString:String? = UIPasteboard.generalPasteboard().string
clipText.text = pasteboardString`
当我使用此代码发布推文
let tweetController = SLComposeViewController(forServiceType: SLServiceTypeTwitter)
tweetController.setInitialText("Here's what was on my clipboard:(clipText)")
我从顶部获取文本。
Image of the code I get instead of (clipText)
你想'clipText.text',不'clipText'。 – rmaddy