在发送邮件时,点击发送或取消按钮视图控制器停留在那里和应用程序停止.
// swift 2.2; xcode 7.3.1;
if( MFMailComposeViewController.canSendMail() ) {
print("Can send email.")
}
var subjectText = "Verification"
var toReceipients = ["notorious.roman@gmail.com"]
// var msgBody = "Verified"
var mc:MFMailComposeViewController = MFMailComposeViewController()
mc.mailComposeDelegate = self
mc.setSubject(subjectText)
mc.setMessageBody("Verified", isHTML: false)
mc.setToRecipients(toReceipients)
self.presentViewController(mc, animated: true, completion: nil)
}
func mailComposeController(controller: MFMailComposeViewController, didFinishWithResult result: MFMailComposeResult, error: NSError?) {
self.dismissViewControllerAnimated(true, completion: nil)
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试在Xcode 11和macOS Catalina中使用swiftUI。但是创建新项目后,有一个带有文字的样板代码,上面写着“ hello World”。我希望在代码旁的画布中实时预览此简单的欢迎消息。
当我按下简历按钮时:它说:
无法在此文件中预览-无法启动[应用名称]
我尝试点击诊断按钮以生成报告以将其发送给APPLE,说:
[FailedToLaunchError(URL:file:///Users/naive/Library/Developer/Xcode/DerivedData/first_swiftUI-dymizjogcbtouhclgjhhefagmcqo/Build/Intermediates.noindex/Previews/first_swiftUI/Products/Debug-iphoneos/first-swift: = NSOSStatusErrorDomain代码= -10661“(null)” UserInfo = {_ LSLine = 3554,_LSFunction = _LSOpenStuffCallLocal},failureCategory:UVFoundation.FailureCategory.infrastructureFailure)]
这是代码,这是Xcode 11和SwiftUI选项选中时创建的新项目随附的默认代码:
import SwiftUI
struct ContentView : View {
var body: some View {
Text("Hello World")
}
}
#if DEBUG
struct ContentView_Previews : PreviewProvider {
static var previews: some View {
ContentView()
}
}
#endif
Run Code Online (Sandbox Code Playgroud)
我希望画布能够显示并实时显示我的代码。画布不显示!
生成了两个警告消息:
:0:警告:导入的声明'UITableViewDiffableDataSourceCellProvider'无法映射到'UITableViewDiffableDataSourceReference.CellProvider'
:0:警告:导入的声明'UICollectionViewDiffableDataSourceCellProvider'无法映射到'UICollectionViewDiffableDataSourceReference.CellProvider'
除此之外,带有iPadOS Beta的My iPad 11“可以运行该应用程序,模拟器也可以正常运行