├── InstagramActivityIndicator.swift ├── InstagramActivityIndicator.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcuserdata │ └── jmmanos.xcuserdatad │ └── xcschemes │ ├── InstagramActivityIndicator.xcscheme │ └── xcschememanagement.plist ├── InstagramActivityIndicator ├── AppDelegate.swift ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist └── ViewController.swift ├── InstagramActivityIndicatorTests ├── Info.plist └── InstagramActivityIndicatorTests.swift ├── InstagramActivityIndicatorUITests ├── Info.plist └── InstagramActivityIndicatorUITests.swift ├── LICENSE ├── README.md ├── indicatorDemo.gif └── othersDemo.gif /InstagramActivityIndicator.swift: -------------------------------------------------------------------------------- 1 | // 2 | // InstagramActivityIndicator.swift 3 | // InstagramActivityIndicator 4 | // 5 | // Created by John Manos on 2/3/17. 6 | // Copyright © 2017 John Manos. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import QuartzCore 11 | 12 | @IBDesignable 13 | public final class InstagramActivityIndicator: UIView { 14 | /// Specifies the segment animation duration. 15 | public var animationDuration: Double = 1 16 | 17 | /// Specifies the indicator rotation animatino duration. 18 | public var rotationDuration: Double = 10 19 | 20 | /// Specifies the number of segments in the indicator. 21 | @IBInspectable 22 | public var numSegments: Int = 12 { 23 | didSet { 24 | updateSegments() 25 | } 26 | } 27 | 28 | /// Specifies the stroke color of the indicator segments. 29 | @IBInspectable 30 | public var strokeColor : UIColor = .blue { 31 | didSet { 32 | segmentLayer?.strokeColor = strokeColor.cgColor 33 | } 34 | } 35 | 36 | /// Specifies the line width of the indicator segments. 37 | @IBInspectable 38 | public var lineWidth : CGFloat = 8 { 39 | didSet { 40 | segmentLayer?.lineWidth = lineWidth 41 | updateSegments() 42 | } 43 | } 44 | 45 | /// A Boolean value that controls whether the receiver is hidden when the animation is stopped. 46 | public var hidesWhenStopped: Bool = true 47 | 48 | /// A Boolean value that returns whether the indicator is animating or not. 49 | public private(set) var isAnimating = false 50 | 51 | /// the layer replicating the segments. 52 | private weak var replicatorLayer: CAReplicatorLayer! 53 | 54 | /// the visual layer that gets replicated around the indicator. 55 | private weak var segmentLayer: CAShapeLayer! 56 | 57 | public override init(frame: CGRect) { 58 | super.init(frame: frame) 59 | setup() 60 | } 61 | 62 | public required init?(coder aDecoder: NSCoder) { 63 | super.init(coder: aDecoder) 64 | setup() 65 | } 66 | 67 | private func setup() { 68 | // create and add the replicator layer 69 | let replicatorLayer = CAReplicatorLayer() 70 | 71 | layer.addSublayer(replicatorLayer) 72 | 73 | // configure the shape layer that gets replicated 74 | let dot = CAShapeLayer() 75 | dot.lineCap = kCALineCapRound 76 | dot.strokeColor = strokeColor.cgColor 77 | dot.lineWidth = lineWidth 78 | dot.fillColor = nil 79 | 80 | replicatorLayer.addSublayer(dot) 81 | 82 | // set the weak variables after being added to the layer 83 | self.replicatorLayer = replicatorLayer 84 | self.segmentLayer = dot 85 | } 86 | 87 | override public func layoutSubviews() { 88 | super.layoutSubviews() 89 | 90 | // resize the replicator layer. 91 | let maxSize = max(0,min(bounds.width, bounds.height)) 92 | replicatorLayer.bounds = CGRect(x: 0, y: 0, width: maxSize, height: maxSize) 93 | replicatorLayer.position = CGPoint(x: bounds.width/2, y:bounds.height/2) 94 | 95 | updateSegments() 96 | } 97 | 98 | /// Updates the visuals of the indicator, specifically the segment characteristics. 99 | private func updateSegments() { 100 | guard numSegments > 0, let segmentLayer = segmentLayer else { return } 101 | 102 | let angle = 2*CGFloat.pi / CGFloat(numSegments) 103 | replicatorLayer.instanceCount = numSegments 104 | replicatorLayer.instanceTransform = CATransform3DMakeRotation(angle, 0.0, 0.0, 1.0) 105 | replicatorLayer.instanceDelay = 1.5*animationDuration/Double(numSegments) 106 | 107 | let maxRadius = max(0,min(replicatorLayer.bounds.width, replicatorLayer.bounds.height))/2 108 | let radius: CGFloat = maxRadius - lineWidth/2 109 | 110 | segmentLayer.bounds = CGRect(x:0, y:0, width: 2*maxRadius, height: 2*maxRadius) 111 | segmentLayer.position = CGPoint(x: replicatorLayer.bounds.width/2, y: replicatorLayer.bounds.height/2) 112 | 113 | // set the path of the replicated segment layer. 114 | let path = UIBezierPath(arcCenter: CGPoint(x: maxRadius, y: maxRadius), radius: radius, startAngle: -angle/2 - CGFloat.pi/2, endAngle: angle/2 - CGFloat.pi/2, clockwise: true) 115 | 116 | segmentLayer.path = path.cgPath 117 | } 118 | 119 | /// Starts the animation of the indicator. 120 | public func startAnimating() { 121 | self.isHidden = false 122 | isAnimating = true 123 | 124 | let rotate = CABasicAnimation(keyPath: "transform.rotation") 125 | rotate.byValue = CGFloat.pi*2 126 | rotate.duration = rotationDuration 127 | rotate.repeatCount = Float.infinity 128 | 129 | // add animations to segment 130 | // multiplying duration changes the time of empty or hidden segments 131 | let shrinkStart = CABasicAnimation(keyPath: "strokeStart") 132 | shrinkStart.fromValue = 0.0 133 | shrinkStart.toValue = 0.5 134 | shrinkStart.duration = animationDuration // * 1.5 135 | shrinkStart.autoreverses = true 136 | shrinkStart.repeatCount = Float.infinity 137 | shrinkStart.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut) 138 | 139 | let shrinkEnd = CABasicAnimation(keyPath: "strokeEnd") 140 | shrinkEnd.fromValue = 1.0 141 | shrinkEnd.toValue = 0.5 142 | shrinkEnd.duration = animationDuration // * 1.5 143 | shrinkEnd.autoreverses = true 144 | shrinkEnd.repeatCount = Float.infinity 145 | shrinkEnd.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut) 146 | 147 | let fade = CABasicAnimation(keyPath: "lineWidth") 148 | fade.fromValue = lineWidth 149 | fade.toValue = 0.0 150 | fade.duration = animationDuration // * 1.5 151 | fade.autoreverses = true 152 | fade.repeatCount = Float.infinity 153 | fade.timingFunction = CAMediaTimingFunction(controlPoints: 0.55, 0.0, 0.45, 1.0) 154 | 155 | replicatorLayer.add(rotate, forKey: "rotate") 156 | segmentLayer.add(shrinkStart, forKey: "start") 157 | segmentLayer.add(shrinkEnd, forKey: "end") 158 | segmentLayer.add(fade, forKey: "fade") 159 | } 160 | 161 | /// Stops the animation of the indicator. 162 | public func stopAnimating() { 163 | isAnimating = false 164 | 165 | replicatorLayer.removeAnimation(forKey: "rotate") 166 | segmentLayer.removeAnimation(forKey: "start") 167 | segmentLayer.removeAnimation(forKey: "end") 168 | segmentLayer.removeAnimation(forKey: "fade") 169 | 170 | if hidesWhenStopped { 171 | self.isHidden = true 172 | } 173 | } 174 | 175 | public override var intrinsicContentSize: CGSize { 176 | return CGSize(width: 180, height: 180) 177 | } 178 | } 179 | -------------------------------------------------------------------------------- /InstagramActivityIndicator.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | F01788DC1E4520960062F3D9 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F01788DB1E4520960062F3D9 /* AppDelegate.swift */; }; 11 | F01788DE1E4520960062F3D9 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F01788DD1E4520960062F3D9 /* ViewController.swift */; }; 12 | F01788E11E4520960062F3D9 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F01788DF1E4520960062F3D9 /* Main.storyboard */; }; 13 | F01788E31E4520960062F3D9 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F01788E21E4520960062F3D9 /* Assets.xcassets */; }; 14 | F01788E61E4520960062F3D9 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F01788E41E4520960062F3D9 /* LaunchScreen.storyboard */; }; 15 | F01788F11E4520960062F3D9 /* InstagramActivityIndicatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F01788F01E4520960062F3D9 /* InstagramActivityIndicatorTests.swift */; }; 16 | F01788FC1E4520960062F3D9 /* InstagramActivityIndicatorUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F01788FB1E4520960062F3D9 /* InstagramActivityIndicatorUITests.swift */; }; 17 | F017890A1E4525530062F3D9 /* InstagramActivityIndicator.swift in Sources */ = {isa = PBXBuildFile; fileRef = F01789091E4525530062F3D9 /* InstagramActivityIndicator.swift */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXContainerItemProxy section */ 21 | F01788ED1E4520960062F3D9 /* PBXContainerItemProxy */ = { 22 | isa = PBXContainerItemProxy; 23 | containerPortal = F01788D01E4520960062F3D9 /* Project object */; 24 | proxyType = 1; 25 | remoteGlobalIDString = F01788D71E4520960062F3D9; 26 | remoteInfo = InstagramActivityIndicator; 27 | }; 28 | F01788F81E4520960062F3D9 /* PBXContainerItemProxy */ = { 29 | isa = PBXContainerItemProxy; 30 | containerPortal = F01788D01E4520960062F3D9 /* Project object */; 31 | proxyType = 1; 32 | remoteGlobalIDString = F01788D71E4520960062F3D9; 33 | remoteInfo = InstagramActivityIndicator; 34 | }; 35 | /* End PBXContainerItemProxy section */ 36 | 37 | /* Begin PBXFileReference section */ 38 | F01788D81E4520960062F3D9 /* InstagramActivityIndicator.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = InstagramActivityIndicator.app; sourceTree = BUILT_PRODUCTS_DIR; }; 39 | F01788DB1E4520960062F3D9 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 40 | F01788DD1E4520960062F3D9 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 41 | F01788E01E4520960062F3D9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 42 | F01788E21E4520960062F3D9 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 43 | F01788E51E4520960062F3D9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 44 | F01788E71E4520960062F3D9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 45 | F01788EC1E4520960062F3D9 /* InstagramActivityIndicatorTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = InstagramActivityIndicatorTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 46 | F01788F01E4520960062F3D9 /* InstagramActivityIndicatorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InstagramActivityIndicatorTests.swift; sourceTree = ""; }; 47 | F01788F21E4520960062F3D9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 48 | F01788F71E4520960062F3D9 /* InstagramActivityIndicatorUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = InstagramActivityIndicatorUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 49 | F01788FB1E4520960062F3D9 /* InstagramActivityIndicatorUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InstagramActivityIndicatorUITests.swift; sourceTree = ""; }; 50 | F01788FD1E4520960062F3D9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 51 | F01789091E4525530062F3D9 /* InstagramActivityIndicator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InstagramActivityIndicator.swift; sourceTree = SOURCE_ROOT; }; 52 | /* End PBXFileReference section */ 53 | 54 | /* Begin PBXFrameworksBuildPhase section */ 55 | F01788D51E4520960062F3D9 /* Frameworks */ = { 56 | isa = PBXFrameworksBuildPhase; 57 | buildActionMask = 2147483647; 58 | files = ( 59 | ); 60 | runOnlyForDeploymentPostprocessing = 0; 61 | }; 62 | F01788E91E4520960062F3D9 /* Frameworks */ = { 63 | isa = PBXFrameworksBuildPhase; 64 | buildActionMask = 2147483647; 65 | files = ( 66 | ); 67 | runOnlyForDeploymentPostprocessing = 0; 68 | }; 69 | F01788F41E4520960062F3D9 /* Frameworks */ = { 70 | isa = PBXFrameworksBuildPhase; 71 | buildActionMask = 2147483647; 72 | files = ( 73 | ); 74 | runOnlyForDeploymentPostprocessing = 0; 75 | }; 76 | /* End PBXFrameworksBuildPhase section */ 77 | 78 | /* Begin PBXGroup section */ 79 | F01788CF1E4520960062F3D9 = { 80 | isa = PBXGroup; 81 | children = ( 82 | F01788DA1E4520960062F3D9 /* InstagramActivityIndicator */, 83 | F01788EF1E4520960062F3D9 /* InstagramActivityIndicatorTests */, 84 | F01788FA1E4520960062F3D9 /* InstagramActivityIndicatorUITests */, 85 | F01788D91E4520960062F3D9 /* Products */, 86 | ); 87 | sourceTree = ""; 88 | }; 89 | F01788D91E4520960062F3D9 /* Products */ = { 90 | isa = PBXGroup; 91 | children = ( 92 | F01788D81E4520960062F3D9 /* InstagramActivityIndicator.app */, 93 | F01788EC1E4520960062F3D9 /* InstagramActivityIndicatorTests.xctest */, 94 | F01788F71E4520960062F3D9 /* InstagramActivityIndicatorUITests.xctest */, 95 | ); 96 | name = Products; 97 | sourceTree = ""; 98 | }; 99 | F01788DA1E4520960062F3D9 /* InstagramActivityIndicator */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | F01788DB1E4520960062F3D9 /* AppDelegate.swift */, 103 | F01788DD1E4520960062F3D9 /* ViewController.swift */, 104 | F01789091E4525530062F3D9 /* InstagramActivityIndicator.swift */, 105 | F01788DF1E4520960062F3D9 /* Main.storyboard */, 106 | F01788E21E4520960062F3D9 /* Assets.xcassets */, 107 | F01788E41E4520960062F3D9 /* LaunchScreen.storyboard */, 108 | F01788E71E4520960062F3D9 /* Info.plist */, 109 | ); 110 | path = InstagramActivityIndicator; 111 | sourceTree = ""; 112 | }; 113 | F01788EF1E4520960062F3D9 /* InstagramActivityIndicatorTests */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | F01788F01E4520960062F3D9 /* InstagramActivityIndicatorTests.swift */, 117 | F01788F21E4520960062F3D9 /* Info.plist */, 118 | ); 119 | path = InstagramActivityIndicatorTests; 120 | sourceTree = ""; 121 | }; 122 | F01788FA1E4520960062F3D9 /* InstagramActivityIndicatorUITests */ = { 123 | isa = PBXGroup; 124 | children = ( 125 | F01788FB1E4520960062F3D9 /* InstagramActivityIndicatorUITests.swift */, 126 | F01788FD1E4520960062F3D9 /* Info.plist */, 127 | ); 128 | path = InstagramActivityIndicatorUITests; 129 | sourceTree = ""; 130 | }; 131 | /* End PBXGroup section */ 132 | 133 | /* Begin PBXNativeTarget section */ 134 | F01788D71E4520960062F3D9 /* InstagramActivityIndicator */ = { 135 | isa = PBXNativeTarget; 136 | buildConfigurationList = F01789001E4520960062F3D9 /* Build configuration list for PBXNativeTarget "InstagramActivityIndicator" */; 137 | buildPhases = ( 138 | F01788D41E4520960062F3D9 /* Sources */, 139 | F01788D51E4520960062F3D9 /* Frameworks */, 140 | F01788D61E4520960062F3D9 /* Resources */, 141 | ); 142 | buildRules = ( 143 | ); 144 | dependencies = ( 145 | ); 146 | name = InstagramActivityIndicator; 147 | productName = InstagramActivityIndicator; 148 | productReference = F01788D81E4520960062F3D9 /* InstagramActivityIndicator.app */; 149 | productType = "com.apple.product-type.application"; 150 | }; 151 | F01788EB1E4520960062F3D9 /* InstagramActivityIndicatorTests */ = { 152 | isa = PBXNativeTarget; 153 | buildConfigurationList = F01789031E4520960062F3D9 /* Build configuration list for PBXNativeTarget "InstagramActivityIndicatorTests" */; 154 | buildPhases = ( 155 | F01788E81E4520960062F3D9 /* Sources */, 156 | F01788E91E4520960062F3D9 /* Frameworks */, 157 | F01788EA1E4520960062F3D9 /* Resources */, 158 | ); 159 | buildRules = ( 160 | ); 161 | dependencies = ( 162 | F01788EE1E4520960062F3D9 /* PBXTargetDependency */, 163 | ); 164 | name = InstagramActivityIndicatorTests; 165 | productName = InstagramActivityIndicatorTests; 166 | productReference = F01788EC1E4520960062F3D9 /* InstagramActivityIndicatorTests.xctest */; 167 | productType = "com.apple.product-type.bundle.unit-test"; 168 | }; 169 | F01788F61E4520960062F3D9 /* InstagramActivityIndicatorUITests */ = { 170 | isa = PBXNativeTarget; 171 | buildConfigurationList = F01789061E4520960062F3D9 /* Build configuration list for PBXNativeTarget "InstagramActivityIndicatorUITests" */; 172 | buildPhases = ( 173 | F01788F31E4520960062F3D9 /* Sources */, 174 | F01788F41E4520960062F3D9 /* Frameworks */, 175 | F01788F51E4520960062F3D9 /* Resources */, 176 | ); 177 | buildRules = ( 178 | ); 179 | dependencies = ( 180 | F01788F91E4520960062F3D9 /* PBXTargetDependency */, 181 | ); 182 | name = InstagramActivityIndicatorUITests; 183 | productName = InstagramActivityIndicatorUITests; 184 | productReference = F01788F71E4520960062F3D9 /* InstagramActivityIndicatorUITests.xctest */; 185 | productType = "com.apple.product-type.bundle.ui-testing"; 186 | }; 187 | /* End PBXNativeTarget section */ 188 | 189 | /* Begin PBXProject section */ 190 | F01788D01E4520960062F3D9 /* Project object */ = { 191 | isa = PBXProject; 192 | attributes = { 193 | LastSwiftUpdateCheck = 0830; 194 | LastUpgradeCheck = 0830; 195 | ORGANIZATIONNAME = "John Manos"; 196 | TargetAttributes = { 197 | F01788D71E4520960062F3D9 = { 198 | CreatedOnToolsVersion = 8.3; 199 | DevelopmentTeam = 54PH726UK4; 200 | ProvisioningStyle = Automatic; 201 | }; 202 | F01788EB1E4520960062F3D9 = { 203 | CreatedOnToolsVersion = 8.3; 204 | DevelopmentTeam = 54PH726UK4; 205 | ProvisioningStyle = Automatic; 206 | TestTargetID = F01788D71E4520960062F3D9; 207 | }; 208 | F01788F61E4520960062F3D9 = { 209 | CreatedOnToolsVersion = 8.3; 210 | DevelopmentTeam = 54PH726UK4; 211 | ProvisioningStyle = Automatic; 212 | TestTargetID = F01788D71E4520960062F3D9; 213 | }; 214 | }; 215 | }; 216 | buildConfigurationList = F01788D31E4520960062F3D9 /* Build configuration list for PBXProject "InstagramActivityIndicator" */; 217 | compatibilityVersion = "Xcode 3.2"; 218 | developmentRegion = English; 219 | hasScannedForEncodings = 0; 220 | knownRegions = ( 221 | en, 222 | Base, 223 | ); 224 | mainGroup = F01788CF1E4520960062F3D9; 225 | productRefGroup = F01788D91E4520960062F3D9 /* Products */; 226 | projectDirPath = ""; 227 | projectRoot = ""; 228 | targets = ( 229 | F01788D71E4520960062F3D9 /* InstagramActivityIndicator */, 230 | F01788EB1E4520960062F3D9 /* InstagramActivityIndicatorTests */, 231 | F01788F61E4520960062F3D9 /* InstagramActivityIndicatorUITests */, 232 | ); 233 | }; 234 | /* End PBXProject section */ 235 | 236 | /* Begin PBXResourcesBuildPhase section */ 237 | F01788D61E4520960062F3D9 /* Resources */ = { 238 | isa = PBXResourcesBuildPhase; 239 | buildActionMask = 2147483647; 240 | files = ( 241 | F01788E61E4520960062F3D9 /* LaunchScreen.storyboard in Resources */, 242 | F01788E31E4520960062F3D9 /* Assets.xcassets in Resources */, 243 | F01788E11E4520960062F3D9 /* Main.storyboard in Resources */, 244 | ); 245 | runOnlyForDeploymentPostprocessing = 0; 246 | }; 247 | F01788EA1E4520960062F3D9 /* Resources */ = { 248 | isa = PBXResourcesBuildPhase; 249 | buildActionMask = 2147483647; 250 | files = ( 251 | ); 252 | runOnlyForDeploymentPostprocessing = 0; 253 | }; 254 | F01788F51E4520960062F3D9 /* Resources */ = { 255 | isa = PBXResourcesBuildPhase; 256 | buildActionMask = 2147483647; 257 | files = ( 258 | ); 259 | runOnlyForDeploymentPostprocessing = 0; 260 | }; 261 | /* End PBXResourcesBuildPhase section */ 262 | 263 | /* Begin PBXSourcesBuildPhase section */ 264 | F01788D41E4520960062F3D9 /* Sources */ = { 265 | isa = PBXSourcesBuildPhase; 266 | buildActionMask = 2147483647; 267 | files = ( 268 | F017890A1E4525530062F3D9 /* InstagramActivityIndicator.swift in Sources */, 269 | F01788DE1E4520960062F3D9 /* ViewController.swift in Sources */, 270 | F01788DC1E4520960062F3D9 /* AppDelegate.swift in Sources */, 271 | ); 272 | runOnlyForDeploymentPostprocessing = 0; 273 | }; 274 | F01788E81E4520960062F3D9 /* Sources */ = { 275 | isa = PBXSourcesBuildPhase; 276 | buildActionMask = 2147483647; 277 | files = ( 278 | F01788F11E4520960062F3D9 /* InstagramActivityIndicatorTests.swift in Sources */, 279 | ); 280 | runOnlyForDeploymentPostprocessing = 0; 281 | }; 282 | F01788F31E4520960062F3D9 /* Sources */ = { 283 | isa = PBXSourcesBuildPhase; 284 | buildActionMask = 2147483647; 285 | files = ( 286 | F01788FC1E4520960062F3D9 /* InstagramActivityIndicatorUITests.swift in Sources */, 287 | ); 288 | runOnlyForDeploymentPostprocessing = 0; 289 | }; 290 | /* End PBXSourcesBuildPhase section */ 291 | 292 | /* Begin PBXTargetDependency section */ 293 | F01788EE1E4520960062F3D9 /* PBXTargetDependency */ = { 294 | isa = PBXTargetDependency; 295 | target = F01788D71E4520960062F3D9 /* InstagramActivityIndicator */; 296 | targetProxy = F01788ED1E4520960062F3D9 /* PBXContainerItemProxy */; 297 | }; 298 | F01788F91E4520960062F3D9 /* PBXTargetDependency */ = { 299 | isa = PBXTargetDependency; 300 | target = F01788D71E4520960062F3D9 /* InstagramActivityIndicator */; 301 | targetProxy = F01788F81E4520960062F3D9 /* PBXContainerItemProxy */; 302 | }; 303 | /* End PBXTargetDependency section */ 304 | 305 | /* Begin PBXVariantGroup section */ 306 | F01788DF1E4520960062F3D9 /* Main.storyboard */ = { 307 | isa = PBXVariantGroup; 308 | children = ( 309 | F01788E01E4520960062F3D9 /* Base */, 310 | ); 311 | name = Main.storyboard; 312 | sourceTree = ""; 313 | }; 314 | F01788E41E4520960062F3D9 /* LaunchScreen.storyboard */ = { 315 | isa = PBXVariantGroup; 316 | children = ( 317 | F01788E51E4520960062F3D9 /* Base */, 318 | ); 319 | name = LaunchScreen.storyboard; 320 | sourceTree = ""; 321 | }; 322 | /* End PBXVariantGroup section */ 323 | 324 | /* Begin XCBuildConfiguration section */ 325 | F01788FE1E4520960062F3D9 /* Debug */ = { 326 | isa = XCBuildConfiguration; 327 | buildSettings = { 328 | ALWAYS_SEARCH_USER_PATHS = NO; 329 | CLANG_ANALYZER_NONNULL = YES; 330 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 331 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 332 | CLANG_CXX_LIBRARY = "libc++"; 333 | CLANG_ENABLE_MODULES = YES; 334 | CLANG_ENABLE_OBJC_ARC = YES; 335 | CLANG_WARN_BOOL_CONVERSION = YES; 336 | CLANG_WARN_CONSTANT_CONVERSION = YES; 337 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 338 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 339 | CLANG_WARN_EMPTY_BODY = YES; 340 | CLANG_WARN_ENUM_CONVERSION = YES; 341 | CLANG_WARN_INFINITE_RECURSION = YES; 342 | CLANG_WARN_INT_CONVERSION = YES; 343 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 344 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 345 | CLANG_WARN_UNREACHABLE_CODE = YES; 346 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 347 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 348 | COPY_PHASE_STRIP = NO; 349 | DEBUG_INFORMATION_FORMAT = dwarf; 350 | ENABLE_STRICT_OBJC_MSGSEND = YES; 351 | ENABLE_TESTABILITY = YES; 352 | GCC_C_LANGUAGE_STANDARD = gnu99; 353 | GCC_DYNAMIC_NO_PIC = NO; 354 | GCC_NO_COMMON_BLOCKS = YES; 355 | GCC_OPTIMIZATION_LEVEL = 0; 356 | GCC_PREPROCESSOR_DEFINITIONS = ( 357 | "DEBUG=1", 358 | "$(inherited)", 359 | ); 360 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 361 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 362 | GCC_WARN_UNDECLARED_SELECTOR = YES; 363 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 364 | GCC_WARN_UNUSED_FUNCTION = YES; 365 | GCC_WARN_UNUSED_VARIABLE = YES; 366 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 367 | MTL_ENABLE_DEBUG_INFO = YES; 368 | ONLY_ACTIVE_ARCH = YES; 369 | SDKROOT = iphoneos; 370 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 371 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 372 | TARGETED_DEVICE_FAMILY = "1,2"; 373 | }; 374 | name = Debug; 375 | }; 376 | F01788FF1E4520960062F3D9 /* Release */ = { 377 | isa = XCBuildConfiguration; 378 | buildSettings = { 379 | ALWAYS_SEARCH_USER_PATHS = NO; 380 | CLANG_ANALYZER_NONNULL = YES; 381 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 382 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 383 | CLANG_CXX_LIBRARY = "libc++"; 384 | CLANG_ENABLE_MODULES = YES; 385 | CLANG_ENABLE_OBJC_ARC = YES; 386 | CLANG_WARN_BOOL_CONVERSION = YES; 387 | CLANG_WARN_CONSTANT_CONVERSION = YES; 388 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 389 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 390 | CLANG_WARN_EMPTY_BODY = YES; 391 | CLANG_WARN_ENUM_CONVERSION = YES; 392 | CLANG_WARN_INFINITE_RECURSION = YES; 393 | CLANG_WARN_INT_CONVERSION = YES; 394 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 395 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 396 | CLANG_WARN_UNREACHABLE_CODE = YES; 397 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 398 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 399 | COPY_PHASE_STRIP = NO; 400 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 401 | ENABLE_NS_ASSERTIONS = NO; 402 | ENABLE_STRICT_OBJC_MSGSEND = YES; 403 | GCC_C_LANGUAGE_STANDARD = gnu99; 404 | GCC_NO_COMMON_BLOCKS = YES; 405 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 406 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 407 | GCC_WARN_UNDECLARED_SELECTOR = YES; 408 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 409 | GCC_WARN_UNUSED_FUNCTION = YES; 410 | GCC_WARN_UNUSED_VARIABLE = YES; 411 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 412 | MTL_ENABLE_DEBUG_INFO = NO; 413 | SDKROOT = iphoneos; 414 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 415 | TARGETED_DEVICE_FAMILY = "1,2"; 416 | VALIDATE_PRODUCT = YES; 417 | }; 418 | name = Release; 419 | }; 420 | F01789011E4520960062F3D9 /* Debug */ = { 421 | isa = XCBuildConfiguration; 422 | buildSettings = { 423 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 424 | DEVELOPMENT_TEAM = 54PH726UK4; 425 | INFOPLIST_FILE = InstagramActivityIndicator/Info.plist; 426 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 427 | PRODUCT_BUNDLE_IDENTIFIER = jmmanos.InstagramActivityIndicator; 428 | PRODUCT_NAME = "$(TARGET_NAME)"; 429 | SWIFT_VERSION = 3.0; 430 | }; 431 | name = Debug; 432 | }; 433 | F01789021E4520960062F3D9 /* Release */ = { 434 | isa = XCBuildConfiguration; 435 | buildSettings = { 436 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 437 | DEVELOPMENT_TEAM = 54PH726UK4; 438 | INFOPLIST_FILE = InstagramActivityIndicator/Info.plist; 439 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 440 | PRODUCT_BUNDLE_IDENTIFIER = jmmanos.InstagramActivityIndicator; 441 | PRODUCT_NAME = "$(TARGET_NAME)"; 442 | SWIFT_VERSION = 3.0; 443 | }; 444 | name = Release; 445 | }; 446 | F01789041E4520960062F3D9 /* Debug */ = { 447 | isa = XCBuildConfiguration; 448 | buildSettings = { 449 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 450 | BUNDLE_LOADER = "$(TEST_HOST)"; 451 | DEVELOPMENT_TEAM = 54PH726UK4; 452 | INFOPLIST_FILE = InstagramActivityIndicatorTests/Info.plist; 453 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 454 | PRODUCT_BUNDLE_IDENTIFIER = jmmanos.InstagramActivityIndicatorTests; 455 | PRODUCT_NAME = "$(TARGET_NAME)"; 456 | SWIFT_VERSION = 3.0; 457 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/InstagramActivityIndicator.app/InstagramActivityIndicator"; 458 | }; 459 | name = Debug; 460 | }; 461 | F01789051E4520960062F3D9 /* Release */ = { 462 | isa = XCBuildConfiguration; 463 | buildSettings = { 464 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 465 | BUNDLE_LOADER = "$(TEST_HOST)"; 466 | DEVELOPMENT_TEAM = 54PH726UK4; 467 | INFOPLIST_FILE = InstagramActivityIndicatorTests/Info.plist; 468 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 469 | PRODUCT_BUNDLE_IDENTIFIER = jmmanos.InstagramActivityIndicatorTests; 470 | PRODUCT_NAME = "$(TARGET_NAME)"; 471 | SWIFT_VERSION = 3.0; 472 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/InstagramActivityIndicator.app/InstagramActivityIndicator"; 473 | }; 474 | name = Release; 475 | }; 476 | F01789071E4520960062F3D9 /* Debug */ = { 477 | isa = XCBuildConfiguration; 478 | buildSettings = { 479 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 480 | DEVELOPMENT_TEAM = 54PH726UK4; 481 | INFOPLIST_FILE = InstagramActivityIndicatorUITests/Info.plist; 482 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 483 | PRODUCT_BUNDLE_IDENTIFIER = jmmanos.InstagramActivityIndicatorUITests; 484 | PRODUCT_NAME = "$(TARGET_NAME)"; 485 | SWIFT_VERSION = 3.0; 486 | TEST_TARGET_NAME = InstagramActivityIndicator; 487 | }; 488 | name = Debug; 489 | }; 490 | F01789081E4520960062F3D9 /* Release */ = { 491 | isa = XCBuildConfiguration; 492 | buildSettings = { 493 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 494 | DEVELOPMENT_TEAM = 54PH726UK4; 495 | INFOPLIST_FILE = InstagramActivityIndicatorUITests/Info.plist; 496 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 497 | PRODUCT_BUNDLE_IDENTIFIER = jmmanos.InstagramActivityIndicatorUITests; 498 | PRODUCT_NAME = "$(TARGET_NAME)"; 499 | SWIFT_VERSION = 3.0; 500 | TEST_TARGET_NAME = InstagramActivityIndicator; 501 | }; 502 | name = Release; 503 | }; 504 | /* End XCBuildConfiguration section */ 505 | 506 | /* Begin XCConfigurationList section */ 507 | F01788D31E4520960062F3D9 /* Build configuration list for PBXProject "InstagramActivityIndicator" */ = { 508 | isa = XCConfigurationList; 509 | buildConfigurations = ( 510 | F01788FE1E4520960062F3D9 /* Debug */, 511 | F01788FF1E4520960062F3D9 /* Release */, 512 | ); 513 | defaultConfigurationIsVisible = 0; 514 | defaultConfigurationName = Release; 515 | }; 516 | F01789001E4520960062F3D9 /* Build configuration list for PBXNativeTarget "InstagramActivityIndicator" */ = { 517 | isa = XCConfigurationList; 518 | buildConfigurations = ( 519 | F01789011E4520960062F3D9 /* Debug */, 520 | F01789021E4520960062F3D9 /* Release */, 521 | ); 522 | defaultConfigurationIsVisible = 0; 523 | }; 524 | F01789031E4520960062F3D9 /* Build configuration list for PBXNativeTarget "InstagramActivityIndicatorTests" */ = { 525 | isa = XCConfigurationList; 526 | buildConfigurations = ( 527 | F01789041E4520960062F3D9 /* Debug */, 528 | F01789051E4520960062F3D9 /* Release */, 529 | ); 530 | defaultConfigurationIsVisible = 0; 531 | }; 532 | F01789061E4520960062F3D9 /* Build configuration list for PBXNativeTarget "InstagramActivityIndicatorUITests" */ = { 533 | isa = XCConfigurationList; 534 | buildConfigurations = ( 535 | F01789071E4520960062F3D9 /* Debug */, 536 | F01789081E4520960062F3D9 /* Release */, 537 | ); 538 | defaultConfigurationIsVisible = 0; 539 | }; 540 | /* End XCConfigurationList section */ 541 | }; 542 | rootObject = F01788D01E4520960062F3D9 /* Project object */; 543 | } 544 | -------------------------------------------------------------------------------- /InstagramActivityIndicator.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /InstagramActivityIndicator.xcodeproj/xcuserdata/jmmanos.xcuserdatad/xcschemes/InstagramActivityIndicator.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /InstagramActivityIndicator.xcodeproj/xcuserdata/jmmanos.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | InstagramActivityIndicator.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | F01788D71E4520960062F3D9 16 | 17 | primary 18 | 19 | 20 | F01788EB1E4520960062F3D9 21 | 22 | primary 23 | 24 | 25 | F01788F61E4520960062F3D9 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /InstagramActivityIndicator/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // InstagramActivityIndicator 4 | // 5 | // Created by John Manos on 2/3/17. 6 | // Copyright © 2017 John Manos. 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 | -------------------------------------------------------------------------------- /InstagramActivityIndicator/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 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /InstagramActivityIndicator/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 | -------------------------------------------------------------------------------- /InstagramActivityIndicator/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 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | -------------------------------------------------------------------------------- /InstagramActivityIndicator/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 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /InstagramActivityIndicator/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // InstagramActivityIndicator 4 | // 5 | // Created by John Manos on 2/3/17. 6 | // Copyright © 2017 John Manos. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController { 12 | @IBAction func handleTap(_ recognizer: UITapGestureRecognizer) { 13 | guard let indicator = recognizer.view as? InstagramActivityIndicator else { return } 14 | 15 | if indicator.isAnimating { 16 | indicator.stopAnimating() 17 | } else { 18 | indicator.startAnimating() 19 | } 20 | } 21 | } 22 | 23 | -------------------------------------------------------------------------------- /InstagramActivityIndicatorTests/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 | -------------------------------------------------------------------------------- /InstagramActivityIndicatorTests/InstagramActivityIndicatorTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // InstagramActivityIndicatorTests.swift 3 | // InstagramActivityIndicatorTests 4 | // 5 | // Created by John Manos on 2/3/17. 6 | // Copyright © 2017 John Manos. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import InstagramActivityIndicator 11 | 12 | class InstagramActivityIndicatorTests: 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 | -------------------------------------------------------------------------------- /InstagramActivityIndicatorUITests/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 | -------------------------------------------------------------------------------- /InstagramActivityIndicatorUITests/InstagramActivityIndicatorUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // InstagramActivityIndicatorUITests.swift 3 | // InstagramActivityIndicatorUITests 4 | // 5 | // Created by John Manos on 2/3/17. 6 | // Copyright © 2017 John Manos. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class InstagramActivityIndicatorUITests: 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 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 John Manos 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 | # InstagramActivityIndicator 2 | Activity Indicator similar to Instagram's. 3 | 4 | ## Demo 5 | ![alt tag](https://raw.githubusercontent.com/jmmanos/InstagramActivityIndicator/master/indicatorDemo.gif) 6 | 7 | ## Features 8 | 9 | * Swift 3 10 | * IBDesignable 11 | * Very Customizable 12 | ```swift 13 | indicator.animationDuration = 5 14 | indicator.rotationDuration = 20 15 | indicator.numSegments = 24 16 | indicator.strokeColor = UIColor.purple 17 | indicator.lineWidth = 6 18 | ``` 19 | ![alt tag](https://raw.githubusercontent.com/jmmanos/InstagramActivityIndicator/master/othersDemo.gif) 20 | 21 | ## Usage 22 | Simply add InstagramActivityIndicator.swift to sources. 23 | -------------------------------------------------------------------------------- /indicatorDemo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmmanos/InstagramActivityIndicator/0eb1fe4ec6525d3381055ecb24bdd3fa18928b1c/indicatorDemo.gif -------------------------------------------------------------------------------- /othersDemo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmmanos/InstagramActivityIndicator/0eb1fe4ec6525d3381055ecb24bdd3fa18928b1c/othersDemo.gif --------------------------------------------------------------------------------