Permalink
Cannot retrieve contributors at this time
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?
SynchronyFinancialWatchApp/SynchronyFinancial/SynchronyFinancial WatchKit Extension/ConsistencyInterfaceController.swift
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
53 lines (45 sloc)
1.41 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// BalanceInterfaceController.swift | |
// SynchronyFinancial WatchKit Extension | |
// | |
// Created by Jonathan Duarte on 2/18/19. | |
// Copyright © 2019 Alan Maynard. All rights reserved. | |
// | |
import WatchKit | |
import Foundation | |
class ConsistencyInterfaceController: WKInterfaceController { | |
var didAnimate: Bool = false | |
var latePayments: Int = 3 | |
var score: Int? | |
@IBOutlet weak var image4: WKInterfaceImage! | |
override func awake(withContext context: Any?) { | |
super.awake(withContext: context) | |
//Assigns a score based on # of late payments | |
/*switch latePayments { | |
case 1: | |
score = 80 | |
case 2: | |
score = 55 | |
case 3: | |
score = 25 | |
default: | |
score = 100 | |
}*/ | |
} | |
override func didAppear() { | |
// Called when watch interface is visible to user | |
if !didAnimate { | |
image4.setImageNamed("scores") | |
image4.startAnimatingWithImages(in: NSRange(location: 1, length: score ?? 0), duration: 1.5, repeatCount: 1) | |
didAnimate = true | |
} | |
} | |
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() | |
} | |
} |