Swift使用未声明的类型'... ViewController'

时间:2015-04-20 20:58:01

标签: swift ios8.3

您好我是一名初学iOS学生,我无法手动安装 断头台菜单https://github.com/Yalantis/GuillotineMenu

使用Xcode 6.3& iOS8.3

这就是我所做的 1)从示例中添加了断头台菜单文件和资产,复制到选中的项目目标并放在我的文件名下

2)在界面构建器中创建ViewController并将类设置为GuillotineMeneViewController,它在下拉列表中

3)在单视图应用程序附带的ViewController中,我在界面构建器中创建了条形按钮项目和按钮,连接按钮出口到代码

4)控制拖动到GuillotineMenuViewController将segue设置为Custom,并将类GuillotineMenu设置为下拉列表

5)在我的ViewController中,我将导航条形码从示例复制到viewDidLoad,然后复制prepare for 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!)
}
}

1 个答案:

答案 0 :(得分:1)

感谢Yalantis人民的帮助,这解决了我的问题。 当我将文件夹复制到我的项目中时,我需要检查创建组并像往常一样复制项目,还需要确保将文件添加到构建阶段/编译源