1

In my storyboard, I have 3 Interface Controller objects. I have assigned each one an identifier in the attributes tab.

I then have a class "TasksController" that is a WKInterfaceController. For each Interface Controller, I set the custom class to be "TasksController".

My code currently looks like:

import WatchKit
import Foundation

class TasksController: WKInterfaceController {

override func awakeWithContext(context: AnyObject?) {
    super.awakeWithContext(context)
    print(context)
}

override func willActivate() {
    // This method is called when watch view controller is about to be visible to user
    super.willActivate()
}

override func didDeactivate() {
    // This method is called when watch view controller is no longer visible
    super.didDeactivate()
}

Is it possible to get the Interface Controller's Identifier in awakeWithContext? I have a "next page" segue between each of the Interface Controller's. context is nil whenever I print it out. Am I approaching this the wrong way?

I would like the identifier so that I can change some properties of TasksController, depending on the instance.

Brittany
  • 352
  • 5
  • 13
  • Possible duplicate of [How to detect which sequence in segue for watchKit?](http://stackoverflow.com/questions/36255075/how-to-detect-which-sequence-in-segue-for-watchkit) –  Mar 28 '16 at 04:32

0 Answers0