【发布时间】:2017-08-27 05:12:07
【问题描述】:
我正在尝试在 iMessage Sticker 应用中添加链接。该链接将打开 iTunes 贴纸商店页面。当我在 MessagesViewController.swift 文件中添加这些代码时,我得到一个错误“'shared' is unvailable: Use view controller based solutions where applicable”。如何正确添加链接?
func clickMe(sender:UIButton!)
{
UIApplication.shared.open(URL(string: "itms-apps://itunes.apple.com/app/id11111111")!)
print("Button Clicked")
}
【问题讨论】:
-
MessagesViewController 是 UIViewViewContoller 的子类吗?
标签: ios swift sdk imessage imessage-extension