Swift使用未声明的类型’… ViewController’
发布时间:2020-12-14 04:27:01 所属栏目:百科 来源:网络整理
导读:嗨,我是一名初学iOS学生,我无法手动安装 断头台菜单 https://github.com/Yalantis/GuillotineMenu 使用Xcode 6.3 iOS8.3 这就是我做的 1)从示例中添加了断头台菜单文件和资产,复制到选中的项目目标并放在我的文件中,带有项目名称 2)在界面构建器中创建ViewCo
嗨,我是一名初学iOS学生,我无法手动安装
断头台菜单 https://github.com/Yalantis/GuillotineMenu 使用Xcode 6.3& iOS8.3 这就是我做的 2)在界面构建器中创建ViewController并将类设置为GuillotineMeneViewController,它在下拉列表中 3)在单视图应用程序附带的ViewController中,我在界面构建器中创建了条形按钮项目和按钮,将按钮插座连接到代码 4)控制拖到GuillotineMenuViewController设置segue到Custom和类GuillotineMenu它在下拉列表中 5)在我的ViewController中,我将导航条形码从示例复制到viewDidLoad,然后复制为segue准备 试图运行并继续使用未声明的类型“guillotineMenuViewController” 这是我的ViewController代码 import UIKit class ViewController: UIViewController { @IBOutlet weak var barButton: UIButton! override func viewDidLoad() { super.viewDidLoad() let navBar = self.navigationController!.navigationBar navBar.barTintColor = UIColor(red: 65.0 / 255.0,green: 62.0 / 255.0,blue: 79.0 / 255.0,alpha: 1) navBar.titleTextAttributes = [NSForegroundColorAttributeName: UIColor.whiteColor()] } override func prepareForSegue(segue: UIStoryboardSegue,sender: AnyObject?) { // Your Menu View Controller vew must know the following data for the proper animatio let destinationVC = segue.destinationViewController as! GuillotineMenuViewController destinationVC.hostNavigationBarHeight = self.navigationController!.navigationBar.frame.size.height destinationVC.hostTitleText = self.navigationItem.title destinationVC.view.backgroundColor = self.navigationController!.navigationBar.barTintColor destinationVC.setMenuButtonWithImage(barButton.imageView!.image!) } } 解决方法
感谢
Yalantis人民的帮助,这就解决了我的问题. 当我将文件夹复制到我的项目中时,我需要检查创建组并像往常一样复制项目,还需要确保将文件添加到构建阶段/编译源
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |