Skip to content
Permalink
17dd1df3c3
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
30 lines (25 sloc) 1.06 KB
//
// LastPaymentInterfaceController.swift
// SynchronyFinancial WatchKit Extension
//
// Created by Alan Maynard on 4/23/19.
// Copyright © 2019 Alan Maynard. All rights reserved.
//
import WatchKit
import Foundation
class LastPaymentInterfaceController: WKInterfaceController {
@IBOutlet var descriptionLabel: WKInterfaceLabel!
@IBOutlet var valueLabel: WKInterfaceLabel!
override func awake(withContext context: Any?) {
super.awake(withContext: context)
guard let data = context as? [Any], data.count == 2, let last = data[0] as? Double, let rate = data[1] as? Int else {
NSLog("Error getting utilization data from wellness.")
return
}
valueLabel.setText(String(format: "$%.2f", last))
descriptionLabel.setText("At this rate*, 0% utilization reached in \(rate) month(s).")
}
@IBAction func showDetails() {
presentAlert(withTitle: "Last Payment", message: Defaults.LAST_PAYMENT, preferredStyle: .alert, actions: [WKAlertAction(title: "Done", style: .default, handler: {})])
}
}