Skip to content

Commit

Permalink
SWF-21 Extensions on WKInterfaceImage
Browse files Browse the repository at this point in the history
- this will enable us to quickly show, hide and configure “activity indicators”
- to be used when we are waiting for web service calls to return
- added Image assets for animation
  • Loading branch information
ahm11003 committed Mar 28, 2019
1 parent a3682e4 commit 56caa7c
Show file tree
Hide file tree
Showing 27 changed files with 177 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "cc_activity0.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "cc_activity0@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "cc_activity0@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "cc_activity1.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "cc_activity1@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "cc_activity1@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "cc_activity2.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "cc_activity2@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "cc_activity2@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "cc_activity3.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "cc_activity3@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "cc_activity3@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "cc_activity4.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "cc_activity4@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "cc_activity4@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "cc_activity5.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "cc_activity5@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "cc_activity5@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//
// WKInterfaceImage+Extensions.swift
// SynchronyFinancial WatchKit Extension
//
// Created by Alan Maynard on 3/28/19.
// Copyright © 2019 Alan Maynard. All rights reserved.
//

import Foundation
import WatchKit

extension WKInterfaceImage {
public func configureForActivityIndicator() {
self.setHidden(false)
self.setImageNamed("cc_activity_")
self.setHorizontalAlignment(.center)
self.setVerticalAlignment(.center)
startAnimatingAsIndicator()
}

public func startAnimatingAsIndicator() {
self.startAnimatingWithImages(in: .init(location: 0, length: 6), duration: 0.5, repeatCount: 0)
}

public func stopAnimatingAsIndicator() {
self.setHidden(true)
self.stopAnimating()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
48F2430D2214CBF700B9C894 /* Account.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48F2430B2214CBF700B9C894 /* Account.swift */; };
48F2430E2214CBF700B9C894 /* Transaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48F2430C2214CBF700B9C894 /* Transaction.swift */; };
48F2430F2214CC2200B9C894 /* Transaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48F2430C2214CBF700B9C894 /* Transaction.swift */; };
67228CD8224D6E2700CA29E4 /* WKInterfaceImage+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 67228CD7224D6E2700CA29E4 /* WKInterfaceImage+Extensions.swift */; };
673F396E21A644570051469E /* MainMenuInterfaceController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 673F396C21A644460051469E /* MainMenuInterfaceController.swift */; };
673F397021A652A00051469E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 673F396F21A652A00051469E /* Assets.xcassets */; };
676392B422429DC800740A8C /* TransactionsInterfaceController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 676392B322429DC800740A8C /* TransactionsInterfaceController.swift */; };
Expand Down Expand Up @@ -88,6 +89,7 @@
48F2430B2214CBF700B9C894 /* Account.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Account.swift; sourceTree = "<group>"; };
48F2430C2214CBF700B9C894 /* Transaction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Transaction.swift; sourceTree = "<group>"; };
4EA10823B2E5A7A4FEF31740 /* libPods-SynchronyFinancial WatchKit App.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SynchronyFinancial WatchKit App.a"; sourceTree = BUILT_PRODUCTS_DIR; };
67228CD7224D6E2700CA29E4 /* WKInterfaceImage+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WKInterfaceImage+Extensions.swift"; sourceTree = "<group>"; };
673F396C21A644460051469E /* MainMenuInterfaceController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainMenuInterfaceController.swift; sourceTree = "<group>"; };
673F396F21A652A00051469E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
676392B322429DC800740A8C /* TransactionsInterfaceController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransactionsInterfaceController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -194,6 +196,7 @@
children = (
676392B322429DC800740A8C /* TransactionsInterfaceController.swift */,
673F396C21A644460051469E /* MainMenuInterfaceController.swift */,
67228CD7224D6E2700CA29E4 /* WKInterfaceImage+Extensions.swift */,
67BAC28D219E254900713FEF /* ExtensionDelegate.swift */,
48F243062214C98600B9C894 /* AccountTableInterfaceController.swift */,
678C38832230950100FEAAF6 /* AccountDetailsInterfaceController.swift */,
Expand Down Expand Up @@ -475,6 +478,7 @@
48F2430F2214CC2200B9C894 /* Transaction.swift in Sources */,
676392B422429DC800740A8C /* TransactionsInterfaceController.swift in Sources */,
48DA0058221D12E70081A500 /* AccountCell.swift in Sources */,
67228CD8224D6E2700CA29E4 /* WKInterfaceImage+Extensions.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down

0 comments on commit 56caa7c

Please sign in to comment.