I am making a custom setup for how I want to manage my view controllers which are managed by contexts. So I made my own custom controller class called Controller
//base controller class
class Controller:UIViewController{
}
And I have a context class which manages Controllers as such
//abstract base of context classes
class Context{
}
For my first class I am doing a photo editor so I made a C_TakePhoto class which inherits from Controller (which right now is just a carbon copy of UIViewController as you saw above)
//manages the take photo view class
class C_TakePhoto:Controller{
override func viewDidLoad() {
super.viewDidLoad()
println("got here")
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
To load this class I went to the AppDelegate and set it to load the context (the context just manages controllers)
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
var p:O_PhotoEditor = O_PhotoEditor()
return true
}
O_PhotoEditor is just a context that opens up a C_TakePhoto as such
//manages photo editor
class O_PhotoEditor:Context{
var _photoEditorController:C_TakePhoto
override init()
{
println("Init on O_PhotoEditor")
_photoEditorController = C_TakePhoto()
super.init()
}
}
The "Init on O_PhotoEditor" does get printed in the console so I know 100% that this code is called. However if I go one line down into the C_TakePhoto class, the "got here" is not called in the viewDidLoad function.
Im pretty sure I need to present the view controller but I'm at a loss as to how with my custom classes.
When I started single view applications it just seemed to load the first one automatically.
Do know what step I am missing to have the viewDidLoad actually get called and to have the view appear?