Swift - 使用自定义视图控制器

时间:2017-02-10 03:24:54

标签: ios iphone swift cocoapods

哇噢!我的第一篇Stack Overflow帖子:)

我在尝试在Swift中使用自定义视图控制器时遇到了一些问题。

我正在使用此处的PopupDialog API:https://github.com/Orderella/PopupDialog#default-dialog-properties

此代码工作正常,弹出窗口显示为欲望:

    let title = "THIS IS THE DIALOG TITLE"
    let message = "This is the message section of the popup dialog default view"
    // Create the dialog
    let popup = PopupDialog(title: title, message: message, image: nil)
    self.present(popup, animated: true, completion: nil)`

但是当我尝试使用我自己的View Controller时:

let ratingVC = popupViewController(nibName: "popupViewController", bundle: nil)
let popup = PopupDialog(viewController: ratingVC, buttonAlignment: .horizontal, transitionStyle: .bounceDown, gestureDismissal: true)
present(popup, animated: true, completion: nil)

该程序将编译并运行,但弹出窗口不再像之前那样出现。我面临着一个暗屏调暗以准备弹出窗口,但因此,视图控制器不会出现。

此外,任何好的Swift资源都会受到高度赞赏,到目前为止我的学习都是通过网页浏览完成的。谢谢!

0 个答案:

没有答案