Learn Courses My Dashboard

Pass String/Data to Watchkit Modal Controller

I want to pass data (TeamName) from my Main WKInterfaceContoller (ScoreCardController) TO a MODAL Page (CardOneModalController). The Data FROM the Modal Controller goes through a CardModel (NSObject) and working correct, but cannot find a solution how to Send/Pass a String (TeamNames) to the Modal…?

My ScoreCardController receives a TeamName (Eg. CHIEFS) from the Setup page:
if let dict: [String:Any] = context as? [String : Any] {
team1Name = dict[“teamOne”] as! String
} TeamOneName.setText(team1Name)

I use the following Code on the ScoreCardController:
var addCard1 = CardModel(newTeamOne: “CHIEFS”)

Through the CardModel: NSObject {
var newTeamOne: String
init(newTeamOne: String) {
self.newTeamOne = newTeamOne

Then the CardOneModalController (with code below) Accepts the Data “CHIEFS”:
override func awake(withContext context: Any?) {
super.awake(withContext: context)
let addCardOne = context as! CardModel
newT1Name = addCardOne.newTeamOne
delegate = addCardOne.delegate as? CardOneDelegate
updateDisplay()

teamOneName.setText(newT1Name)

HOWEVER, how do I Code the ScoreCardController “CardModel(newTeamOne: “CHIEFS”” to accept a String/Data from the Setup Page…?

Note that a Button initiates CardOneModalController:
@IBAction func addCardOne() {
addCard1.delegate = self
let context: AnyObject? = addCard1
presentController(withName: “CardOne”, context: context)

PLEASE HELP, I’m a Part-time Coder and been stuck on this for four weeks…