【问题标题】:Error "Missing argument for parameter 'coder' in call"错误“调用中的参数 'coder' 缺少参数”
【发布时间】:2019-11-25 04:41:38
【问题描述】:

我正在尝试运行此代码,但我收到一条错误消息 调用中的参数“编码器”缺少参数 如果有人可以帮我解决这个错误。

完整代码请访问:https://github.com/aidev1065/WWDC2018_Scholarship_Submission-Accepted/blob/master/README.md

        let vc = PageViewController()
        vc.modalPresentationStyle = .formSheet
        present(vc, animated: true, completion: nil)

【问题讨论】:

  • PageViewController 没有确认像() 这样的默认初始化程序,您应该在 PageViewController 中自定义它(或者您可以创建子类)init() { }

标签: ios swift xcode uiviewcontroller storyboard


【解决方案1】:

在 PageViewController 类中删除旧方法 init 并添加新方法

override init(transitionStyle style: UIPageViewController.TransitionStyle, navigationOrientation: UIPageViewController.NavigationOrientation, options: [UIPageViewController.OptionsKey : Any]? = nil) { super.init(transitionStyle: .scroll, navigationOrientation: .horizontal, options: options) }

你的问题就解决了

【讨论】:

    猜你喜欢
    • 2016-01-18
    • 2021-10-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-01-15
    • 2012-02-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多