From 56ace2a02c1596b6cfa77f8d02b9beceb4067686 Mon Sep 17 00:00:00 2001 From: Felix Mau Date: Sun, 25 Aug 2019 10:04:51 +0200 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20::=20Renamed=20`GradientVi?= =?UTF-8?q?ew`=20to=20`GradientActivityIndicatorView`=20to=20match=20namin?= =?UTF-8?q?g=20from=20apple=20docs:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit > For an indeterminate progress indicator—or, informally, a “spinner”—use an instance of the UIActivityIndicatorView class. https://developer.apple.com/documentation/uikit/uiprogressview --- Example/Pods/Pods.xcodeproj/project.pbxproj | 35 +++++++++---------- .../GradientLoadingBarController.swift | 2 +- ...ft => GradientActivityIndicatorView.swift} | 8 ++--- 3 files changed, 21 insertions(+), 24 deletions(-) rename GradientLoadingBar/Classes/Views/{GradientView.swift => GradientActivityIndicatorView.swift} (92%) diff --git a/Example/Pods/Pods.xcodeproj/project.pbxproj b/Example/Pods/Pods.xcodeproj/project.pbxproj index d44c281..db7516d 100644 --- a/Example/Pods/Pods.xcodeproj/project.pbxproj +++ b/Example/Pods/Pods.xcodeproj/project.pbxproj @@ -15,6 +15,7 @@ dependencies = ( ); name = SwiftFormat; + productName = SwiftFormat; }; F40CA0216C90A76EEE32F7C25565C0D5 /* SwiftLint */ = { isa = PBXAggregateTarget; @@ -24,11 +25,11 @@ dependencies = ( ); name = SwiftLint; + productName = SwiftLint; }; /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ - 080ACAAD7027C9CAA3D5D77119886B5B /* GradientView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3EFD33CD08A4BE666738E7BE75E1118 /* GradientView.swift */; }; 15B16155625C3C7403E87EDE94E054A4 /* GradientLoadingBarViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF84019AF35A64CA921E243A6ACA5D63 /* GradientLoadingBarViewModel.swift */; }; 1ADF9BF9E149214C8622227668BD4856 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F0DB0084C5FD0BFC8785550E7F61F815 /* Foundation.framework */; }; 3574EE6B8B614281BC597E05E126F6C8 /* Disposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 71CD0D37F86BED1B0F9C734FA9A5C426 /* Disposable.swift */; }; @@ -37,6 +38,7 @@ 442729408E0F98A2AA212AC082B6928A /* Observable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9CAA017B1769B508492A30175B3B3267 /* Observable.swift */; }; 4E60DD2293BBDB5908A44CAD852E7009 /* Pods-GradientLoadingBar_Example-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = ECA371741105B3DF85A5C4ABAFAF4435 /* Pods-GradientLoadingBar_Example-dummy.m */; }; 5DDA45277A2B0B02F88A5115C6E32176 /* LightweightObservable-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 2C9503A92D75F057290500525EA8329E /* LightweightObservable-dummy.m */; }; + 64FD172C231277D300DF1758 /* GradientActivityIndicatorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 64FD172B231277D300DF1758 /* GradientActivityIndicatorView.swift */; }; 6C72703D45301EF1EBB4178ED1651A2D /* UIColor+CustomColors.swift in Sources */ = {isa = PBXBuildFile; fileRef = 920D4565037D3F8BF91055C6BBCE640B /* UIColor+CustomColors.swift */; }; 7259255EA867E911C979F0C8661C58B5 /* LightweightObservable.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA560EE447F3A7C6E598FE3F43C8666E /* LightweightObservable.framework */; }; 844FDF2FBE9041B7FBAE7824835A37C7 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F0DB0084C5FD0BFC8785550E7F61F815 /* Foundation.framework */; }; @@ -101,10 +103,10 @@ /* Begin PBXFileReference section */ 001F907F0DFD753BD76DBEE173CF9BE8 /* UIColor+DefaultValues.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = "UIColor+DefaultValues.swift"; sourceTree = ""; }; - 02DC18BBD7B2CB4A72C2ECC84CC5A8A2 /* readme.md */ = {isa = PBXFileReference; includeInIndex = 1; path = readme.md; sourceTree = ""; }; + 02DC18BBD7B2CB4A72C2ECC84CC5A8A2 /* readme.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; path = readme.md; sourceTree = ""; }; 039E951B977EC50AB9A57E4DB6031FBA /* BottomGradientLoadingBarController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BottomGradientLoadingBarController.swift; path = GradientLoadingBar/Classes/BottomGradientLoadingBarController.swift; sourceTree = ""; }; 07370A8F5694F979E74A06170272FEE8 /* Pods-GradientLoadingBar_Example-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-GradientLoadingBar_Example-frameworks.sh"; sourceTree = ""; }; - 12F6F80AD27B5CFD536189194A1775A1 /* GradientLoadingBar.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; lastKnownFileType = text; path = GradientLoadingBar.podspec; sourceTree = ""; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + 12F6F80AD27B5CFD536189194A1775A1 /* GradientLoadingBar.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; path = GradientLoadingBar.podspec; sourceTree = ""; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 130BB2A239D210382E59A64538F9B359 /* Pods-GradientLoadingBar_Tests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-GradientLoadingBar_Tests-dummy.m"; sourceTree = ""; }; 13CDF08BD921D579623895BA96539BCE /* Pods-GradientLoadingBar_Example-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-GradientLoadingBar_Example-umbrella.h"; sourceTree = ""; }; 187D523BA78748FBB701C5EA6E9BCDE7 /* LightweightObservable.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = LightweightObservable.xcconfig; sourceTree = ""; }; @@ -112,30 +114,30 @@ 2C9503A92D75F057290500525EA8329E /* LightweightObservable-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "LightweightObservable-dummy.m"; sourceTree = ""; }; 3717A0C2307C679A319FB78F9AF72963 /* LightweightObservable-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "LightweightObservable-umbrella.h"; sourceTree = ""; }; 3E54BC52F5C7076999D36343A60C7100 /* Pods-GradientLoadingBar_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-GradientLoadingBar_Example.debug.xcconfig"; sourceTree = ""; }; - 49376B8071813F9456D736A5B08EB26A /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; path = LICENSE; sourceTree = ""; }; + 49376B8071813F9456D736A5B08EB26A /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = LICENSE; sourceTree = ""; }; 49794D1BDE47A0E99D52332216BC65E9 /* Pods-GradientLoadingBar_Tests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-GradientLoadingBar_Tests-acknowledgements.markdown"; sourceTree = ""; }; - 59019813B7B7C20236A6AA1D2846F2E5 /* Pods_GradientLoadingBar_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_GradientLoadingBar_Example.framework; path = "Pods-GradientLoadingBar_Example.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; + 59019813B7B7C20236A6AA1D2846F2E5 /* Pods_GradientLoadingBar_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_GradientLoadingBar_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 5EDCEFB89A52847B272DBE9D23872FF4 /* UIView+AnimateIsHidden.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = "UIView+AnimateIsHidden.swift"; sourceTree = ""; }; + 64FD172B231277D300DF1758 /* GradientActivityIndicatorView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GradientActivityIndicatorView.swift; sourceTree = ""; }; 670D1598351BCDDA2ACA6F3ECB0434BB /* SwiftFormat.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = SwiftFormat.xcconfig; sourceTree = ""; }; - 67825F7600B8C1C05F1A3AF6CBF0145A /* LightweightObservable.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = LightweightObservable.framework; path = LightweightObservable.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 67825F7600B8C1C05F1A3AF6CBF0145A /* LightweightObservable.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = LightweightObservable.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 70CA8934341812AC48F1104950332ED0 /* Durations.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Durations.swift; sourceTree = ""; }; 71CD0D37F86BED1B0F9C734FA9A5C426 /* Disposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Disposable.swift; path = LightweightObservable/Classes/Disposable.swift; sourceTree = ""; }; 746AA1D1435C7AC54517C72ECCB1A7B2 /* GradientLoadingBar-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "GradientLoadingBar-umbrella.h"; sourceTree = ""; }; 7A9B6229649B0A1BAF9A95B2ED86470E /* Pods-GradientLoadingBar_Tests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-GradientLoadingBar_Tests.modulemap"; sourceTree = ""; }; - 7B12423F4DBB8DF2A1FA43453E5D2897 /* Pods_GradientLoadingBar_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_GradientLoadingBar_Tests.framework; path = "Pods-GradientLoadingBar_Tests.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; + 7B12423F4DBB8DF2A1FA43453E5D2897 /* Pods_GradientLoadingBar_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_GradientLoadingBar_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 884681EFBBB3C36C126C72381E290899 /* Pods-GradientLoadingBar_Tests-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-GradientLoadingBar_Tests-umbrella.h"; sourceTree = ""; }; 8BFC221633B8EEC479EE5CBC733737A0 /* LightweightObservable.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = LightweightObservable.modulemap; sourceTree = ""; }; 8F250286A5229A56B46FC13B1262852B /* SwiftLint.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = SwiftLint.xcconfig; sourceTree = ""; }; 920D4565037D3F8BF91055C6BBCE640B /* UIColor+CustomColors.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = "UIColor+CustomColors.swift"; sourceTree = ""; }; 9CAA017B1769B508492A30175B3B3267 /* Observable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Observable.swift; path = LightweightObservable/Classes/Observable/Observable.swift; sourceTree = ""; }; - 9D940727FF8FB9C785EB98E56350EF41 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; - A3EFD33CD08A4BE666738E7BE75E1118 /* GradientView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = GradientView.swift; sourceTree = ""; }; + 9D940727FF8FB9C785EB98E56350EF41 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; A905AC0A36502ED362745E3D73467B01 /* Observable+Equatable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Observable+Equatable.swift"; path = "LightweightObservable/Classes/Observable/Observable+Equatable.swift"; sourceTree = ""; }; AA595FD47218C87012335E8C73E53199 /* Pods-GradientLoadingBar_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-GradientLoadingBar_Tests.release.xcconfig"; sourceTree = ""; }; B4E04B18D9986A3500218A0A22B0D0D2 /* GradientLoadingBar-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "GradientLoadingBar-Info.plist"; sourceTree = ""; }; B7110D1E070583E64F9E9A6B741851EB /* Pods-GradientLoadingBar_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-GradientLoadingBar_Example.release.xcconfig"; sourceTree = ""; }; BEA3C1A63EABC9F08C594BBF06582E77 /* GradientLoadingBar-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "GradientLoadingBar-prefix.pch"; sourceTree = ""; }; - BFE723A0C5579F6C005375100ABF5F14 /* GradientLoadingBar.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = GradientLoadingBar.framework; path = GradientLoadingBar.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + BFE723A0C5579F6C005375100ABF5F14 /* GradientLoadingBar.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = GradientLoadingBar.framework; sourceTree = BUILT_PRODUCTS_DIR; }; C146990211AC0E37378C96105C834611 /* Pods-GradientLoadingBar_Tests-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-GradientLoadingBar_Tests-Info.plist"; sourceTree = ""; }; C5998C6D4DF5F5C7A7B721DE575E9EDD /* GradientLoadingBar.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = GradientLoadingBar.modulemap; sourceTree = ""; }; C80083841EFE765A5D0AD2D5538A7BF1 /* Pods-GradientLoadingBar_Example-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-GradientLoadingBar_Example-Info.plist"; sourceTree = ""; }; @@ -218,7 +220,6 @@ children = ( 2B1C5D8984DE17B536E3AA18AD9A36AD /* Support Files */, ); - name = SwiftLint; path = SwiftLint; sourceTree = ""; }; @@ -300,7 +301,7 @@ 65BFF50BAB48A7CEE8018AECA100AE86 /* Views */ = { isa = PBXGroup; children = ( - A3EFD33CD08A4BE666738E7BE75E1118 /* GradientView.swift */, + 64FD172B231277D300DF1758 /* GradientActivityIndicatorView.swift */, ); name = Views; path = GradientLoadingBar/Classes/Views; @@ -314,7 +315,6 @@ A905AC0A36502ED362745E3D73467B01 /* Observable+Equatable.swift */, CA369EB846547AE3200999F324A20EF1 /* Support Files */, ); - name = LightweightObservable; path = LightweightObservable; sourceTree = ""; }; @@ -332,7 +332,6 @@ children = ( DD0982CE766FEDDC6A9FF49DFB59184D /* Support Files */, ); - name = SwiftFormat; path = SwiftFormat; sourceTree = ""; }; @@ -342,7 +341,6 @@ 920D4565037D3F8BF91055C6BBCE640B /* UIColor+CustomColors.swift */, 001F907F0DFD753BD76DBEE173CF9BE8 /* UIColor+DefaultValues.swift */, ); - name = UIColor; path = UIColor; sourceTree = ""; }; @@ -351,7 +349,6 @@ children = ( 5EDCEFB89A52847B272DBE9D23872FF4 /* UIView+AnimateIsHidden.swift */, ); - name = UIView; path = UIView; sourceTree = ""; }; @@ -579,6 +576,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, ); mainGroup = CF1408CF629C7361332E53B88F7BD30C; @@ -652,11 +650,11 @@ buildActionMask = 2147483647; files = ( E8638D90B8E207A7F03F8434E4EBE91C /* BottomGradientLoadingBarController.swift in Sources */, + 64FD172C231277D300DF1758 /* GradientActivityIndicatorView.swift in Sources */, BA1188B51E71F1A983BAF250F3EFD16B /* Durations.swift in Sources */, D174D67A7CAB6866F6A7F1BE170C12A3 /* GradientLoadingBar-dummy.m in Sources */, 39E9A27B9A3A9C1E1FE9E4D41090BD1B /* GradientLoadingBarController.swift in Sources */, 15B16155625C3C7403E87EDE94E054A4 /* GradientLoadingBarViewModel.swift in Sources */, - 080ACAAD7027C9CAA3D5D77119886B5B /* GradientView.swift in Sources */, 6C72703D45301EF1EBB4178ED1651A2D /* UIColor+CustomColors.swift in Sources */, B7954C54822E17C540ED723DF4498DA1 /* UIColor+DefaultValues.swift in Sources */, B0A7E8248DA335B755E552BD0302B661 /* UIView+AnimateIsHidden.swift in Sources */, @@ -1066,8 +1064,7 @@ MTL_FAST_MATH = YES; PRODUCT_NAME = "$(TARGET_NAME)"; STRIP_INSTALLED_PRODUCT = NO; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 4.2; SYMROOT = "${SRCROOT}/../build"; }; diff --git a/GradientLoadingBar/Classes/GradientLoadingBarController.swift b/GradientLoadingBar/Classes/GradientLoadingBarController.swift index ec4501c..792671b 100644 --- a/GradientLoadingBar/Classes/GradientLoadingBarController.swift +++ b/GradientLoadingBar/Classes/GradientLoadingBarController.swift @@ -25,7 +25,7 @@ open class GradientLoadingBarController { public let isRelativeToSafeArea: Bool /// View containing the gradient layer. - public let gradientView = GradientView() + public let gradientView = GradientActivityIndicatorView() /// Singleton instance. public static var shared = GradientLoadingBar() diff --git a/GradientLoadingBar/Classes/Views/GradientView.swift b/GradientLoadingBar/Classes/Views/GradientActivityIndicatorView.swift similarity index 92% rename from GradientLoadingBar/Classes/Views/GradientView.swift rename to GradientLoadingBar/Classes/Views/GradientActivityIndicatorView.swift index 0a25a86..520e58a 100644 --- a/GradientLoadingBar/Classes/Views/GradientView.swift +++ b/GradientLoadingBar/Classes/Views/GradientActivityIndicatorView.swift @@ -1,5 +1,5 @@ // -// GradientView.swift +// GradientActivityIndicatorView.swift // GradientLoadingBar // // Created by Felix Mau on 12/10/16. @@ -10,7 +10,7 @@ import Foundation import UIKit @IBDesignable -open class GradientView: UIView { +open class GradientActivityIndicatorView: UIView { // MARK: - Types /// Animation-Key for the progress animation. @@ -115,10 +115,10 @@ open class GradientView: UIView { animation.isRemovedOnCompletion = false animation.repeatCount = Float.infinity - gradientLayer.add(animation, forKey: GradientView.progressAnimationKey) + gradientLayer.add(animation, forKey: GradientActivityIndicatorView.progressAnimationKey) } private func stopProgressAnimation() { - gradientLayer.removeAnimation(forKey: GradientView.progressAnimationKey) + gradientLayer.removeAnimation(forKey: GradientActivityIndicatorView.progressAnimationKey) } }