Skip to content

Swf 17 credit health #17

merged 26 commits into from May 1, 2019
Changes from 1 commit
Show all changes
26 commits
Select commit Hold shift + click to select a range
radial progress indicators and page-based nav
ahm11003 Feb 13, 2019
Added Balance, Utilization, and AccountNumber Controllers. Added PLis…
Mar 6, 2019
PList Functions
ahm11003 Mar 6, 2019
Merge pull request #5 from rrk12005/demo-radial-style-progress-indica…
jod13004 Mar 6, 2019
Added Utilization score calculation
Mar 28, 2019
Renamed files to more accurately represent them. Changed wellness rad…
Mar 29, 2019
no message
Mar 29, 2019
Merge branch 'master' into SWF-17-credit-health
ahm11003 Apr 9, 2019
- Functions for utilization and account (temporary) metrics.
Apr 11, 2019
SWF-17 remove storyboard segue
ahm11003 Apr 11, 2019
SWF-17 pass our metrics to page hierarchy
ahm11003 Apr 11, 2019
SWF-17 credit utilization improvements
ahm11003 Apr 17, 2019
SWE-17 remove unused classes and files
ahm11003 Apr 17, 2019
SWF-17 fix logical error leading to bad utilization score
ahm11003 Apr 17, 2019
SWF-17 remove unused class
ahm11003 Apr 17, 2019
SWF-17 new class to display trends in credit utilization
ahm11003 Apr 17, 2019
SWF-17 new image assets, implementation for utilization trend
ahm11003 Apr 17, 2019
SWF-17 Added basic details for utilization trends
ahm11003 Apr 17, 2019
Merge branch 'master' into SWF-17-credit-health
ahm11003 Apr 17, 2019
SWF-17 More wellness implementation
ahm11003 Apr 23, 2019
SWF-17 more wellness configuration
ahm11003 Apr 23, 2019
SWF-17 remove unused code
ahm11003 Apr 23, 2019
SWF-17 More wellness implementation and improvements
ahm11003 Apr 23, 2019
SWF-17 metric calculations
ahm11003 Apr 23, 2019
SWF-17 clean up how we receive data for utilization
ahm11003 Apr 23, 2019
SWF-17 new image assets, wellness calculation
ahm11003 Apr 24, 2019
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+33 −13
Diff settings


Just for now

SWF-17 credit utilization improvements

- dynamically resize the radial indicator to allow showing a button below to explain the metric
- recolored some buttons on account details screen
  • Loading branch information...
ahm11003 committed Apr 17, 2019
commit 416c2ea7482e2ed4bb971ccdcc81a18ccd71fd30
@@ -17,7 +17,9 @@
<button alignment="center" id="8yj-m6-1L9">
<group key="contentGroup" width="1" height="0.5" alignment="left" contentMode="scaleAspectFit" layout="vertical" id="SBG-wc-YDJ">
<imageView height="0.69999999999999996" alignment="center" image="account_menu_cc_icon" contentMode="scaleAspectFit" id="zAJ-yo-M72"/>
<imageView height="0.69999999999999996" alignment="center" image="account_menu_cc_icon" contentMode="scaleAspectFit" id="zAJ-yo-M72">
<color key="tintColor" red="0.070061393082141876" green="0.36642074584960938" blue="0.30139422416687012" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<label alignment="center" text="Accounts" id="Ohi-ve-NfC"/>
@@ -56,7 +58,7 @@
<label width="1" alignment="center" text="Credit Wellness" textAlignment="center" id="eqA-XH-rlH"/>
<imageView width="1" height="86" alignment="center" verticalAlignment="center" image="scores" contentMode="scaleAspectFit" initiallyAnimated="NO" animationDuration="2" id="aTf-mo-FEr"/>
<button width="1" alignment="center" verticalAlignment="bottom" title="Tap For More" id="yYk-gv-I5B">
<button width="1" alignment="center" verticalAlignment="bottom" title="Breakdown" id="yYk-gv-I5B">
<fontDescription key="font" type="system" pointSize="13"/>
<action selector="moreButtonTapped" destination="FsK-xr-8Fi" id="uxY-jK-pTW"/>
@@ -134,12 +136,15 @@
<group width="1" alignment="left" id="ohQ-In-SGt">
<button width="67" alignment="left" title="Pay" id="zeF-ky-mkm">
<color key="backgroundColor" red="0.070061393080000006" green="0.3664207458" blue="0.3013942242" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<action selector="payBillTapped" destination="yrN-yp-gkH" id="iQy-Ty-omn"/>
<segue destination="XXR-hJ-s6t" kind="push" identifier="payBill" id="jGh-Ix-ean"/>
<button width="64" alignment="right" title="Recent" id="0HI-HK-yDl">
<color key="titleColor" red="0.070061393080000006" green="0.3664207458" blue="0.3013942242" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<action selector="recentButtonTapped" destination="yrN-yp-gkH" id="8Rp-SG-lGZ"/>
@@ -314,8 +319,17 @@
<controller identifier="UtilizationScore" id="RNe-Ul-1jm" customClass="UtilizationInterfaceController" customModule="SynchronyFinancial_WatchKit_Extension">
<label width="1" alignment="left" text="Utilization Score" textAlignment="center" id="Rzj-RR-iat"/>
<imageView width="1" height="120" alignment="center" verticalAlignment="center" image="scores" contentMode="scaleAspectFit" initiallyAnimated="NO" id="MkL-48-J8l"/>
<group width="1" height="1" alignment="left" layout="vertical" id="ad4-JN-O9D">
<label width="1" alignment="left" text="Credit Utilization" textAlignment="center" id="Rzj-RR-iat"/>
<imageView width="1" height="100" alignment="center" verticalAlignment="center" image="scores" contentMode="scaleAspectFit" initiallyAnimated="NO" id="MkL-48-J8l"/>
<button width="1" alignment="left" verticalAlignment="center" title="Details" id="AR5-QD-8ad">
<action selector="showDetails" destination="RNe-Ul-1jm" id="jBx-8s-RHe"/>
<outlet property="image3" destination="MkL-48-J8l" id="QRq-aZ-tTD"/>
@@ -17,7 +17,11 @@ class UtilizationInterfaceController: WKInterfaceController {
@IBOutlet weak var image3: WKInterfaceImage!
override func awake(withContext context: Any?) {
super.awake(withContext: context)

// resize according to screen size so we can display button below
image3.setHeight(contentFrame.height / 2)
image3.setWidth(contentFrame.height / 2)
score = context as? Int

// get plist data to generate utilization metric
@@ -49,16 +53,18 @@ class UtilizationInterfaceController: WKInterfaceController {
didAnimate = true

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

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

@IBAction func showDetails() {
presentAlert(withTitle: "Utilization Details", message: "Credit utilization is the ratio of credit used compared to total credit. Ideally, this value should be 20% or below.", preferredStyle: .alert, actions: [WKAlertAction(title: "Done", style: .default, handler: {})])
@@ -59,10 +59,10 @@ class WellnessInterfaceController: WKInterfaceController {
private func calculateUtilization() {
var totalBalance: Double = 0
var totalCredit: Double = 0
for index in 0..<accounts.count {
totalBalance += accounts[index].curBalance
totalCredit += accounts[index].creditLimit

accounts.forEach {
totalCredit += $0.availCredit
totalBalance += $0.curBalance

let util = round(((totalBalance)/(totalCredit)) * 100)
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.