ios - PresentViewController 故障排除

标签 ios swift xcode6

在我的 swift 应用程序中,我试图让点击按钮切换 View Controller 。这是我正在使用的代码:

presentViewController(pythTheoremViewController.self, animated: true, completion: nil)

这将返回错误“无法使用类型参数列表调用‘presentViewController’)pythTheoremViewController.Type, animated: Bool, completion: nil)

这是什么意思,我该如何解决?

最佳答案

如果您的 ViewController 实例是 pythTheoremViewController,请删除 self

关于ios - PresentViewController 故障排除,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30947793/

相关文章:

ios - 如何在 Xcode11 的 Swift 中随机播放数组中的音频文件?

ios - Xcode 组织者 : Can't Remove Device

ios - NSTextAttachment 未显示在今日通知中心小部件中

swift - 在 Swift 中使用 C 字符串,或 : How to convert UnsafePointer<CChar> to CString

ios - 禁止 UITableViewcontroller 横向旋转(保持纵向)

ios - 如果 registerForRemoteNotificationTypes : is not supported in iOS 8. 0 及更高版本,则为 iOS 构建

ios - Swift - 以度为单位的图像旋转 - 变形结果

ios - SpriteKit swift 3 中消失的按钮和标签

ios - 在 Watch App 中创建进度圈作为 WKInterfaceImage

ios - 切换到 XCode6 后使用空枚举