从一个UITextField更改为另一个UITextField后,出现键盘时,输出中出现以下约束错误:
func shareToFb(_ yourImage:UIImage!)
{
let facebookURL = URL(string: "fb://")
if (UIApplication.shared.canOpenURL(facebookURL!)) {
let vc = SLComposeViewController(forServiceType:SLServiceTypeFacebook)
vc?.add(yourImage)
vc?.setInitialText("Initial text here.")
self.present(vc!, animated: true, completion: nil)
}
else {
let urlStr = "https://itunes.apple.com/us/app/workplace-by-facebook/id944921229?mt=8"
if #available(iOS 10.0, *) {
UIApplication.shared.open(URL(string: urlStr)!, options: [:], completionHandler: nil)
} else {
UIApplication.shared.openURL(URL(string: urlStr)!)
}
}
}
我看了以下内容:
尽管我学到了很多东西,但我仍然不知道如何解决这个问题。
此问题与以下内容非常相似:
但是,这已经超过一年了,也许是新版本的iOS / Xcode带来了解决方案。
我已针对该问题发布了解决方法,但正在寻找解释/真正的解决方案。