├── .gitignore ├── .swift-version ├── LICENSE ├── README.md ├── UbiqArchView.podspec └── UbiqArchView ├── .DS_Store ├── UbiqArchView.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── UbiqArchView ├── AppDelegate.swift ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── ViewController.swift └── source │ └── UbiqArchView.swift ├── UbiqArchViewTests ├── Info.plist └── UbiqArchViewTests.swift └── UbiqArchViewUITests ├── Info.plist └── UbiqArchViewUITests.swift /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xcuserstate 23 | 24 | ## Obj-C/Swift specific 25 | *.hmap 26 | *.ipa 27 | *.dSYM.zip 28 | *.dSYM 29 | 30 | ## Playgrounds 31 | timeline.xctimeline 32 | playground.xcworkspace 33 | 34 | # Swift Package Manager 35 | # 36 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 37 | # Packages/ 38 | .build/ 39 | 40 | # CocoaPods 41 | # 42 | # We recommend against adding the Pods directory to your .gitignore. However 43 | # you should judge for yourself, the pros and cons are mentioned at: 44 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 45 | # 46 | # Pods/ 47 | 48 | # Carthage 49 | # 50 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 51 | # Carthage/Checkouts 52 | 53 | Carthage/Build 54 | 55 | # fastlane 56 | # 57 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 58 | # screenshots whenever they are needed. 59 | # For more information about the recommended setup visit: 60 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 61 | 62 | fastlane/report.xml 63 | fastlane/Preview.html 64 | fastlane/screenshots 65 | fastlane/test_output 66 | -------------------------------------------------------------------------------- /.swift-version: -------------------------------------------------------------------------------- 1 | 3.0 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 aabrahamyan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # UbiqArchView 2 | 'UbiqArchView' is an apple App Store like animation, that shows circular progress of ongoing tasks in different states 3 | 4 | [![CI Status](http://img.shields.io/travis/Armen Abrahamyan/AAPhotoLibrary.svg?style=flat)](https://travis-ci.org/Armen Abrahamyan/UbiqArchView) 5 | [![Version](https://img.shields.io/cocoapods/v/UbiqArchView.svg?style=flat)](http://cocoapods.org/pods/UbiqArchView) 6 | [![License](https://img.shields.io/cocoapods/l/UbiqArchView.svg?style=flat)](http://cocoapods.org/pods/UbiqArchView) 7 | [![Platform](https://img.shields.io/cocoapods/p/UbiqArchView.svg?style=flat)](http://cocoapods.org/pods/UbiqArchView) 8 | 9 | 10 | 11 | Checkout on [Appetize.io](https://appetize.io/embed/px9jyf50gf6yqdzaxz7n9n2nq8). 12 | 13 | 14 | ## Example 15 | 16 | To run the example project, clone the repo, and run `pod install` from the Example directory first. 17 | 18 | ## Requirements 19 | XCode8+ 20 | Minimum Deployment Target iOS 9.3 21 | 22 | ## Installation 23 | 24 | UbiqArchView is available through [CocoaPods](http://cocoapods.org). To install 25 | it, simply add the following line to your Podfile: 26 | 27 | ```ruby 28 | pod "UbiqArchView" 29 | ``` 30 | 31 | ## Manual Installation 32 | Copy UbiqArchView.swift into your project 33 | 34 | ## Usage 35 | You can initialize it from XIB file as well as manually: 36 | ```swift 37 | let ubiqArchView = UbiqArchView(frame: CGRect(origin: point, size: boundSize)) 38 | ``` 39 | Update default parameters by setting them externaly: 40 | ```swift 41 | //Add symbol size 42 | ubiqArchView.symbolSize = 20 43 | // Width of inner static circle and broken animatable arch circle 44 | ubiqArchView.archlineWidth = 3 45 | // Progress circle line width 46 | ubiqArchView.progressLineWidth = 6 47 | // Pause symbol thickness 48 | ubiqArchView.pauseSymbolThickness = 4 49 | // Vertical distance between pause symbols and circle 50 | ubiqArchView.pauseSymbolTopMultiplicationFactor = 4 51 | // Horizontal distance between two pause symbols 52 | ubiqArchView.pauseSymbolsDistance = 3 53 | ``` 54 | Modify state when your process/task is pending, inprogress or finished 55 | ```swift 56 | // Sets Pending state 57 | ubiqArchView.setStatePending() 58 | // Sets In Progress state 59 | ubiqArchView.setStateInProgress() 60 | // Sets Paused state 61 | ubiqArchView.setStateInProgressWithPaused() 62 | // Sets state Normal 63 | ubiqArchView.setStateNormal() 64 | ``` 65 | Modify animatable progress by updating 'progress' property 66 | ```swift 67 | ubiqArchView.progress = 0.7 68 | ``` 69 | Check or change process state by accessing or modifying ubiqState property 70 | ```swift 71 | ubiqState = .pending 72 | ``` 73 | 74 | ## Whats New ? 75 | 76 | * Added pause state support 77 | * Added enum for handling state more correctly 78 | 79 | # License 80 | 81 | UbiqArchView is available under the MIT license. See the LICENSE file for more info. 82 | 83 | ## Author 84 | Armen Abrahamyan, abrahamyan.armen@gmail.com 85 | 86 | [Twitter](https://twitter.com/VvV_Spawn) 87 | 88 | 89 | -------------------------------------------------------------------------------- /UbiqArchView.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod lib lint UbiqArchView.podspec' to ensure this is a 3 | # valid spec before submitting. 4 | # 5 | # Any lines starting with a # are optional, but their use is encouraged 6 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | s.name = 'UbiqArchView' 11 | s.version = '0.0.6' 12 | s.summary = 'UbiqArchView is a state related animatable view.' 13 | 14 | # This description is used to generate tags and improve search results. 15 | # * Think: What does it do? Why did you write it? What is the focus? 16 | # * Try to keep it short, snappy and to the point. 17 | # * Write the description between the DESC delimiters below. 18 | # * Finally, don't worry about the indent, CocoaPods strips it! 19 | 20 | s.description = <<-DESC 21 | UbiqArchView is an apple App Store like animation, that shows circular progress of ongoing tasks in different states. 22 | DESC 23 | 24 | s.homepage = 'https://github.com/aabrahamyan/UbiqArchView' 25 | # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2' 26 | s.license = { :type => 'MIT', :file => 'LICENSE' } 27 | s.author = { 'Armen Abrahamyan' => 'abrahamyan.armen@gmail.com' } 28 | s.source = { :git => 'https://github.com/aabrahamyan/UbiqArchView.git', :tag => s.version.to_s } 29 | s.social_media_url = 'https://twitter.com/VvV_Spawn' 30 | 31 | s.ios.deployment_target = '9.3' 32 | 33 | s.source_files = 'UbiqArchView/UbiqArchView/source/**/*' 34 | 35 | # s.resource_bundles = { 36 | # 'AAPhotoLibrary' => ['AAPhotoLibrary/Assets/*.png'] 37 | # } 38 | # s.public_header_files = 'Pod/Classes/**/*.h' 39 | # s.frameworks = 'UIKit', 'MapKit' 40 | # s.dependency 'AFNetworking', '~> 2.3' 41 | end 42 | -------------------------------------------------------------------------------- /UbiqArchView/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aabrahamyan/UbiqArchView/11ca89d6c0b674547ec72c8ba8d240de466e1b84/UbiqArchView/.DS_Store -------------------------------------------------------------------------------- /UbiqArchView/UbiqArchView.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | C08F2D3D1DAFB82600978D08 /* UbiqArchView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C08F2D3C1DAFB82600978D08 /* UbiqArchView.swift */; }; 11 | C0BB01121DAED22A0030E81A /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0BB01111DAED22A0030E81A /* AppDelegate.swift */; }; 12 | C0BB01141DAED22A0030E81A /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0BB01131DAED22A0030E81A /* ViewController.swift */; }; 13 | C0BB01171DAED22A0030E81A /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C0BB01151DAED22A0030E81A /* Main.storyboard */; }; 14 | C0BB01191DAED22A0030E81A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C0BB01181DAED22A0030E81A /* Assets.xcassets */; }; 15 | C0BB011C1DAED22A0030E81A /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C0BB011A1DAED22A0030E81A /* LaunchScreen.storyboard */; }; 16 | C0BB01271DAED22A0030E81A /* UbiqArchViewTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0BB01261DAED22A0030E81A /* UbiqArchViewTests.swift */; }; 17 | C0BB01321DAED22A0030E81A /* UbiqArchViewUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0BB01311DAED22A0030E81A /* UbiqArchViewUITests.swift */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXContainerItemProxy section */ 21 | C0BB01231DAED22A0030E81A /* PBXContainerItemProxy */ = { 22 | isa = PBXContainerItemProxy; 23 | containerPortal = C0BB01061DAED2290030E81A /* Project object */; 24 | proxyType = 1; 25 | remoteGlobalIDString = C0BB010D1DAED2290030E81A; 26 | remoteInfo = UbiqArchView; 27 | }; 28 | C0BB012E1DAED22A0030E81A /* PBXContainerItemProxy */ = { 29 | isa = PBXContainerItemProxy; 30 | containerPortal = C0BB01061DAED2290030E81A /* Project object */; 31 | proxyType = 1; 32 | remoteGlobalIDString = C0BB010D1DAED2290030E81A; 33 | remoteInfo = UbiqArchView; 34 | }; 35 | /* End PBXContainerItemProxy section */ 36 | 37 | /* Begin PBXFileReference section */ 38 | C08F2D3C1DAFB82600978D08 /* UbiqArchView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UbiqArchView.swift; sourceTree = ""; }; 39 | C0BB010E1DAED22A0030E81A /* UbiqArchView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = UbiqArchView.app; sourceTree = BUILT_PRODUCTS_DIR; }; 40 | C0BB01111DAED22A0030E81A /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 41 | C0BB01131DAED22A0030E81A /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 42 | C0BB01161DAED22A0030E81A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 43 | C0BB01181DAED22A0030E81A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 44 | C0BB011B1DAED22A0030E81A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 45 | C0BB011D1DAED22A0030E81A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 46 | C0BB01221DAED22A0030E81A /* UbiqArchViewTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = UbiqArchViewTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 47 | C0BB01261DAED22A0030E81A /* UbiqArchViewTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UbiqArchViewTests.swift; sourceTree = ""; }; 48 | C0BB01281DAED22A0030E81A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 49 | C0BB012D1DAED22A0030E81A /* UbiqArchViewUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = UbiqArchViewUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 50 | C0BB01311DAED22A0030E81A /* UbiqArchViewUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UbiqArchViewUITests.swift; sourceTree = ""; }; 51 | C0BB01331DAED22A0030E81A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 52 | /* End PBXFileReference section */ 53 | 54 | /* Begin PBXFrameworksBuildPhase section */ 55 | C0BB010B1DAED2290030E81A /* Frameworks */ = { 56 | isa = PBXFrameworksBuildPhase; 57 | buildActionMask = 2147483647; 58 | files = ( 59 | ); 60 | runOnlyForDeploymentPostprocessing = 0; 61 | }; 62 | C0BB011F1DAED22A0030E81A /* Frameworks */ = { 63 | isa = PBXFrameworksBuildPhase; 64 | buildActionMask = 2147483647; 65 | files = ( 66 | ); 67 | runOnlyForDeploymentPostprocessing = 0; 68 | }; 69 | C0BB012A1DAED22A0030E81A /* Frameworks */ = { 70 | isa = PBXFrameworksBuildPhase; 71 | buildActionMask = 2147483647; 72 | files = ( 73 | ); 74 | runOnlyForDeploymentPostprocessing = 0; 75 | }; 76 | /* End PBXFrameworksBuildPhase section */ 77 | 78 | /* Begin PBXGroup section */ 79 | C08F2D3B1DAFB82600978D08 /* source */ = { 80 | isa = PBXGroup; 81 | children = ( 82 | C08F2D3C1DAFB82600978D08 /* UbiqArchView.swift */, 83 | ); 84 | path = source; 85 | sourceTree = ""; 86 | }; 87 | C0BB01051DAED2290030E81A = { 88 | isa = PBXGroup; 89 | children = ( 90 | C0BB01101DAED22A0030E81A /* UbiqArchView */, 91 | C0BB01251DAED22A0030E81A /* UbiqArchViewTests */, 92 | C0BB01301DAED22A0030E81A /* UbiqArchViewUITests */, 93 | C0BB010F1DAED22A0030E81A /* Products */, 94 | ); 95 | sourceTree = ""; 96 | }; 97 | C0BB010F1DAED22A0030E81A /* Products */ = { 98 | isa = PBXGroup; 99 | children = ( 100 | C0BB010E1DAED22A0030E81A /* UbiqArchView.app */, 101 | C0BB01221DAED22A0030E81A /* UbiqArchViewTests.xctest */, 102 | C0BB012D1DAED22A0030E81A /* UbiqArchViewUITests.xctest */, 103 | ); 104 | name = Products; 105 | sourceTree = ""; 106 | }; 107 | C0BB01101DAED22A0030E81A /* UbiqArchView */ = { 108 | isa = PBXGroup; 109 | children = ( 110 | C08F2D3B1DAFB82600978D08 /* source */, 111 | C0BB01111DAED22A0030E81A /* AppDelegate.swift */, 112 | C0BB01131DAED22A0030E81A /* ViewController.swift */, 113 | C0BB01151DAED22A0030E81A /* Main.storyboard */, 114 | C0BB01181DAED22A0030E81A /* Assets.xcassets */, 115 | C0BB011A1DAED22A0030E81A /* LaunchScreen.storyboard */, 116 | C0BB011D1DAED22A0030E81A /* Info.plist */, 117 | ); 118 | path = UbiqArchView; 119 | sourceTree = ""; 120 | }; 121 | C0BB01251DAED22A0030E81A /* UbiqArchViewTests */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | C0BB01261DAED22A0030E81A /* UbiqArchViewTests.swift */, 125 | C0BB01281DAED22A0030E81A /* Info.plist */, 126 | ); 127 | path = UbiqArchViewTests; 128 | sourceTree = ""; 129 | }; 130 | C0BB01301DAED22A0030E81A /* UbiqArchViewUITests */ = { 131 | isa = PBXGroup; 132 | children = ( 133 | C0BB01311DAED22A0030E81A /* UbiqArchViewUITests.swift */, 134 | C0BB01331DAED22A0030E81A /* Info.plist */, 135 | ); 136 | path = UbiqArchViewUITests; 137 | sourceTree = ""; 138 | }; 139 | /* End PBXGroup section */ 140 | 141 | /* Begin PBXNativeTarget section */ 142 | C0BB010D1DAED2290030E81A /* UbiqArchView */ = { 143 | isa = PBXNativeTarget; 144 | buildConfigurationList = C0BB01361DAED22A0030E81A /* Build configuration list for PBXNativeTarget "UbiqArchView" */; 145 | buildPhases = ( 146 | C0BB010A1DAED2290030E81A /* Sources */, 147 | C0BB010B1DAED2290030E81A /* Frameworks */, 148 | C0BB010C1DAED2290030E81A /* Resources */, 149 | ); 150 | buildRules = ( 151 | ); 152 | dependencies = ( 153 | ); 154 | name = UbiqArchView; 155 | productName = UbiqArchView; 156 | productReference = C0BB010E1DAED22A0030E81A /* UbiqArchView.app */; 157 | productType = "com.apple.product-type.application"; 158 | }; 159 | C0BB01211DAED22A0030E81A /* UbiqArchViewTests */ = { 160 | isa = PBXNativeTarget; 161 | buildConfigurationList = C0BB01391DAED22A0030E81A /* Build configuration list for PBXNativeTarget "UbiqArchViewTests" */; 162 | buildPhases = ( 163 | C0BB011E1DAED22A0030E81A /* Sources */, 164 | C0BB011F1DAED22A0030E81A /* Frameworks */, 165 | C0BB01201DAED22A0030E81A /* Resources */, 166 | ); 167 | buildRules = ( 168 | ); 169 | dependencies = ( 170 | C0BB01241DAED22A0030E81A /* PBXTargetDependency */, 171 | ); 172 | name = UbiqArchViewTests; 173 | productName = UbiqArchViewTests; 174 | productReference = C0BB01221DAED22A0030E81A /* UbiqArchViewTests.xctest */; 175 | productType = "com.apple.product-type.bundle.unit-test"; 176 | }; 177 | C0BB012C1DAED22A0030E81A /* UbiqArchViewUITests */ = { 178 | isa = PBXNativeTarget; 179 | buildConfigurationList = C0BB013C1DAED22A0030E81A /* Build configuration list for PBXNativeTarget "UbiqArchViewUITests" */; 180 | buildPhases = ( 181 | C0BB01291DAED22A0030E81A /* Sources */, 182 | C0BB012A1DAED22A0030E81A /* Frameworks */, 183 | C0BB012B1DAED22A0030E81A /* Resources */, 184 | ); 185 | buildRules = ( 186 | ); 187 | dependencies = ( 188 | C0BB012F1DAED22A0030E81A /* PBXTargetDependency */, 189 | ); 190 | name = UbiqArchViewUITests; 191 | productName = UbiqArchViewUITests; 192 | productReference = C0BB012D1DAED22A0030E81A /* UbiqArchViewUITests.xctest */; 193 | productType = "com.apple.product-type.bundle.ui-testing"; 194 | }; 195 | /* End PBXNativeTarget section */ 196 | 197 | /* Begin PBXProject section */ 198 | C0BB01061DAED2290030E81A /* Project object */ = { 199 | isa = PBXProject; 200 | attributes = { 201 | LastSwiftUpdateCheck = 0800; 202 | LastUpgradeCheck = 0800; 203 | ORGANIZATIONNAME = "Piqe Studio"; 204 | TargetAttributes = { 205 | C0BB010D1DAED2290030E81A = { 206 | CreatedOnToolsVersion = 8.0; 207 | DevelopmentTeam = J7MY3N22B3; 208 | ProvisioningStyle = Automatic; 209 | }; 210 | C0BB01211DAED22A0030E81A = { 211 | CreatedOnToolsVersion = 8.0; 212 | DevelopmentTeam = J7MY3N22B3; 213 | ProvisioningStyle = Automatic; 214 | TestTargetID = C0BB010D1DAED2290030E81A; 215 | }; 216 | C0BB012C1DAED22A0030E81A = { 217 | CreatedOnToolsVersion = 8.0; 218 | DevelopmentTeam = J7MY3N22B3; 219 | ProvisioningStyle = Automatic; 220 | TestTargetID = C0BB010D1DAED2290030E81A; 221 | }; 222 | }; 223 | }; 224 | buildConfigurationList = C0BB01091DAED2290030E81A /* Build configuration list for PBXProject "UbiqArchView" */; 225 | compatibilityVersion = "Xcode 3.2"; 226 | developmentRegion = English; 227 | hasScannedForEncodings = 0; 228 | knownRegions = ( 229 | en, 230 | Base, 231 | ); 232 | mainGroup = C0BB01051DAED2290030E81A; 233 | productRefGroup = C0BB010F1DAED22A0030E81A /* Products */; 234 | projectDirPath = ""; 235 | projectRoot = ""; 236 | targets = ( 237 | C0BB010D1DAED2290030E81A /* UbiqArchView */, 238 | C0BB01211DAED22A0030E81A /* UbiqArchViewTests */, 239 | C0BB012C1DAED22A0030E81A /* UbiqArchViewUITests */, 240 | ); 241 | }; 242 | /* End PBXProject section */ 243 | 244 | /* Begin PBXResourcesBuildPhase section */ 245 | C0BB010C1DAED2290030E81A /* Resources */ = { 246 | isa = PBXResourcesBuildPhase; 247 | buildActionMask = 2147483647; 248 | files = ( 249 | C0BB011C1DAED22A0030E81A /* LaunchScreen.storyboard in Resources */, 250 | C0BB01191DAED22A0030E81A /* Assets.xcassets in Resources */, 251 | C0BB01171DAED22A0030E81A /* Main.storyboard in Resources */, 252 | ); 253 | runOnlyForDeploymentPostprocessing = 0; 254 | }; 255 | C0BB01201DAED22A0030E81A /* Resources */ = { 256 | isa = PBXResourcesBuildPhase; 257 | buildActionMask = 2147483647; 258 | files = ( 259 | ); 260 | runOnlyForDeploymentPostprocessing = 0; 261 | }; 262 | C0BB012B1DAED22A0030E81A /* Resources */ = { 263 | isa = PBXResourcesBuildPhase; 264 | buildActionMask = 2147483647; 265 | files = ( 266 | ); 267 | runOnlyForDeploymentPostprocessing = 0; 268 | }; 269 | /* End PBXResourcesBuildPhase section */ 270 | 271 | /* Begin PBXSourcesBuildPhase section */ 272 | C0BB010A1DAED2290030E81A /* Sources */ = { 273 | isa = PBXSourcesBuildPhase; 274 | buildActionMask = 2147483647; 275 | files = ( 276 | C0BB01141DAED22A0030E81A /* ViewController.swift in Sources */, 277 | C0BB01121DAED22A0030E81A /* AppDelegate.swift in Sources */, 278 | C08F2D3D1DAFB82600978D08 /* UbiqArchView.swift in Sources */, 279 | ); 280 | runOnlyForDeploymentPostprocessing = 0; 281 | }; 282 | C0BB011E1DAED22A0030E81A /* Sources */ = { 283 | isa = PBXSourcesBuildPhase; 284 | buildActionMask = 2147483647; 285 | files = ( 286 | C0BB01271DAED22A0030E81A /* UbiqArchViewTests.swift in Sources */, 287 | ); 288 | runOnlyForDeploymentPostprocessing = 0; 289 | }; 290 | C0BB01291DAED22A0030E81A /* Sources */ = { 291 | isa = PBXSourcesBuildPhase; 292 | buildActionMask = 2147483647; 293 | files = ( 294 | C0BB01321DAED22A0030E81A /* UbiqArchViewUITests.swift in Sources */, 295 | ); 296 | runOnlyForDeploymentPostprocessing = 0; 297 | }; 298 | /* End PBXSourcesBuildPhase section */ 299 | 300 | /* Begin PBXTargetDependency section */ 301 | C0BB01241DAED22A0030E81A /* PBXTargetDependency */ = { 302 | isa = PBXTargetDependency; 303 | target = C0BB010D1DAED2290030E81A /* UbiqArchView */; 304 | targetProxy = C0BB01231DAED22A0030E81A /* PBXContainerItemProxy */; 305 | }; 306 | C0BB012F1DAED22A0030E81A /* PBXTargetDependency */ = { 307 | isa = PBXTargetDependency; 308 | target = C0BB010D1DAED2290030E81A /* UbiqArchView */; 309 | targetProxy = C0BB012E1DAED22A0030E81A /* PBXContainerItemProxy */; 310 | }; 311 | /* End PBXTargetDependency section */ 312 | 313 | /* Begin PBXVariantGroup section */ 314 | C0BB01151DAED22A0030E81A /* Main.storyboard */ = { 315 | isa = PBXVariantGroup; 316 | children = ( 317 | C0BB01161DAED22A0030E81A /* Base */, 318 | ); 319 | name = Main.storyboard; 320 | sourceTree = ""; 321 | }; 322 | C0BB011A1DAED22A0030E81A /* LaunchScreen.storyboard */ = { 323 | isa = PBXVariantGroup; 324 | children = ( 325 | C0BB011B1DAED22A0030E81A /* Base */, 326 | ); 327 | name = LaunchScreen.storyboard; 328 | sourceTree = ""; 329 | }; 330 | /* End PBXVariantGroup section */ 331 | 332 | /* Begin XCBuildConfiguration section */ 333 | C0BB01341DAED22A0030E81A /* Debug */ = { 334 | isa = XCBuildConfiguration; 335 | buildSettings = { 336 | ALWAYS_SEARCH_USER_PATHS = NO; 337 | CLANG_ANALYZER_NONNULL = YES; 338 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 339 | CLANG_CXX_LIBRARY = "libc++"; 340 | CLANG_ENABLE_MODULES = YES; 341 | CLANG_ENABLE_OBJC_ARC = YES; 342 | CLANG_WARN_BOOL_CONVERSION = YES; 343 | CLANG_WARN_CONSTANT_CONVERSION = YES; 344 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 345 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 346 | CLANG_WARN_EMPTY_BODY = YES; 347 | CLANG_WARN_ENUM_CONVERSION = YES; 348 | CLANG_WARN_INFINITE_RECURSION = YES; 349 | CLANG_WARN_INT_CONVERSION = YES; 350 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 351 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 352 | CLANG_WARN_UNREACHABLE_CODE = YES; 353 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 354 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 355 | COPY_PHASE_STRIP = NO; 356 | DEBUG_INFORMATION_FORMAT = dwarf; 357 | ENABLE_STRICT_OBJC_MSGSEND = YES; 358 | ENABLE_TESTABILITY = YES; 359 | GCC_C_LANGUAGE_STANDARD = gnu99; 360 | GCC_DYNAMIC_NO_PIC = NO; 361 | GCC_NO_COMMON_BLOCKS = YES; 362 | GCC_OPTIMIZATION_LEVEL = 0; 363 | GCC_PREPROCESSOR_DEFINITIONS = ( 364 | "DEBUG=1", 365 | "$(inherited)", 366 | ); 367 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 368 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 369 | GCC_WARN_UNDECLARED_SELECTOR = YES; 370 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 371 | GCC_WARN_UNUSED_FUNCTION = YES; 372 | GCC_WARN_UNUSED_VARIABLE = YES; 373 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 374 | MTL_ENABLE_DEBUG_INFO = YES; 375 | ONLY_ACTIVE_ARCH = YES; 376 | SDKROOT = iphoneos; 377 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 378 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 379 | }; 380 | name = Debug; 381 | }; 382 | C0BB01351DAED22A0030E81A /* Release */ = { 383 | isa = XCBuildConfiguration; 384 | buildSettings = { 385 | ALWAYS_SEARCH_USER_PATHS = NO; 386 | CLANG_ANALYZER_NONNULL = YES; 387 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 388 | CLANG_CXX_LIBRARY = "libc++"; 389 | CLANG_ENABLE_MODULES = YES; 390 | CLANG_ENABLE_OBJC_ARC = YES; 391 | CLANG_WARN_BOOL_CONVERSION = YES; 392 | CLANG_WARN_CONSTANT_CONVERSION = YES; 393 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 394 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 395 | CLANG_WARN_EMPTY_BODY = YES; 396 | CLANG_WARN_ENUM_CONVERSION = YES; 397 | CLANG_WARN_INFINITE_RECURSION = YES; 398 | CLANG_WARN_INT_CONVERSION = YES; 399 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 400 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 401 | CLANG_WARN_UNREACHABLE_CODE = YES; 402 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 403 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 404 | COPY_PHASE_STRIP = NO; 405 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 406 | ENABLE_NS_ASSERTIONS = NO; 407 | ENABLE_STRICT_OBJC_MSGSEND = YES; 408 | GCC_C_LANGUAGE_STANDARD = gnu99; 409 | GCC_NO_COMMON_BLOCKS = YES; 410 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 411 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 412 | GCC_WARN_UNDECLARED_SELECTOR = YES; 413 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 414 | GCC_WARN_UNUSED_FUNCTION = YES; 415 | GCC_WARN_UNUSED_VARIABLE = YES; 416 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 417 | MTL_ENABLE_DEBUG_INFO = NO; 418 | SDKROOT = iphoneos; 419 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 420 | VALIDATE_PRODUCT = YES; 421 | }; 422 | name = Release; 423 | }; 424 | C0BB01371DAED22A0030E81A /* Debug */ = { 425 | isa = XCBuildConfiguration; 426 | buildSettings = { 427 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 428 | DEVELOPMENT_TEAM = J7MY3N22B3; 429 | INFOPLIST_FILE = UbiqArchView/Info.plist; 430 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 431 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 432 | PRODUCT_BUNDLE_IDENTIFIER = com.aabrahamyan.UbiqArchView; 433 | PRODUCT_NAME = "$(TARGET_NAME)"; 434 | SWIFT_VERSION = 3.0; 435 | }; 436 | name = Debug; 437 | }; 438 | C0BB01381DAED22A0030E81A /* Release */ = { 439 | isa = XCBuildConfiguration; 440 | buildSettings = { 441 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 442 | DEVELOPMENT_TEAM = J7MY3N22B3; 443 | INFOPLIST_FILE = UbiqArchView/Info.plist; 444 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 445 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 446 | PRODUCT_BUNDLE_IDENTIFIER = com.aabrahamyan.UbiqArchView; 447 | PRODUCT_NAME = "$(TARGET_NAME)"; 448 | SWIFT_VERSION = 3.0; 449 | }; 450 | name = Release; 451 | }; 452 | C0BB013A1DAED22A0030E81A /* Debug */ = { 453 | isa = XCBuildConfiguration; 454 | buildSettings = { 455 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 456 | BUNDLE_LOADER = "$(TEST_HOST)"; 457 | DEVELOPMENT_TEAM = J7MY3N22B3; 458 | INFOPLIST_FILE = UbiqArchViewTests/Info.plist; 459 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 460 | PRODUCT_BUNDLE_IDENTIFIER = com.aabrahamyan.UbiqArchViewTests; 461 | PRODUCT_NAME = "$(TARGET_NAME)"; 462 | SWIFT_VERSION = 3.0; 463 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/UbiqArchView.app/UbiqArchView"; 464 | }; 465 | name = Debug; 466 | }; 467 | C0BB013B1DAED22A0030E81A /* Release */ = { 468 | isa = XCBuildConfiguration; 469 | buildSettings = { 470 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 471 | BUNDLE_LOADER = "$(TEST_HOST)"; 472 | DEVELOPMENT_TEAM = J7MY3N22B3; 473 | INFOPLIST_FILE = UbiqArchViewTests/Info.plist; 474 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 475 | PRODUCT_BUNDLE_IDENTIFIER = com.aabrahamyan.UbiqArchViewTests; 476 | PRODUCT_NAME = "$(TARGET_NAME)"; 477 | SWIFT_VERSION = 3.0; 478 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/UbiqArchView.app/UbiqArchView"; 479 | }; 480 | name = Release; 481 | }; 482 | C0BB013D1DAED22A0030E81A /* Debug */ = { 483 | isa = XCBuildConfiguration; 484 | buildSettings = { 485 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 486 | DEVELOPMENT_TEAM = J7MY3N22B3; 487 | INFOPLIST_FILE = UbiqArchViewUITests/Info.plist; 488 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 489 | PRODUCT_BUNDLE_IDENTIFIER = com.aabrahamyan.UbiqArchViewUITests; 490 | PRODUCT_NAME = "$(TARGET_NAME)"; 491 | SWIFT_VERSION = 3.0; 492 | TEST_TARGET_NAME = UbiqArchView; 493 | }; 494 | name = Debug; 495 | }; 496 | C0BB013E1DAED22A0030E81A /* Release */ = { 497 | isa = XCBuildConfiguration; 498 | buildSettings = { 499 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 500 | DEVELOPMENT_TEAM = J7MY3N22B3; 501 | INFOPLIST_FILE = UbiqArchViewUITests/Info.plist; 502 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 503 | PRODUCT_BUNDLE_IDENTIFIER = com.aabrahamyan.UbiqArchViewUITests; 504 | PRODUCT_NAME = "$(TARGET_NAME)"; 505 | SWIFT_VERSION = 3.0; 506 | TEST_TARGET_NAME = UbiqArchView; 507 | }; 508 | name = Release; 509 | }; 510 | /* End XCBuildConfiguration section */ 511 | 512 | /* Begin XCConfigurationList section */ 513 | C0BB01091DAED2290030E81A /* Build configuration list for PBXProject "UbiqArchView" */ = { 514 | isa = XCConfigurationList; 515 | buildConfigurations = ( 516 | C0BB01341DAED22A0030E81A /* Debug */, 517 | C0BB01351DAED22A0030E81A /* Release */, 518 | ); 519 | defaultConfigurationIsVisible = 0; 520 | defaultConfigurationName = Release; 521 | }; 522 | C0BB01361DAED22A0030E81A /* Build configuration list for PBXNativeTarget "UbiqArchView" */ = { 523 | isa = XCConfigurationList; 524 | buildConfigurations = ( 525 | C0BB01371DAED22A0030E81A /* Debug */, 526 | C0BB01381DAED22A0030E81A /* Release */, 527 | ); 528 | defaultConfigurationIsVisible = 0; 529 | defaultConfigurationName = Release; 530 | }; 531 | C0BB01391DAED22A0030E81A /* Build configuration list for PBXNativeTarget "UbiqArchViewTests" */ = { 532 | isa = XCConfigurationList; 533 | buildConfigurations = ( 534 | C0BB013A1DAED22A0030E81A /* Debug */, 535 | C0BB013B1DAED22A0030E81A /* Release */, 536 | ); 537 | defaultConfigurationIsVisible = 0; 538 | defaultConfigurationName = Release; 539 | }; 540 | C0BB013C1DAED22A0030E81A /* Build configuration list for PBXNativeTarget "UbiqArchViewUITests" */ = { 541 | isa = XCConfigurationList; 542 | buildConfigurations = ( 543 | C0BB013D1DAED22A0030E81A /* Debug */, 544 | C0BB013E1DAED22A0030E81A /* Release */, 545 | ); 546 | defaultConfigurationIsVisible = 0; 547 | defaultConfigurationName = Release; 548 | }; 549 | /* End XCConfigurationList section */ 550 | }; 551 | rootObject = C0BB01061DAED2290030E81A /* Project object */; 552 | } 553 | -------------------------------------------------------------------------------- /UbiqArchView/UbiqArchView.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /UbiqArchView/UbiqArchView/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // UbiqArchView 4 | // 5 | // Created by Armen on 10/12/16. 6 | // Copyright © 2016 Piqe Studio. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 24 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 33 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /UbiqArchView/UbiqArchView/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /UbiqArchView/UbiqArchView/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /UbiqArchView/UbiqArchView/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /UbiqArchView/UbiqArchView/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /UbiqArchView/UbiqArchView/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // UbiqArchView 4 | // 5 | // Created by Armen on 10/12/16. 6 | // Copyright © 2016 Piqe Studio. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController { 12 | 13 | // UbiqArchView added as nib in storyboard 14 | @IBOutlet weak var ubiqArchView: UbiqArchView! 15 | 16 | var timer: Timer? 17 | var startTimeInterval: TimeInterval = 0.0 18 | var inProgress: Bool = false 19 | override func viewDidLoad() { 20 | super.viewDidLoad() 21 | 22 | //Add symbol size 23 | ubiqArchView.symbolSize = 20 24 | // Width of inner static circle and broken animatable arch circle 25 | ubiqArchView.archlineWidth = 3 26 | // Progress circle line width 27 | ubiqArchView.progressLineWidth = 6 28 | // Set vertical distance from top and bottom of circle for pause symbols 29 | ubiqArchView.pauseSymbolTopMultiplicationFactor = 8 30 | // Set horizontal distance between pause symbols 31 | ubiqArchView.pauseSymbolsDistance = 5 32 | 33 | // Sets Pending state 34 | ubiqArchView.setStatePending() 35 | 36 | timer = Timer.scheduledTimer(withTimeInterval: 0.01, repeats: true, block: { (timer) in 37 | 38 | if !self.inProgress { 39 | if self.isTimeUp(timeInterval: self.startTimeInterval, compareeInterval: 1.5) { 40 | self.ubiqArchView.setStateInProgress() 41 | } else { 42 | self.startTimeInterval += timer.timeInterval 43 | } 44 | } else { 45 | if self.ubiqArchView.progress < 1 { 46 | self.ubiqArchView.progress += timer.timeInterval 47 | } else { 48 | self.ubiqArchView.progress = 1.0 49 | self.inProgress = false 50 | self.startTimeInterval = 0.0 51 | self.ubiqArchView.setStatePending() 52 | self.ubiqArchView.progress = 0.0 53 | } 54 | } 55 | }) 56 | 57 | // You can add action on control 58 | ubiqArchView.addTarget(self, action: #selector(invalidateRecursiveTimer), for: .touchUpInside) 59 | } 60 | 61 | func invalidateRecursiveTimer() { 62 | self.timer?.invalidate() 63 | 64 | // This way you can change control to the invisible state, only if 'ubiqArchView' is in 'In Progress State' 65 | self.ubiqArchView.setStateNormal() 66 | } 67 | 68 | // MARK: Helpers 69 | private final func isTimeUp (timeInterval: TimeInterval, compareeInterval: TimeInterval) -> Bool { 70 | 71 | // after some time 72 | if timeInterval > compareeInterval { 73 | inProgress = true 74 | return true 75 | } 76 | 77 | return false 78 | } 79 | 80 | override func didReceiveMemoryWarning() { 81 | super.didReceiveMemoryWarning() 82 | // Dispose of any resources that can be recreated. 83 | } 84 | 85 | 86 | } 87 | 88 | -------------------------------------------------------------------------------- /UbiqArchView/UbiqArchView/source/UbiqArchView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UbiqArchView.swift 3 | // Depositphotos 4 | // 5 | // Created by Armen on 10/6/16. 6 | // Copyright © 2016 Depositphotos Inc. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | 12 | @objc enum UbiqState : Int { 13 | case normal 14 | case inProgress 15 | case inProgressPaused 16 | case pending 17 | } 18 | 19 | @objc class UbiqArchView: UIControl { 20 | 21 | @objc var ubiqState: UbiqState = .normal 22 | 23 | @objc var brokenCircle: CAShapeLayer? 24 | @objc var progressCircle: CAShapeLayer? 25 | @objc var staticCircle: CAShapeLayer? 26 | @objc var symbolLayer: CAShapeLayer? 27 | 28 | @objc var pauseLeftSymbol: CAShapeLayer? 29 | @objc var pauseRightSymbol: CAShapeLayer? 30 | 31 | 32 | // In Class Constants defined as struct 33 | struct InternalConstants { 34 | struct BrokenArchViewConstants { 35 | static let rotationAnimationKey = "brokenArchRotationKey" 36 | } 37 | } 38 | 39 | // Nonautolayout constructor 40 | override init(frame: CGRect) { 41 | self.progress = 0 42 | super.init(frame: frame) 43 | backgroundColor = UIColor.clear 44 | 45 | setupArch() 46 | } 47 | 48 | // From nib loaded constructor 49 | required init?(coder aDecoder: NSCoder) { 50 | self.progress = 0 51 | super.init(coder: aDecoder) 52 | 53 | setupArch() 54 | } 55 | 56 | /** 57 | * Draws all layers and sets up initial arch view state 58 | */ 59 | private final func setupArch() { 60 | 61 | // Broken Arch 62 | createBrokenLayer() 63 | drawPartialArch() 64 | 65 | // Symbol 66 | createStopSymbol() 67 | drawSymbol() 68 | 69 | // Payse Symbols 70 | createPauseSymbol() 71 | drawPauseSymbol() 72 | 73 | // Progress 74 | createProgressLayer() 75 | drawStaticCircle() 76 | 77 | // Set Default Color 78 | tintColor = UIColor(red: 24 / 256, green: 181 / 256, blue: 239 / 256, alpha: 1) 79 | 80 | setStateNormal() 81 | 82 | } 83 | 84 | 85 | @objc var archlineWidth: CGFloat = 2 { 86 | didSet { 87 | brokenCircle?.lineWidth = archlineWidth 88 | staticCircle?.lineWidth = archlineWidth 89 | } 90 | } 91 | @objc var progressLineWidth: CGFloat = 4 { 92 | didSet { 93 | progressCircle?.lineWidth = progressLineWidth 94 | } 95 | } 96 | @objc var symbolSize: CGFloat = 10 { 97 | didSet { 98 | symbolLayer?.path = nil 99 | drawSymbol() 100 | } 101 | } 102 | 103 | @objc var pauseSymbolThickness: CGFloat = 4 { 104 | didSet { 105 | pauseRightSymbol?.path = nil 106 | pauseLeftSymbol?.path = nil 107 | drawPauseSymbol() 108 | } 109 | } 110 | 111 | @objc var pauseSymbolTopMultiplicationFactor: CGFloat = 4 { 112 | didSet { 113 | pauseRightSymbol?.path = nil 114 | pauseLeftSymbol?.path = nil 115 | drawPauseSymbol() 116 | } 117 | } 118 | 119 | @objc var pauseSymbolsDistance: CGFloat = 0 { 120 | didSet { 121 | pauseRightSymbol?.path = nil 122 | pauseLeftSymbol?.path = nil 123 | drawPauseSymbol() 124 | } 125 | } 126 | 127 | @objc var progress: Double { 128 | didSet { 129 | self.setNeedsDisplay() 130 | } 131 | } 132 | @objc var rotationDuration: CFTimeInterval = 1.0 133 | /** 134 | * Overwritten tintColor, affects also circle layers stroke and fill colors 135 | */ 136 | override var tintColor: UIColor! { 137 | 138 | didSet { 139 | brokenCircle?.strokeColor = tintColor.cgColor 140 | brokenCircle?.fillColor = UIColor.clear.cgColor 141 | 142 | symbolLayer?.strokeColor = tintColor.cgColor 143 | symbolLayer?.fillColor = tintColor.cgColor 144 | 145 | staticCircle?.strokeColor = tintColor.cgColor 146 | staticCircle?.fillColor = UIColor.clear.cgColor 147 | 148 | progressCircle?.strokeColor = tintColor.cgColor 149 | progressCircle?.fillColor = UIColor.clear.cgColor 150 | 151 | progressCircle?.strokeColor = tintColor.cgColor 152 | progressCircle?.fillColor = UIColor.clear.cgColor 153 | 154 | pauseLeftSymbol?.strokeColor = UIColor.clear.cgColor 155 | pauseLeftSymbol?.fillColor = tintColor.cgColor 156 | pauseRightSymbol?.strokeColor = UIColor.clear.cgColor 157 | pauseRightSymbol?.fillColor = tintColor.cgColor 158 | 159 | } 160 | } 161 | 162 | 163 | // MARK: Set State 164 | /** 165 | * Sets UbiqArchView state normal 166 | */ 167 | @objc final func setStateNormal() { 168 | // Normal state 169 | isUserInteractionEnabled = false 170 | removePartialArchAnimation() 171 | brokenCircle?.isHidden = true 172 | progressCircle?.isHidden = true 173 | staticCircle?.isHidden = true 174 | symbolLayer?.isHidden = true 175 | pauseRightSymbol?.isHidden = true 176 | pauseLeftSymbol?.isHidden = true 177 | 178 | ubiqState = .normal 179 | } 180 | 181 | /** 182 | * Sets UbiqArchView state pending (broken circle animation is rotating) 183 | */ 184 | @objc final func setStatePending() { 185 | // Begin Spinning 186 | isUserInteractionEnabled = true 187 | animatePartialArch() 188 | brokenCircle?.isHidden = false 189 | progressCircle?.isHidden = true 190 | staticCircle?.isHidden = true 191 | symbolLayer?.isHidden = true 192 | pauseRightSymbol?.isHidden = true 193 | pauseLeftSymbol?.isHidden = true 194 | 195 | ubiqState = .pending 196 | } 197 | 198 | /** 199 | * Sets UbiqArchView state In Progress (redraws layer every time multiplied by a new 'Progress' value) 200 | */ 201 | @objc final func setStateInProgress() { 202 | // State In Progress 203 | removePartialArchAnimation() 204 | isUserInteractionEnabled = true 205 | brokenCircle?.isHidden = true 206 | progressCircle?.isHidden = false 207 | staticCircle?.isHidden = false 208 | symbolLayer?.isHidden = false 209 | pauseRightSymbol?.isHidden = true 210 | pauseLeftSymbol?.isHidden = true 211 | 212 | ubiqState = .inProgress 213 | } 214 | 215 | @objc 216 | final func setStateInProgressWithPaused() { 217 | // State In Progress 218 | removePartialArchAnimation() 219 | isUserInteractionEnabled = true 220 | brokenCircle?.isHidden = true 221 | progressCircle?.isHidden = false 222 | staticCircle?.isHidden = false 223 | symbolLayer?.isHidden = true 224 | pauseRightSymbol?.isHidden = false 225 | pauseLeftSymbol?.isHidden = false 226 | 227 | ubiqState = .inProgressPaused 228 | } 229 | 230 | // MARK: Layers creation 231 | /** 232 | * Creates broken layer for 'Pending' view representation 233 | */ 234 | private final func createBrokenLayer() { 235 | 236 | brokenCircle = CAShapeLayer() 237 | brokenCircle?.contentsScale = UIScreen.main.scale 238 | brokenCircle?.lineCap = kCALineCapRound; 239 | brokenCircle?.lineWidth = archlineWidth 240 | brokenCircle?.frame = bounds 241 | layer.addSublayer(brokenCircle!) 242 | } 243 | 244 | /** 245 | * Creates layer for 'Progress' view representation 246 | */ 247 | private final func createProgressLayer() { 248 | 249 | staticCircle = CAShapeLayer() 250 | staticCircle?.contentsScale = UIScreen.main.scale 251 | staticCircle?.lineCap = kCALineCapRound; 252 | staticCircle?.lineWidth = archlineWidth 253 | staticCircle?.frame = bounds 254 | layer.addSublayer(staticCircle!) 255 | 256 | progressCircle = CAShapeLayer() 257 | progressCircle?.contentsScale = UIScreen.main.scale 258 | progressCircle?.lineCap = kCALineCapSquare 259 | progressCircle?.lineWidth = progressLineWidth 260 | progressCircle?.frame = bounds 261 | layer.addSublayer(progressCircle!) 262 | } 263 | 264 | /** 265 | * Creates 'Stop' symbol in arch view 266 | */ 267 | private final func createStopSymbol() { 268 | symbolLayer = CAShapeLayer() 269 | symbolLayer?.contentsScale = UIScreen.main.scale 270 | layer.addSublayer(symbolLayer!) 271 | } 272 | 273 | /** 274 | * Creates 'Pause' symbols in arch view 275 | */ 276 | private final func createPauseSymbol() { 277 | pauseLeftSymbol = CAShapeLayer() 278 | pauseLeftSymbol?.contentsScale = UIScreen.main.scale 279 | layer.addSublayer(pauseLeftSymbol!) 280 | 281 | pauseRightSymbol = CAShapeLayer() 282 | pauseRightSymbol?.contentsScale = UIScreen.main.scale 283 | layer.addSublayer(pauseRightSymbol!) 284 | } 285 | 286 | // MARK: Core graphics Related 287 | /** 288 | * Draws broken arch for 'Pending' view representation 289 | */ 290 | private final func drawPartialArch() { 291 | let startAngle = CGFloat(M_PI_2) + 0.5 292 | let endAngle = CGFloat(1.5 * M_PI) + startAngle + 0.5 293 | let center = CGPoint(x: bounds.size.width / 2, y: bounds.size.height / 2) 294 | let radius = (bounds.size.width - archlineWidth) / 2 295 | 296 | let bezier = UIBezierPath() 297 | bezier.lineWidth = archlineWidth 298 | bezier.lineCapStyle = .round 299 | 300 | bezier.addArc(withCenter: center, radius: radius, startAngle: startAngle, endAngle: endAngle, clockwise: true) 301 | 302 | brokenCircle!.path = bezier.cgPath 303 | } 304 | 305 | /** 306 | * Draws static circle 307 | */ 308 | private final func drawStaticCircle() { 309 | // Circle View 310 | let startStaticAngle = CGFloat(M_PI_2) 311 | let endStaticAngle = CGFloat(2 * M_PI) + startStaticAngle 312 | let centerStatic = CGPoint(x: bounds.size.width / 2, y: bounds.size.height / 2) 313 | let radiusStatic = (bounds.size.width - archlineWidth) / 2 314 | 315 | let bezierStatic = UIBezierPath() 316 | bezierStatic.lineWidth = archlineWidth 317 | bezierStatic.lineCapStyle = .round 318 | 319 | bezierStatic.addArc(withCenter: centerStatic, radius: radiusStatic, startAngle: startStaticAngle, endAngle: endStaticAngle, clockwise: true) 320 | 321 | staticCircle!.path = bezierStatic.cgPath 322 | } 323 | 324 | /** 325 | * Draws 'Stop' symbol view 326 | */ 327 | private final func drawSymbol() { 328 | let rect = bounds.insetBy(dx: (bounds.width - symbolSize)/2, dy: (bounds.height - symbolSize) / 2) 329 | let bezier = UIBezierPath(rect: rect) 330 | symbolLayer?.path = bezier.cgPath 331 | symbolLayer?.lineWidth = 0 332 | } 333 | 334 | /** 335 | * Draws 'Pause' symbols view 336 | */ 337 | private final func drawPauseSymbol() { 338 | 339 | let topPosition = pauseSymbolTopMultiplicationFactor / 2 340 | 341 | let leftRect = CGRect(x: bounds.midX - 2*pauseSymbolThickness - pauseSymbolsDistance, y: topPosition*pauseSymbolThickness, width: pauseSymbolThickness, height: bounds.height - pauseSymbolTopMultiplicationFactor*pauseSymbolThickness) 342 | let leftBezier = UIBezierPath(rect: leftRect) 343 | pauseLeftSymbol?.path = leftBezier.cgPath 344 | pauseLeftSymbol?.lineWidth = 0 345 | 346 | let rightRect = CGRect(x: bounds.midX + pauseSymbolThickness + pauseSymbolsDistance, y: topPosition*pauseSymbolThickness, width: pauseSymbolThickness, height: bounds.height - pauseSymbolTopMultiplicationFactor*pauseSymbolThickness) 347 | let rightBezier = UIBezierPath(rect: rightRect) 348 | pauseRightSymbol?.path = rightBezier.cgPath 349 | pauseRightSymbol?.lineWidth = 0 350 | } 351 | 352 | /** 353 | * Animates broken arch for 'Pending' state 354 | */ 355 | private final func animatePartialArch() { 356 | 357 | guard brokenCircle?.animation(forKey: InternalConstants.BrokenArchViewConstants.rotationAnimationKey) == nil else { return } 358 | 359 | let rotation = CABasicAnimation(keyPath: "transform.rotation") 360 | let fromRotation = brokenCircle!.value(forKeyPath: "transform.rotation") 361 | rotation.fromValue = fromRotation as! Float 362 | rotation.toValue = ((fromRotation as! Float) + Float(2 * M_PI)) 363 | rotation.duration = rotationDuration 364 | rotation.repeatCount = HUGE 365 | rotation.isRemovedOnCompletion = false 366 | brokenCircle?.add(rotation, forKey: InternalConstants.BrokenArchViewConstants.rotationAnimationKey) 367 | 368 | } 369 | 370 | /** 371 | * Removes arch animation 372 | */ 373 | private final func removePartialArchAnimation() { 374 | brokenCircle?.removeAnimation(forKey: InternalConstants.BrokenArchViewConstants.rotationAnimationKey) 375 | } 376 | 377 | // MARK: Redraws on bounds changes 378 | override func layoutSubviews() { 379 | super.layoutSubviews() 380 | 381 | brokenCircle?.frame = bounds 382 | staticCircle?.frame = bounds 383 | progressCircle?.frame = bounds 384 | 385 | reDrawStaticCircle() 386 | reDrawSymbol() 387 | reDrawPauseSymbol() 388 | reDrawPartialArch() 389 | 390 | progressCircle?.path = nil 391 | self.setNeedsDisplay() 392 | } 393 | 394 | /** 395 | * Redraws broken arch 396 | */ 397 | private final func reDrawPartialArch() { 398 | brokenCircle?.path = nil 399 | drawPartialArch() 400 | } 401 | 402 | /** 403 | * Redraws inner static circle 404 | */ 405 | private final func reDrawStaticCircle() { 406 | staticCircle?.path = nil 407 | drawStaticCircle() 408 | } 409 | 410 | /** 411 | * Redraws 'Stop' symbol 412 | */ 413 | private final func reDrawSymbol() { 414 | symbolLayer?.path = nil 415 | drawSymbol() 416 | } 417 | 418 | /** 419 | * Redraws 'Pause' symbols 420 | */ 421 | private final func reDrawPauseSymbol() { 422 | pauseLeftSymbol?.path = nil 423 | pauseRightSymbol?.path = nil 424 | drawPauseSymbol() 425 | } 426 | 427 | 428 | // Drawin circle progress here 429 | override func draw(_ rect: CGRect) { 430 | super.draw(rect) 431 | // Progress Arch 432 | let startAngle = -CGFloat(M_PI_2) 433 | let endAngle = CGFloat(progress * 2 * M_PI) + startAngle 434 | let center = CGPoint(x: bounds.size.width / 2, y: bounds.size.height / 2) 435 | let radius = (bounds.size.width - (progressLineWidth + archlineWidth)) / 2 436 | 437 | let bezier = UIBezierPath() 438 | bezier.lineWidth = progressLineWidth 439 | bezier.lineCapStyle = .round 440 | 441 | 442 | bezier.addArc(withCenter: center, radius: radius, startAngle: startAngle, endAngle: endAngle, clockwise: true) 443 | 444 | progressCircle!.path = bezier.cgPath 445 | } 446 | } 447 | -------------------------------------------------------------------------------- /UbiqArchView/UbiqArchViewTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /UbiqArchView/UbiqArchViewTests/UbiqArchViewTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UbiqArchViewTests.swift 3 | // UbiqArchViewTests 4 | // 5 | // Created by Armen on 10/12/16. 6 | // Copyright © 2016 Piqe Studio. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import UbiqArchView 11 | 12 | class UbiqArchViewTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | // Use XCTAssert and related functions to verify your tests produce the correct results. 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measure { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /UbiqArchView/UbiqArchViewUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /UbiqArchView/UbiqArchViewUITests/UbiqArchViewUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UbiqArchViewUITests.swift 3 | // UbiqArchViewUITests 4 | // 5 | // Created by Armen on 10/12/16. 6 | // Copyright © 2016 Piqe Studio. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class UbiqArchViewUITests: XCTestCase { 12 | 13 | override func setUp() { 14 | super.setUp() 15 | 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | 18 | // In UI tests it is usually best to stop immediately when a failure occurs. 19 | continueAfterFailure = false 20 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 21 | XCUIApplication().launch() 22 | 23 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 24 | } 25 | 26 | override func tearDown() { 27 | // Put teardown code here. This method is called after the invocation of each test method in the class. 28 | super.tearDown() 29 | } 30 | 31 | func testExample() { 32 | // Use recording to get started writing UI tests. 33 | // Use XCTAssert and related functions to verify your tests produce the correct results. 34 | } 35 | 36 | } 37 | --------------------------------------------------------------------------------