Skip to content
Permalink
Browse files

SWE-13 [swiftlint] resolve swiftlint warnings

  • Loading branch information
ahm11003 committed Apr 9, 2019
1 parent 3594b68 commit 0c9a242022d968863fdf20f6204983f8355dd176
@@ -25,11 +25,10 @@ class PaymentDetailInterfaceController: WKInterfaceController {
@IBOutlet weak var paymentButton: WKInterfaceButton!
@IBOutlet weak var payFrom: WKInterfaceLabel!
@IBOutlet weak var separate: WKInterfaceSeparator!


override func awake(withContext context: Any?) {
super.awake(withContext: context)

guard let data = context as? [String: Any], let acct = data["acct"] as? Account, let amount = data["payment_amount"] as? Double else {
NSLog("Error getting account object and payment amount")
return
@@ -52,17 +51,18 @@ class PaymentDetailInterfaceController: WKInterfaceController {
let type: PaymentType = self.paymentAmount == self.selectedAccount?.curBalance ? .currentBal : .minimumDue

// process this payment using default bank account (9999) until ability to change account is implemented
guard let bankacct = UserDefaults.standard.dictionary(forKey: "default_bank_acct") as? [String: String], let bankID = bankacct["bankAcctId"] else{
NSLog("Error retrieving Payment Option")
return
guard let bankacct = UserDefaults.standard.dictionary(forKey: "default_bank_acct") as? [String: String],
let bankID = bankacct["bankAcctId"] else {
NSLog("Error retrieving Payment Option")
return
}
FetchData.submitPayment(for: alias, type: type, amount: self.paymentAmount, bankID: bankID) { confirmationNum, paymentID, error in
guard error == nil else {
let dismiss = WKAlertAction(title: "Dismiss", style: .cancel, handler: {})
self.presentAlert(withTitle: "Error", message: "We were unable to process your payment at this time. Please try again later.", preferredStyle: .alert, actions: [dismiss])
return
}

self.dictForPayment.updateValue(confirmationNum, forKey: "payment_confirmation_number")
self.dictForPayment.updateValue(paymentID, forKey: "payment_id")
self.activityIndicator.stopAnimatingAsIndicator()
@@ -81,7 +81,7 @@ class PaymentDetailInterfaceController: WKInterfaceController {
}
}
}

@IBAction func bankAccountsTapped() {
configureInterfaceObjects(true)
activityIndicator.configureForActivityIndicator()
@@ -96,7 +96,6 @@ class PaymentDetailInterfaceController: WKInterfaceController {
self.activityIndicator.stopAnimatingAsIndicator()
self.pushController(withName: "PaymentOptions", context: self.dictForBankAcct)
}

}

override func willActivate() {
@@ -111,7 +110,7 @@ class PaymentDetailInterfaceController: WKInterfaceController {
// This method is called when watch view controller is no longer visible
super.didDeactivate()
}

private func configureInterfaceObjects(_ hide: Bool) {
detailButton.setHidden(hide)
amount.setHidden(hide)
@@ -23,17 +23,17 @@ class PaymentOptionsInterfaceController: WKInterfaceController {
bankAccts = accts
configureRows()
}

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()
}

private func configureRows() {
bankAcctTable.setNumberOfRows(bankAccts.count, withRowType: "bankAcctCell")
for index in 0..<bankAcctTable.numberOfRows {
@@ -43,7 +43,7 @@ class PaymentOptionsInterfaceController: WKInterfaceController {
}
}
}

override func table(_ table: WKInterfaceTable, didSelectRowAt rowIndex: Int) {
let acct = bankAccts[rowIndex]
dictForDefault.updateValue(acct.acctType.rawValue, forKey: "acctType")
@@ -41,7 +41,7 @@ class TransactionsInterfaceController: WKInterfaceController {
"merchant": transaction.merchantID,
"date": transaction.date,
"amount": transaction.amount]

presentController(withName: "TransactionDetails", context: context)
}

@@ -25,4 +25,3 @@ class BankAcct: NSObject {
self.last4Acct = last4Acct
}
}

@@ -12,7 +12,7 @@ extension UserDefaults {
func setDefaultBankAccount(_ acct: BankAcct) {
UserDefaults.standard.set(acct, forKey: "default_bank_acct")
}

func getDefaultBankAccount() -> BankAcct? {
if let bank = UserDefaults.standard.value(forKey: "default_bank_acct") as? BankAcct {
return bank

0 comments on commit 0c9a242

Please sign in to comment.
You can’t perform that action at this time.