Mike Haslam
Mike Haslam

Reputation: 171

Swift Use of undeclared type'...ViewController'

Hi I am a beginning iOS student I am having trouble manually installing Guillotine Menu https://github.com/Yalantis/GuillotineMenu

Using Xcode 6.3 & iOS8.3

This is what I did 1) added Guillotine Menu file and assets from example, copied to project target selected and put under my file with project name

2) Created ViewController in interface builder and set class to GuillotineMeneViewController, it was in dropdown

3) In ViewController that comes with single view application I created bar button item and button in interface builder, connected button outlet to code

4) Control dragged to GuillotineMenuViewController set segue to Custom and class GuillotineMenu it was in dropdown

5) In my ViewController I copied nav bar code from example to viewDidLoad, and copied prepare for segue after that

Tried to run and keep getting the error use of undeclared type "guillotineMenuViewController

Here is my ViewController code

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!)
}
}

Upvotes: 4

Views: 3194

Answers (1)

Mike Haslam
Mike Haslam

Reputation: 171

Thanks to help from the people at Yalantis here is what solved my problem. When I copied folder into my project I needed to check create groups and also copy items as usual also need to make sure files were added to Build phases/Compile Source

Upvotes: 1

Related Questions