├── Classes └── MAGlowingLabel.swift ├── MAGlowingLabel.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── Marwan.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ ├── Marwan.xcuserdatad │ └── xcschemes │ │ ├── MAGlowingLabel.xcscheme │ │ └── xcschememanagement.plist │ └── atoz.xcuserdatad │ └── xcschemes │ ├── MAGlowingLabel.xcscheme │ └── xcschememanagement.plist ├── MAGlowingLabel ├── AppDelegate.swift ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist └── ViewController.swift └── README.md /Classes/MAGlowingLabel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MAGlowingLabel.swift 3 | // MAGlowingLabel 4 | // 5 | // Created by MARWAN on 12/2/16. 6 | // Copyright © 2016 MARWAN. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class MAGlowingLabel: UILabel { 12 | 13 | override init(frame: CGRect) { 14 | super.init(frame: frame) 15 | self.addGlowingEffect(); 16 | } 17 | 18 | required init?(coder aDecoder: NSCoder) { 19 | super.init(coder: aDecoder) 20 | DispatchQueue.main.async { 21 | self.addGlowingEffect() 22 | } 23 | } 24 | 25 | func addGlowingEffect() { 26 | let labelTransparency :CGFloat = 0.5 27 | let labelWidth:CGFloat = self.frame.size.width 28 | 29 | let glowSize :CGFloat = 40 / labelWidth 30 | 31 | let startingLocations :NSArray = [NSNumber.init(value: 0.0 as Float), NSNumber.init(value: ((Float)(glowSize / 2)) as Float),NSNumber.init(value: ((Float)(glowSize)/1) as Float)] 32 | 33 | let endingLocations = [(1.0 - glowSize), (1.0 - (glowSize / 2)), 1.0] as NSArray 34 | 35 | let animation :CABasicAnimation = CABasicAnimation(keyPath: "locations") 36 | let glowMask:CAGradientLayer = CAGradientLayer.init() 37 | glowMask.frame = self.bounds 38 | 39 | let gradient = UIColor.init(white: 0.5, alpha: labelTransparency) 40 | glowMask.colors = [gradient.cgColor,UIColor.white.cgColor,gradient.cgColor] 41 | glowMask.locations = startingLocations as? [NSNumber] 42 | glowMask.startPoint = CGPoint(x: 0 - (glowSize * 2), y: 1) 43 | glowMask.endPoint = CGPoint(x: 1 + glowSize , y: 1) 44 | self.layer.mask = glowMask 45 | 46 | animation.fromValue = startingLocations 47 | animation.toValue = endingLocations 48 | animation.repeatCount = Float.infinity 49 | animation.duration = 1.5 50 | animation.isRemovedOnCompletion = false 51 | glowMask.add(animation, forKey: "gradientAnimation") 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /MAGlowingLabel.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | D6DA7C5F1DF1A7270096706E /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6DA7C5E1DF1A7270096706E /* AppDelegate.swift */; }; 11 | D6DA7C611DF1A7270096706E /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6DA7C601DF1A7270096706E /* ViewController.swift */; }; 12 | D6DA7C641DF1A7270096706E /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D6DA7C621DF1A7270096706E /* Main.storyboard */; }; 13 | D6DA7C661DF1A7270096706E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D6DA7C651DF1A7270096706E /* Assets.xcassets */; }; 14 | D6DA7C691DF1A7270096706E /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D6DA7C671DF1A7270096706E /* LaunchScreen.storyboard */; }; 15 | D6DA7C721DF1A76C0096706E /* MAGlowingLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6DA7C711DF1A76C0096706E /* MAGlowingLabel.swift */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXFileReference section */ 19 | D6DA7C5B1DF1A7270096706E /* MAGlowingLabel.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MAGlowingLabel.app; sourceTree = BUILT_PRODUCTS_DIR; }; 20 | D6DA7C5E1DF1A7270096706E /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 21 | D6DA7C601DF1A7270096706E /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 22 | D6DA7C631DF1A7270096706E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 23 | D6DA7C651DF1A7270096706E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 24 | D6DA7C681DF1A7270096706E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 25 | D6DA7C6A1DF1A7270096706E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 26 | D6DA7C711DF1A76C0096706E /* MAGlowingLabel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MAGlowingLabel.swift; sourceTree = ""; }; 27 | /* End PBXFileReference section */ 28 | 29 | /* Begin PBXFrameworksBuildPhase section */ 30 | D6DA7C581DF1A7270096706E /* Frameworks */ = { 31 | isa = PBXFrameworksBuildPhase; 32 | buildActionMask = 2147483647; 33 | files = ( 34 | ); 35 | runOnlyForDeploymentPostprocessing = 0; 36 | }; 37 | /* End PBXFrameworksBuildPhase section */ 38 | 39 | /* Begin PBXGroup section */ 40 | D6DA7C521DF1A7270096706E = { 41 | isa = PBXGroup; 42 | children = ( 43 | D6DA7C701DF1A7560096706E /* Classes */, 44 | D6DA7C5D1DF1A7270096706E /* MAGlowingLabel */, 45 | D6DA7C5C1DF1A7270096706E /* Products */, 46 | ); 47 | sourceTree = ""; 48 | }; 49 | D6DA7C5C1DF1A7270096706E /* Products */ = { 50 | isa = PBXGroup; 51 | children = ( 52 | D6DA7C5B1DF1A7270096706E /* MAGlowingLabel.app */, 53 | ); 54 | name = Products; 55 | sourceTree = ""; 56 | }; 57 | D6DA7C5D1DF1A7270096706E /* MAGlowingLabel */ = { 58 | isa = PBXGroup; 59 | children = ( 60 | D6DA7C5E1DF1A7270096706E /* AppDelegate.swift */, 61 | D6DA7C601DF1A7270096706E /* ViewController.swift */, 62 | D6DA7C621DF1A7270096706E /* Main.storyboard */, 63 | D6DA7C651DF1A7270096706E /* Assets.xcassets */, 64 | D6DA7C671DF1A7270096706E /* LaunchScreen.storyboard */, 65 | D6DA7C6A1DF1A7270096706E /* Info.plist */, 66 | ); 67 | path = MAGlowingLabel; 68 | sourceTree = ""; 69 | }; 70 | D6DA7C701DF1A7560096706E /* Classes */ = { 71 | isa = PBXGroup; 72 | children = ( 73 | D6DA7C711DF1A76C0096706E /* MAGlowingLabel.swift */, 74 | ); 75 | path = Classes; 76 | sourceTree = ""; 77 | }; 78 | /* End PBXGroup section */ 79 | 80 | /* Begin PBXNativeTarget section */ 81 | D6DA7C5A1DF1A7270096706E /* MAGlowingLabel */ = { 82 | isa = PBXNativeTarget; 83 | buildConfigurationList = D6DA7C6D1DF1A7270096706E /* Build configuration list for PBXNativeTarget "MAGlowingLabel" */; 84 | buildPhases = ( 85 | D6DA7C571DF1A7270096706E /* Sources */, 86 | D6DA7C581DF1A7270096706E /* Frameworks */, 87 | D6DA7C591DF1A7270096706E /* Resources */, 88 | ); 89 | buildRules = ( 90 | ); 91 | dependencies = ( 92 | ); 93 | name = MAGlowingLabel; 94 | productName = MAGlowingLabel; 95 | productReference = D6DA7C5B1DF1A7270096706E /* MAGlowingLabel.app */; 96 | productType = "com.apple.product-type.application"; 97 | }; 98 | /* End PBXNativeTarget section */ 99 | 100 | /* Begin PBXProject section */ 101 | D6DA7C531DF1A7270096706E /* Project object */ = { 102 | isa = PBXProject; 103 | attributes = { 104 | LastSwiftUpdateCheck = 0730; 105 | LastUpgradeCheck = 0730; 106 | ORGANIZATIONNAME = MARWAN; 107 | TargetAttributes = { 108 | D6DA7C5A1DF1A7270096706E = { 109 | CreatedOnToolsVersion = 7.3; 110 | LastSwiftMigration = 0830; 111 | }; 112 | }; 113 | }; 114 | buildConfigurationList = D6DA7C561DF1A7270096706E /* Build configuration list for PBXProject "MAGlowingLabel" */; 115 | compatibilityVersion = "Xcode 3.2"; 116 | developmentRegion = English; 117 | hasScannedForEncodings = 0; 118 | knownRegions = ( 119 | English, 120 | en, 121 | Base, 122 | ); 123 | mainGroup = D6DA7C521DF1A7270096706E; 124 | productRefGroup = D6DA7C5C1DF1A7270096706E /* Products */; 125 | projectDirPath = ""; 126 | projectRoot = ""; 127 | targets = ( 128 | D6DA7C5A1DF1A7270096706E /* MAGlowingLabel */, 129 | ); 130 | }; 131 | /* End PBXProject section */ 132 | 133 | /* Begin PBXResourcesBuildPhase section */ 134 | D6DA7C591DF1A7270096706E /* Resources */ = { 135 | isa = PBXResourcesBuildPhase; 136 | buildActionMask = 2147483647; 137 | files = ( 138 | D6DA7C691DF1A7270096706E /* LaunchScreen.storyboard in Resources */, 139 | D6DA7C661DF1A7270096706E /* Assets.xcassets in Resources */, 140 | D6DA7C641DF1A7270096706E /* Main.storyboard in Resources */, 141 | ); 142 | runOnlyForDeploymentPostprocessing = 0; 143 | }; 144 | /* End PBXResourcesBuildPhase section */ 145 | 146 | /* Begin PBXSourcesBuildPhase section */ 147 | D6DA7C571DF1A7270096706E /* Sources */ = { 148 | isa = PBXSourcesBuildPhase; 149 | buildActionMask = 2147483647; 150 | files = ( 151 | D6DA7C721DF1A76C0096706E /* MAGlowingLabel.swift in Sources */, 152 | D6DA7C611DF1A7270096706E /* ViewController.swift in Sources */, 153 | D6DA7C5F1DF1A7270096706E /* AppDelegate.swift in Sources */, 154 | ); 155 | runOnlyForDeploymentPostprocessing = 0; 156 | }; 157 | /* End PBXSourcesBuildPhase section */ 158 | 159 | /* Begin PBXVariantGroup section */ 160 | D6DA7C621DF1A7270096706E /* Main.storyboard */ = { 161 | isa = PBXVariantGroup; 162 | children = ( 163 | D6DA7C631DF1A7270096706E /* Base */, 164 | ); 165 | name = Main.storyboard; 166 | sourceTree = ""; 167 | }; 168 | D6DA7C671DF1A7270096706E /* LaunchScreen.storyboard */ = { 169 | isa = PBXVariantGroup; 170 | children = ( 171 | D6DA7C681DF1A7270096706E /* Base */, 172 | ); 173 | name = LaunchScreen.storyboard; 174 | sourceTree = ""; 175 | }; 176 | /* End PBXVariantGroup section */ 177 | 178 | /* Begin XCBuildConfiguration section */ 179 | D6DA7C6B1DF1A7270096706E /* Debug */ = { 180 | isa = XCBuildConfiguration; 181 | buildSettings = { 182 | ALWAYS_SEARCH_USER_PATHS = NO; 183 | CLANG_ANALYZER_NONNULL = YES; 184 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 185 | CLANG_CXX_LIBRARY = "libc++"; 186 | CLANG_ENABLE_MODULES = YES; 187 | CLANG_ENABLE_OBJC_ARC = YES; 188 | CLANG_WARN_BOOL_CONVERSION = YES; 189 | CLANG_WARN_CONSTANT_CONVERSION = YES; 190 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 191 | CLANG_WARN_EMPTY_BODY = YES; 192 | CLANG_WARN_ENUM_CONVERSION = YES; 193 | CLANG_WARN_INT_CONVERSION = YES; 194 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 195 | CLANG_WARN_UNREACHABLE_CODE = YES; 196 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 197 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 198 | COPY_PHASE_STRIP = NO; 199 | DEBUG_INFORMATION_FORMAT = dwarf; 200 | ENABLE_STRICT_OBJC_MSGSEND = YES; 201 | ENABLE_TESTABILITY = YES; 202 | GCC_C_LANGUAGE_STANDARD = gnu99; 203 | GCC_DYNAMIC_NO_PIC = NO; 204 | GCC_NO_COMMON_BLOCKS = YES; 205 | GCC_OPTIMIZATION_LEVEL = 0; 206 | GCC_PREPROCESSOR_DEFINITIONS = ( 207 | "DEBUG=1", 208 | "$(inherited)", 209 | ); 210 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 211 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 212 | GCC_WARN_UNDECLARED_SELECTOR = YES; 213 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 214 | GCC_WARN_UNUSED_FUNCTION = YES; 215 | GCC_WARN_UNUSED_VARIABLE = YES; 216 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 217 | MTL_ENABLE_DEBUG_INFO = YES; 218 | ONLY_ACTIVE_ARCH = YES; 219 | SDKROOT = iphoneos; 220 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 221 | TARGETED_DEVICE_FAMILY = "1,2"; 222 | }; 223 | name = Debug; 224 | }; 225 | D6DA7C6C1DF1A7270096706E /* Release */ = { 226 | isa = XCBuildConfiguration; 227 | buildSettings = { 228 | ALWAYS_SEARCH_USER_PATHS = NO; 229 | CLANG_ANALYZER_NONNULL = YES; 230 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 231 | CLANG_CXX_LIBRARY = "libc++"; 232 | CLANG_ENABLE_MODULES = YES; 233 | CLANG_ENABLE_OBJC_ARC = YES; 234 | CLANG_WARN_BOOL_CONVERSION = YES; 235 | CLANG_WARN_CONSTANT_CONVERSION = YES; 236 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 237 | CLANG_WARN_EMPTY_BODY = YES; 238 | CLANG_WARN_ENUM_CONVERSION = YES; 239 | CLANG_WARN_INT_CONVERSION = YES; 240 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 241 | CLANG_WARN_UNREACHABLE_CODE = YES; 242 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 243 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 244 | COPY_PHASE_STRIP = NO; 245 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 246 | ENABLE_NS_ASSERTIONS = NO; 247 | ENABLE_STRICT_OBJC_MSGSEND = YES; 248 | GCC_C_LANGUAGE_STANDARD = gnu99; 249 | GCC_NO_COMMON_BLOCKS = YES; 250 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 251 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 252 | GCC_WARN_UNDECLARED_SELECTOR = YES; 253 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 254 | GCC_WARN_UNUSED_FUNCTION = YES; 255 | GCC_WARN_UNUSED_VARIABLE = YES; 256 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 257 | MTL_ENABLE_DEBUG_INFO = NO; 258 | SDKROOT = iphoneos; 259 | TARGETED_DEVICE_FAMILY = "1,2"; 260 | VALIDATE_PRODUCT = YES; 261 | }; 262 | name = Release; 263 | }; 264 | D6DA7C6E1DF1A7270096706E /* Debug */ = { 265 | isa = XCBuildConfiguration; 266 | buildSettings = { 267 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 268 | INFOPLIST_FILE = MAGlowingLabel/Info.plist; 269 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 270 | PRODUCT_BUNDLE_IDENTIFIER = com.marwan.MAGlowingLabel; 271 | PRODUCT_NAME = "$(TARGET_NAME)"; 272 | SWIFT_VERSION = 4.2; 273 | }; 274 | name = Debug; 275 | }; 276 | D6DA7C6F1DF1A7270096706E /* Release */ = { 277 | isa = XCBuildConfiguration; 278 | buildSettings = { 279 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 280 | INFOPLIST_FILE = MAGlowingLabel/Info.plist; 281 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 282 | PRODUCT_BUNDLE_IDENTIFIER = com.marwan.MAGlowingLabel; 283 | PRODUCT_NAME = "$(TARGET_NAME)"; 284 | SWIFT_VERSION = 4.2; 285 | }; 286 | name = Release; 287 | }; 288 | /* End XCBuildConfiguration section */ 289 | 290 | /* Begin XCConfigurationList section */ 291 | D6DA7C561DF1A7270096706E /* Build configuration list for PBXProject "MAGlowingLabel" */ = { 292 | isa = XCConfigurationList; 293 | buildConfigurations = ( 294 | D6DA7C6B1DF1A7270096706E /* Debug */, 295 | D6DA7C6C1DF1A7270096706E /* Release */, 296 | ); 297 | defaultConfigurationIsVisible = 0; 298 | defaultConfigurationName = Release; 299 | }; 300 | D6DA7C6D1DF1A7270096706E /* Build configuration list for PBXNativeTarget "MAGlowingLabel" */ = { 301 | isa = XCConfigurationList; 302 | buildConfigurations = ( 303 | D6DA7C6E1DF1A7270096706E /* Debug */, 304 | D6DA7C6F1DF1A7270096706E /* Release */, 305 | ); 306 | defaultConfigurationIsVisible = 0; 307 | defaultConfigurationName = Release; 308 | }; 309 | /* End XCConfigurationList section */ 310 | }; 311 | rootObject = D6DA7C531DF1A7270096706E /* Project object */; 312 | } 313 | -------------------------------------------------------------------------------- /MAGlowingLabel.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /MAGlowingLabel.xcodeproj/project.xcworkspace/xcuserdata/Marwan.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Marwan8/MAGlowingLabel/7a51888033c8ecbd953d3a58a789c67b529fc05c/MAGlowingLabel.xcodeproj/project.xcworkspace/xcuserdata/Marwan.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /MAGlowingLabel.xcodeproj/xcuserdata/Marwan.xcuserdatad/xcschemes/MAGlowingLabel.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /MAGlowingLabel.xcodeproj/xcuserdata/Marwan.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | MAGlowingLabel.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | D6DA7C5A1DF1A7270096706E 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /MAGlowingLabel.xcodeproj/xcuserdata/atoz.xcuserdatad/xcschemes/MAGlowingLabel.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /MAGlowingLabel.xcodeproj/xcuserdata/atoz.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | MAGlowingLabel.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | D6DA7C5A1DF1A7270096706E 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /MAGlowingLabel/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // MAGlowingLabel 4 | // 5 | // Created by MARWAN on 12/2/16. 6 | // Copyright © 2016 MARWAN. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | private func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: 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 throttle down OpenGL ES frame rates. 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 inactive 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 | -------------------------------------------------------------------------------- /MAGlowingLabel/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 | } -------------------------------------------------------------------------------- /MAGlowingLabel/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 | -------------------------------------------------------------------------------- /MAGlowingLabel/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 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /MAGlowingLabel/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 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /MAGlowingLabel/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // MAGlowingLabel 4 | // 5 | // Created by MARWAN on 12/2/16. 6 | // Copyright © 2016 MARWAN. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | // Do any additional setup after loading the view, typically from a nib. 16 | } 17 | 18 | override func didReceiveMemoryWarning() { 19 | super.didReceiveMemoryWarning() 20 | // Dispose of any resources that can be recreated. 21 | } 22 | 23 | 24 | } 25 | 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MAGlowingLabel 2 | A UILabel with an animated glowing effect Written in Swift 3 | 4 | 5 | 6 | 7 | 8 | 9 | ![alt tag](http://imgur.com/JRmC1VG.gif) 10 | --------------------------------------------------------------------------------