Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Passing data to the Apple Watch

Hello,

I'm having an issue passing data to my Apple Watch InterfaceController.swift file from another file within the app called "current"

Currently I have the following:

import WatchKit
import Foundation
import Stormy //folder which has the current.swift file. 


class InterfaceController: WKInterfaceController {

    @IBOutlet weak var currentTemp: WKInterfaceLabel!

    override init(context: AnyObject?) {
        // Initialize variables here.
        super.init(context: context)

        self.currentTemp.setText("\(self.temperature)")

        // Configure interface objects here.
        NSLog("%@ init", self)
    }

    override func willActivate() {
        // This method is called when watch view controller is about to be visible to user
        super.willActivate()
        NSLog("%@ will activate", self)
    }

    override func didDeactivate() {
        // This method is called when watch view controller is no longer visible
        NSLog("%@ did deactivate", self)
        super.didDeactivate()
    }

}