小编Len*_* P.的帖子

如何在Swift 4中使用Realm?

我正在尝试在新的Xcode 9测试版中运行我当前的项目,但是当我这样做时它会说Module compiled with Swift 3.1 cannot be imported in Swift 4.0.我怎么解决这个问题?我不是在使用cocoapods.

xcode realm swift swift4 xcode9-beta

10
推荐指数
1
解决办法
6600
查看次数

如何在应用程序名称中添加空格

我正在尝试为我的应用程序名称添加空格,即使我的 Bundle 显示名称包含空格,它们也不会显示在模拟器上。

有谁知道如何做到这一点?

非常感谢

ios xcode8

6
推荐指数
3
解决办法
1万
查看次数

setViewControllers 不起作用

我正在尝试使用 NEXT 按钮更改 UIPageViewController 的当前 ViewController。因此,我使用委托调用 mainViewController 中的 containerViewController 中的函数。但它不执行 setViewControllers 行。

在这里你可以看到我的代码:

这是我使用委托调用的方法:

func forwardPage() {
    print("Start")
    currentPage += 1
    print(vcs[currentPage])
    self.setViewControllers([vcs[currentPage]], direction: .forward, animated: true) { (true) in
        print("Done")
    }
}
Run Code Online (Sandbox Code Playgroud)

这是我的代表:

protocol WalkthroughViewControllerDelegate {
   func forwardPage()
   func currentIndex() -> Int
}
Run Code Online (Sandbox Code Playgroud)

这是连接到我的 NEXT 按钮的功能:

@IBAction func nextButtonTapped(_ sender: Any) {
    if let index = delegate?.currentIndex() {
        print("Here... \(index)")
        switch index {
        case 0...1:
            print("Forwarding...")
            delegate?.forwardPage()
        case 2:
            dismiss(animated: true, completion: nil)
        default: break
        }
    }

    updateUI()
} …
Run Code Online (Sandbox Code Playgroud)

xcode ios uipageviewcontroller uicontainerview swift

5
推荐指数
1
解决办法
2670
查看次数