├── AnimateTabbarBadgeView.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── ali.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── ali.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── AnimateTabbarBadgeView.xcscheme │ └── xcschememanagement.plist ├── AnimateTabbarBadgeView ├── AppDelegate.swift ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── first.imageset │ │ ├── Contents.json │ │ └── first.pdf │ └── second.imageset │ │ ├── Contents.json │ │ └── second.pdf ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Extension+UITabBarController.swift ├── FirstViewController.swift ├── Info.plist ├── SecondViewController.swift └── ThirdViewController.swift ├── README.md └── screenShot.gif /AnimateTabbarBadgeView.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 41F7A79C1F28F1B90075AC0B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41F7A79B1F28F1B90075AC0B /* AppDelegate.swift */; }; 11 | 41F7A79E1F28F1B90075AC0B /* FirstViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41F7A79D1F28F1B90075AC0B /* FirstViewController.swift */; }; 12 | 41F7A7A01F28F1B90075AC0B /* SecondViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41F7A79F1F28F1B90075AC0B /* SecondViewController.swift */; }; 13 | 41F7A7A31F28F1B90075AC0B /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 41F7A7A11F28F1B90075AC0B /* Main.storyboard */; }; 14 | 41F7A7A51F28F1B90075AC0B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 41F7A7A41F28F1B90075AC0B /* Assets.xcassets */; }; 15 | 41F7A7A81F28F1B90075AC0B /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 41F7A7A61F28F1B90075AC0B /* LaunchScreen.storyboard */; }; 16 | 41F7A7B01F28F1F60075AC0B /* Extension+UITabBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41F7A7AF1F28F1F60075AC0B /* Extension+UITabBarController.swift */; }; 17 | 41F7A7B21F28FCEE0075AC0B /* ThirdViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41F7A7B11F28FCEE0075AC0B /* ThirdViewController.swift */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXFileReference section */ 21 | 41F7A7981F28F1B90075AC0B /* AnimateTabbarBadgeView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AnimateTabbarBadgeView.app; sourceTree = BUILT_PRODUCTS_DIR; }; 22 | 41F7A79B1F28F1B90075AC0B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 23 | 41F7A79D1F28F1B90075AC0B /* FirstViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FirstViewController.swift; sourceTree = ""; }; 24 | 41F7A79F1F28F1B90075AC0B /* SecondViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecondViewController.swift; sourceTree = ""; }; 25 | 41F7A7A21F28F1B90075AC0B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 26 | 41F7A7A41F28F1B90075AC0B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 27 | 41F7A7A71F28F1B90075AC0B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 28 | 41F7A7A91F28F1B90075AC0B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 29 | 41F7A7AF1F28F1F60075AC0B /* Extension+UITabBarController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Extension+UITabBarController.swift"; sourceTree = ""; }; 30 | 41F7A7B11F28FCEE0075AC0B /* ThirdViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ThirdViewController.swift; sourceTree = ""; }; 31 | /* End PBXFileReference section */ 32 | 33 | /* Begin PBXFrameworksBuildPhase section */ 34 | 41F7A7951F28F1B90075AC0B /* Frameworks */ = { 35 | isa = PBXFrameworksBuildPhase; 36 | buildActionMask = 2147483647; 37 | files = ( 38 | ); 39 | runOnlyForDeploymentPostprocessing = 0; 40 | }; 41 | /* End PBXFrameworksBuildPhase section */ 42 | 43 | /* Begin PBXGroup section */ 44 | 41F7A78F1F28F1B90075AC0B = { 45 | isa = PBXGroup; 46 | children = ( 47 | 41F7A79A1F28F1B90075AC0B /* AnimateTabbarBadgeView */, 48 | 41F7A7991F28F1B90075AC0B /* Products */, 49 | ); 50 | sourceTree = ""; 51 | }; 52 | 41F7A7991F28F1B90075AC0B /* Products */ = { 53 | isa = PBXGroup; 54 | children = ( 55 | 41F7A7981F28F1B90075AC0B /* AnimateTabbarBadgeView.app */, 56 | ); 57 | name = Products; 58 | sourceTree = ""; 59 | }; 60 | 41F7A79A1F28F1B90075AC0B /* AnimateTabbarBadgeView */ = { 61 | isa = PBXGroup; 62 | children = ( 63 | 41F7A7AF1F28F1F60075AC0B /* Extension+UITabBarController.swift */, 64 | 41F7A79B1F28F1B90075AC0B /* AppDelegate.swift */, 65 | 41F7A79D1F28F1B90075AC0B /* FirstViewController.swift */, 66 | 41F7A79F1F28F1B90075AC0B /* SecondViewController.swift */, 67 | 41F7A7B11F28FCEE0075AC0B /* ThirdViewController.swift */, 68 | 41F7A7A11F28F1B90075AC0B /* Main.storyboard */, 69 | 41F7A7A41F28F1B90075AC0B /* Assets.xcassets */, 70 | 41F7A7A61F28F1B90075AC0B /* LaunchScreen.storyboard */, 71 | 41F7A7A91F28F1B90075AC0B /* Info.plist */, 72 | ); 73 | path = AnimateTabbarBadgeView; 74 | sourceTree = ""; 75 | }; 76 | /* End PBXGroup section */ 77 | 78 | /* Begin PBXNativeTarget section */ 79 | 41F7A7971F28F1B90075AC0B /* AnimateTabbarBadgeView */ = { 80 | isa = PBXNativeTarget; 81 | buildConfigurationList = 41F7A7AC1F28F1B90075AC0B /* Build configuration list for PBXNativeTarget "AnimateTabbarBadgeView" */; 82 | buildPhases = ( 83 | 41F7A7941F28F1B90075AC0B /* Sources */, 84 | 41F7A7951F28F1B90075AC0B /* Frameworks */, 85 | 41F7A7961F28F1B90075AC0B /* Resources */, 86 | ); 87 | buildRules = ( 88 | ); 89 | dependencies = ( 90 | ); 91 | name = AnimateTabbarBadgeView; 92 | productName = AnimateTabbarBadgeView; 93 | productReference = 41F7A7981F28F1B90075AC0B /* AnimateTabbarBadgeView.app */; 94 | productType = "com.apple.product-type.application"; 95 | }; 96 | /* End PBXNativeTarget section */ 97 | 98 | /* Begin PBXProject section */ 99 | 41F7A7901F28F1B90075AC0B /* Project object */ = { 100 | isa = PBXProject; 101 | attributes = { 102 | LastSwiftUpdateCheck = 0830; 103 | LastUpgradeCheck = 0830; 104 | ORGANIZATIONNAME = "Ali Adam"; 105 | TargetAttributes = { 106 | 41F7A7971F28F1B90075AC0B = { 107 | CreatedOnToolsVersion = 8.3; 108 | DevelopmentTeam = HJ9GBN3WD6; 109 | ProvisioningStyle = Automatic; 110 | }; 111 | }; 112 | }; 113 | buildConfigurationList = 41F7A7931F28F1B90075AC0B /* Build configuration list for PBXProject "AnimateTabbarBadgeView" */; 114 | compatibilityVersion = "Xcode 3.2"; 115 | developmentRegion = English; 116 | hasScannedForEncodings = 0; 117 | knownRegions = ( 118 | en, 119 | Base, 120 | ); 121 | mainGroup = 41F7A78F1F28F1B90075AC0B; 122 | productRefGroup = 41F7A7991F28F1B90075AC0B /* Products */; 123 | projectDirPath = ""; 124 | projectRoot = ""; 125 | targets = ( 126 | 41F7A7971F28F1B90075AC0B /* AnimateTabbarBadgeView */, 127 | ); 128 | }; 129 | /* End PBXProject section */ 130 | 131 | /* Begin PBXResourcesBuildPhase section */ 132 | 41F7A7961F28F1B90075AC0B /* Resources */ = { 133 | isa = PBXResourcesBuildPhase; 134 | buildActionMask = 2147483647; 135 | files = ( 136 | 41F7A7A81F28F1B90075AC0B /* LaunchScreen.storyboard in Resources */, 137 | 41F7A7A51F28F1B90075AC0B /* Assets.xcassets in Resources */, 138 | 41F7A7A31F28F1B90075AC0B /* Main.storyboard in Resources */, 139 | ); 140 | runOnlyForDeploymentPostprocessing = 0; 141 | }; 142 | /* End PBXResourcesBuildPhase section */ 143 | 144 | /* Begin PBXSourcesBuildPhase section */ 145 | 41F7A7941F28F1B90075AC0B /* Sources */ = { 146 | isa = PBXSourcesBuildPhase; 147 | buildActionMask = 2147483647; 148 | files = ( 149 | 41F7A7A01F28F1B90075AC0B /* SecondViewController.swift in Sources */, 150 | 41F7A7B21F28FCEE0075AC0B /* ThirdViewController.swift in Sources */, 151 | 41F7A79C1F28F1B90075AC0B /* AppDelegate.swift in Sources */, 152 | 41F7A7B01F28F1F60075AC0B /* Extension+UITabBarController.swift in Sources */, 153 | 41F7A79E1F28F1B90075AC0B /* FirstViewController.swift in Sources */, 154 | ); 155 | runOnlyForDeploymentPostprocessing = 0; 156 | }; 157 | /* End PBXSourcesBuildPhase section */ 158 | 159 | /* Begin PBXVariantGroup section */ 160 | 41F7A7A11F28F1B90075AC0B /* Main.storyboard */ = { 161 | isa = PBXVariantGroup; 162 | children = ( 163 | 41F7A7A21F28F1B90075AC0B /* Base */, 164 | ); 165 | name = Main.storyboard; 166 | sourceTree = ""; 167 | }; 168 | 41F7A7A61F28F1B90075AC0B /* LaunchScreen.storyboard */ = { 169 | isa = PBXVariantGroup; 170 | children = ( 171 | 41F7A7A71F28F1B90075AC0B /* Base */, 172 | ); 173 | name = LaunchScreen.storyboard; 174 | sourceTree = ""; 175 | }; 176 | /* End PBXVariantGroup section */ 177 | 178 | /* Begin XCBuildConfiguration section */ 179 | 41F7A7AA1F28F1B90075AC0B /* Debug */ = { 180 | isa = XCBuildConfiguration; 181 | buildSettings = { 182 | ALWAYS_SEARCH_USER_PATHS = NO; 183 | CLANG_ANALYZER_NONNULL = YES; 184 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 185 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 186 | CLANG_CXX_LIBRARY = "libc++"; 187 | CLANG_ENABLE_MODULES = YES; 188 | CLANG_ENABLE_OBJC_ARC = YES; 189 | CLANG_WARN_BOOL_CONVERSION = YES; 190 | CLANG_WARN_CONSTANT_CONVERSION = YES; 191 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 192 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 193 | CLANG_WARN_EMPTY_BODY = YES; 194 | CLANG_WARN_ENUM_CONVERSION = YES; 195 | CLANG_WARN_INFINITE_RECURSION = YES; 196 | CLANG_WARN_INT_CONVERSION = YES; 197 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 198 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 199 | CLANG_WARN_UNREACHABLE_CODE = YES; 200 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 201 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 202 | COPY_PHASE_STRIP = NO; 203 | DEBUG_INFORMATION_FORMAT = dwarf; 204 | ENABLE_STRICT_OBJC_MSGSEND = YES; 205 | ENABLE_TESTABILITY = YES; 206 | GCC_C_LANGUAGE_STANDARD = gnu99; 207 | GCC_DYNAMIC_NO_PIC = NO; 208 | GCC_NO_COMMON_BLOCKS = YES; 209 | GCC_OPTIMIZATION_LEVEL = 0; 210 | GCC_PREPROCESSOR_DEFINITIONS = ( 211 | "DEBUG=1", 212 | "$(inherited)", 213 | ); 214 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 215 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 216 | GCC_WARN_UNDECLARED_SELECTOR = YES; 217 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 218 | GCC_WARN_UNUSED_FUNCTION = YES; 219 | GCC_WARN_UNUSED_VARIABLE = YES; 220 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 221 | MTL_ENABLE_DEBUG_INFO = YES; 222 | ONLY_ACTIVE_ARCH = YES; 223 | SDKROOT = iphoneos; 224 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 225 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 226 | }; 227 | name = Debug; 228 | }; 229 | 41F7A7AB1F28F1B90075AC0B /* Release */ = { 230 | isa = XCBuildConfiguration; 231 | buildSettings = { 232 | ALWAYS_SEARCH_USER_PATHS = NO; 233 | CLANG_ANALYZER_NONNULL = YES; 234 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 235 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 236 | CLANG_CXX_LIBRARY = "libc++"; 237 | CLANG_ENABLE_MODULES = YES; 238 | CLANG_ENABLE_OBJC_ARC = YES; 239 | CLANG_WARN_BOOL_CONVERSION = YES; 240 | CLANG_WARN_CONSTANT_CONVERSION = YES; 241 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 242 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 243 | CLANG_WARN_EMPTY_BODY = YES; 244 | CLANG_WARN_ENUM_CONVERSION = YES; 245 | CLANG_WARN_INFINITE_RECURSION = YES; 246 | CLANG_WARN_INT_CONVERSION = YES; 247 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 248 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 249 | CLANG_WARN_UNREACHABLE_CODE = YES; 250 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 251 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 252 | COPY_PHASE_STRIP = NO; 253 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 254 | ENABLE_NS_ASSERTIONS = NO; 255 | ENABLE_STRICT_OBJC_MSGSEND = YES; 256 | GCC_C_LANGUAGE_STANDARD = gnu99; 257 | GCC_NO_COMMON_BLOCKS = YES; 258 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 259 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 260 | GCC_WARN_UNDECLARED_SELECTOR = YES; 261 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 262 | GCC_WARN_UNUSED_FUNCTION = YES; 263 | GCC_WARN_UNUSED_VARIABLE = YES; 264 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 265 | MTL_ENABLE_DEBUG_INFO = NO; 266 | SDKROOT = iphoneos; 267 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 268 | VALIDATE_PRODUCT = YES; 269 | }; 270 | name = Release; 271 | }; 272 | 41F7A7AD1F28F1B90075AC0B /* Debug */ = { 273 | isa = XCBuildConfiguration; 274 | buildSettings = { 275 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 276 | DEVELOPMENT_TEAM = HJ9GBN3WD6; 277 | INFOPLIST_FILE = AnimateTabbarBadgeView/Info.plist; 278 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 279 | PRODUCT_BUNDLE_IDENTIFIER = AliAdam.AnimateTabbarBadgeView; 280 | PRODUCT_NAME = "$(TARGET_NAME)"; 281 | SWIFT_VERSION = 3.0; 282 | }; 283 | name = Debug; 284 | }; 285 | 41F7A7AE1F28F1B90075AC0B /* Release */ = { 286 | isa = XCBuildConfiguration; 287 | buildSettings = { 288 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 289 | DEVELOPMENT_TEAM = HJ9GBN3WD6; 290 | INFOPLIST_FILE = AnimateTabbarBadgeView/Info.plist; 291 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 292 | PRODUCT_BUNDLE_IDENTIFIER = AliAdam.AnimateTabbarBadgeView; 293 | PRODUCT_NAME = "$(TARGET_NAME)"; 294 | SWIFT_VERSION = 3.0; 295 | }; 296 | name = Release; 297 | }; 298 | /* End XCBuildConfiguration section */ 299 | 300 | /* Begin XCConfigurationList section */ 301 | 41F7A7931F28F1B90075AC0B /* Build configuration list for PBXProject "AnimateTabbarBadgeView" */ = { 302 | isa = XCConfigurationList; 303 | buildConfigurations = ( 304 | 41F7A7AA1F28F1B90075AC0B /* Debug */, 305 | 41F7A7AB1F28F1B90075AC0B /* Release */, 306 | ); 307 | defaultConfigurationIsVisible = 0; 308 | defaultConfigurationName = Release; 309 | }; 310 | 41F7A7AC1F28F1B90075AC0B /* Build configuration list for PBXNativeTarget "AnimateTabbarBadgeView" */ = { 311 | isa = XCConfigurationList; 312 | buildConfigurations = ( 313 | 41F7A7AD1F28F1B90075AC0B /* Debug */, 314 | 41F7A7AE1F28F1B90075AC0B /* Release */, 315 | ); 316 | defaultConfigurationIsVisible = 0; 317 | defaultConfigurationName = Release; 318 | }; 319 | /* End XCConfigurationList section */ 320 | }; 321 | rootObject = 41F7A7901F28F1B90075AC0B /* Project object */; 322 | } 323 | -------------------------------------------------------------------------------- /AnimateTabbarBadgeView.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AnimateTabbarBadgeView.xcodeproj/project.xcworkspace/xcuserdata/ali.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AliAdam/AnimateTabbarBadgeView/e5da76b3a5c0747a7cf764edeb142454763af20a/AnimateTabbarBadgeView.xcodeproj/project.xcworkspace/xcuserdata/ali.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /AnimateTabbarBadgeView.xcodeproj/xcuserdata/ali.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 20 | 21 | 22 | 24 | 36 | 37 | 38 | 40 | 52 | 53 | 54 | 56 | 68 | 69 | 70 | 72 | 84 | 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /AnimateTabbarBadgeView.xcodeproj/xcuserdata/ali.xcuserdatad/xcschemes/AnimateTabbarBadgeView.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 | -------------------------------------------------------------------------------- /AnimateTabbarBadgeView.xcodeproj/xcuserdata/ali.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | AnimateTabbarBadgeView.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 41F7A7971F28F1B90075AC0B 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /AnimateTabbarBadgeView/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // AnimateTabbarBadgeView 4 | // 5 | // Created by Ali Adam on 7/26/17. 6 | // Copyright © 2017 Ali Adam. 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 | -------------------------------------------------------------------------------- /AnimateTabbarBadgeView/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | } 43 | ], 44 | "info" : { 45 | "version" : 1, 46 | "author" : "xcode" 47 | } 48 | } -------------------------------------------------------------------------------- /AnimateTabbarBadgeView/Assets.xcassets/first.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "first.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /AnimateTabbarBadgeView/Assets.xcassets/first.imageset/first.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AliAdam/AnimateTabbarBadgeView/e5da76b3a5c0747a7cf764edeb142454763af20a/AnimateTabbarBadgeView/Assets.xcassets/first.imageset/first.pdf -------------------------------------------------------------------------------- /AnimateTabbarBadgeView/Assets.xcassets/second.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "second.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /AnimateTabbarBadgeView/Assets.xcassets/second.imageset/second.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AliAdam/AnimateTabbarBadgeView/e5da76b3a5c0747a7cf764edeb142454763af20a/AnimateTabbarBadgeView/Assets.xcassets/second.imageset/second.pdf -------------------------------------------------------------------------------- /AnimateTabbarBadgeView/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 | -------------------------------------------------------------------------------- /AnimateTabbarBadgeView/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 | 32 | 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 | 72 | 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 | 112 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | -------------------------------------------------------------------------------- /AnimateTabbarBadgeView/Extension+UITabBarController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TabBarController+Extension.swift 3 | // AnimateTabbarBadgeView 4 | // 5 | // Created by Ali Adam on 7/26/17. 6 | // Copyright © 2017 Ali Adam. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | 12 | extension UITabBarController { 13 | func animateTabBarBadgeView(){ 14 | loopThrowViews(view: self.tabBar) 15 | } 16 | func loopThrowViews(view:UIView){ 17 | for subview in (view.subviews){ 18 | let type = String(describing: type(of: subview)) 19 | print(type) 20 | if type == "_UIBadgeView" { 21 | print("this is BadgeView") 22 | print("index = \(String(describing: subview.superview?.tag))") 23 | animateView(view: subview) 24 | } 25 | else { 26 | loopThrowViews(view:subview) 27 | } 28 | 29 | } 30 | } 31 | 32 | func animateView(view:UIView){ 33 | let shakeAnimation = CABasicAnimation(keyPath: "position") 34 | //shakeAnimation.duration = 0.05 35 | shakeAnimation.repeatCount = 1050 36 | shakeAnimation.autoreverses = true 37 | shakeAnimation.fromValue = NSValue(cgPoint: CGPoint(x:view.center.x - 10, y:view.center.y)) 38 | shakeAnimation.toValue = NSValue(cgPoint: CGPoint(x:view.center.x + 10, y:view.center.y)) 39 | view.layer.add(shakeAnimation, forKey: "position") 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /AnimateTabbarBadgeView/FirstViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FirstViewController.swift 3 | // AnimateTabbarBadgeView 4 | // 5 | // Created by Ali Adam on 7/26/17. 6 | // Copyright © 2017 Ali Adam. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class FirstViewController: UIViewController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | 16 | self.tabBarItem.badgeValue = "5" 17 | } 18 | override func viewDidAppear(_ animated: Bool) { 19 | super.viewDidAppear(animated) 20 | self.tabBarController?.animateTabBarBadgeView() 21 | 22 | } 23 | override func didReceiveMemoryWarning() { 24 | super.didReceiveMemoryWarning() 25 | // Dispose of any resources that can be recreated. 26 | } 27 | 28 | 29 | } 30 | 31 | -------------------------------------------------------------------------------- /AnimateTabbarBadgeView/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 | UIStatusBarTintParameters 32 | 33 | UINavigationBar 34 | 35 | Style 36 | UIBarStyleDefault 37 | Translucent 38 | 39 | 40 | 41 | UISupportedInterfaceOrientations 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationLandscapeLeft 45 | UIInterfaceOrientationLandscapeRight 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /AnimateTabbarBadgeView/SecondViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SecondViewController.swift 3 | // AnimateTabbarBadgeView 4 | // 5 | // Created by Ali Adam on 7/26/17. 6 | // Copyright © 2017 Ali Adam. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class SecondViewController: UIViewController { 12 | 13 | 14 | required init?(coder aDecoder: NSCoder) { 15 | super.init(coder: aDecoder) 16 | 17 | } 18 | 19 | override func viewDidLoad() { 20 | super.viewDidLoad() 21 | // Do any additional setup after loading the view, typically from a nib. 22 | } 23 | 24 | override func didReceiveMemoryWarning() { 25 | super.didReceiveMemoryWarning() 26 | // Dispose of any resources that can be recreated. 27 | } 28 | 29 | 30 | } 31 | 32 | -------------------------------------------------------------------------------- /AnimateTabbarBadgeView/ThirdViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ThirdViewController.swift 3 | // AnimateTabbarBadgeView 4 | // 5 | // Created by Ali Adam on 7/26/17. 6 | // Copyright © 2017 Ali Adam. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ThirdViewController: UIViewController { 12 | 13 | 14 | required init?(coder aDecoder: NSCoder) { 15 | super.init(coder: aDecoder) 16 | self.tabBarItem.badgeValue = "8" 17 | 18 | } 19 | 20 | override func viewDidLoad() { 21 | super.viewDidLoad() 22 | // Do any additional setup after loading the view, typically from a nib. 23 | } 24 | 25 | override func didReceiveMemoryWarning() { 26 | super.didReceiveMemoryWarning() 27 | // Dispose of any resources that can be recreated. 28 | } 29 | 30 | 31 | } 32 | 33 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AnimateTabbarBadgeView 2 | 3 | UITabBarController Extention to make badge View animated 4 | 5 | All what you need just 6 | 7 | 1 - drob the Extension+UITabBarController.swift at your project 8 | 9 | 2 call it like this 10 | 11 | ``` 12 | self.tabBarController?.animateTabBarBadgeView() 13 | 14 | ``` 15 | ![ScreenShot](https://github.com/AliAdam/AnimateTabbarBadgeView/blob/master/screenShot.gif) 16 | 17 | 18 | -------------------------------------------------------------------------------- /screenShot.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AliAdam/AnimateTabbarBadgeView/e5da76b3a5c0747a7cf764edeb142454763af20a/screenShot.gif --------------------------------------------------------------------------------