├── AnimatedButton.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcuserdata │ └── yahya.xcuserdatad │ └── xcschemes │ ├── AnimatedButton.xcscheme │ └── xcschememanagement.plist ├── AnimatedButton ├── AnimatedButton.gif ├── AnimatedButton │ ├── FamButton.h │ ├── FamButton.m │ ├── MagnificationButton.h │ ├── MagnificationButton.m │ ├── PressButton.h │ ├── PressButton.m │ ├── SelectionButton.h │ └── SelectionButton.m ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ └── icon_name.imageset │ │ ├── Contents.json │ │ ├── stop.png │ │ └── stop1.png ├── Base.lproj │ └── LaunchScreen.storyboard ├── Info.plist ├── ViewController.h ├── ViewController.m ├── ViewController.xib └── main.m ├── LICENCE └── README.md /AnimatedButton.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 080A7EDD1E55622600F2A541 /* SelectionButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 080A7EDC1E55622600F2A541 /* SelectionButton.m */; }; 11 | 081ECA651E54814700AAF353 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 081ECA641E54814700AAF353 /* main.m */; }; 12 | 081ECA681E54814700AAF353 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 081ECA671E54814700AAF353 /* AppDelegate.m */; }; 13 | 081ECA701E54814700AAF353 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 081ECA6F1E54814700AAF353 /* Assets.xcassets */; }; 14 | 081ECA731E54814700AAF353 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 081ECA711E54814700AAF353 /* LaunchScreen.storyboard */; }; 15 | 081ECA7D1E54817A00AAF353 /* MagnificationButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 081ECA7C1E54817A00AAF353 /* MagnificationButton.m */; }; 16 | 081ECA811E5481C200AAF353 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 081ECA7F1E5481C200AAF353 /* ViewController.m */; }; 17 | 081ECA821E5481C200AAF353 /* ViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 081ECA801E5481C200AAF353 /* ViewController.xib */; }; 18 | 081ECA851E5485CB00AAF353 /* PressButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 081ECA841E5485CB00AAF353 /* PressButton.m */; }; 19 | 08A0B5D31E558C9C002042D6 /* FamButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 08A0B5D21E558C9C002042D6 /* FamButton.m */; }; 20 | 08CEF1071E921EAD00DF4F57 /* README.md in Sources */ = {isa = PBXBuildFile; fileRef = 08CEF1061E921EAD00DF4F57 /* README.md */; }; 21 | 08CEF10B1E92235800DF4F57 /* AnimatedButton.gif in Resources */ = {isa = PBXBuildFile; fileRef = 08CEF10A1E92235800DF4F57 /* AnimatedButton.gif */; }; 22 | 08CEF10D1E92258500DF4F57 /* LICENCE in Resources */ = {isa = PBXBuildFile; fileRef = 08CEF10C1E92258500DF4F57 /* LICENCE */; }; 23 | /* End PBXBuildFile section */ 24 | 25 | /* Begin PBXFileReference section */ 26 | 080A7EDB1E55622600F2A541 /* SelectionButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectionButton.h; sourceTree = ""; }; 27 | 080A7EDC1E55622600F2A541 /* SelectionButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SelectionButton.m; sourceTree = ""; }; 28 | 081ECA601E54814700AAF353 /* AnimatedButton.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AnimatedButton.app; sourceTree = BUILT_PRODUCTS_DIR; }; 29 | 081ECA641E54814700AAF353 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 30 | 081ECA661E54814700AAF353 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 31 | 081ECA671E54814700AAF353 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 32 | 081ECA6F1E54814700AAF353 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 33 | 081ECA721E54814700AAF353 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 34 | 081ECA741E54814700AAF353 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 35 | 081ECA7B1E54817A00AAF353 /* MagnificationButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MagnificationButton.h; sourceTree = ""; }; 36 | 081ECA7C1E54817A00AAF353 /* MagnificationButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MagnificationButton.m; sourceTree = ""; }; 37 | 081ECA7E1E5481C200AAF353 /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 38 | 081ECA7F1E5481C200AAF353 /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 39 | 081ECA801E5481C200AAF353 /* ViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ViewController.xib; sourceTree = ""; }; 40 | 081ECA831E5485CB00AAF353 /* PressButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PressButton.h; sourceTree = ""; }; 41 | 081ECA841E5485CB00AAF353 /* PressButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PressButton.m; sourceTree = ""; }; 42 | 08A0B5D11E558C9C002042D6 /* FamButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FamButton.h; sourceTree = ""; }; 43 | 08A0B5D21E558C9C002042D6 /* FamButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FamButton.m; sourceTree = ""; }; 44 | 08CEF1061E921EAD00DF4F57 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 45 | 08CEF10A1E92235800DF4F57 /* AnimatedButton.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = AnimatedButton.gif; sourceTree = ""; }; 46 | 08CEF10C1E92258500DF4F57 /* LICENCE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENCE; sourceTree = ""; }; 47 | /* End PBXFileReference section */ 48 | 49 | /* Begin PBXFrameworksBuildPhase section */ 50 | 081ECA5D1E54814700AAF353 /* Frameworks */ = { 51 | isa = PBXFrameworksBuildPhase; 52 | buildActionMask = 2147483647; 53 | files = ( 54 | ); 55 | runOnlyForDeploymentPostprocessing = 0; 56 | }; 57 | /* End PBXFrameworksBuildPhase section */ 58 | 59 | /* Begin PBXGroup section */ 60 | 081ECA571E54814700AAF353 = { 61 | isa = PBXGroup; 62 | children = ( 63 | 08CEF1061E921EAD00DF4F57 /* README.md */, 64 | 08CEF10C1E92258500DF4F57 /* LICENCE */, 65 | 081ECA621E54814700AAF353 /* AnimatedButton */, 66 | 081ECA611E54814700AAF353 /* Products */, 67 | ); 68 | sourceTree = ""; 69 | }; 70 | 081ECA611E54814700AAF353 /* Products */ = { 71 | isa = PBXGroup; 72 | children = ( 73 | 081ECA601E54814700AAF353 /* AnimatedButton.app */, 74 | ); 75 | name = Products; 76 | sourceTree = ""; 77 | }; 78 | 081ECA621E54814700AAF353 /* AnimatedButton */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 081ECA7A1E54816E00AAF353 /* AnimatedButton */, 82 | 081ECA661E54814700AAF353 /* AppDelegate.h */, 83 | 081ECA671E54814700AAF353 /* AppDelegate.m */, 84 | 081ECA6F1E54814700AAF353 /* Assets.xcassets */, 85 | 081ECA711E54814700AAF353 /* LaunchScreen.storyboard */, 86 | 081ECA741E54814700AAF353 /* Info.plist */, 87 | 081ECA631E54814700AAF353 /* Supporting Files */, 88 | 081ECA7E1E5481C200AAF353 /* ViewController.h */, 89 | 081ECA7F1E5481C200AAF353 /* ViewController.m */, 90 | 081ECA801E5481C200AAF353 /* ViewController.xib */, 91 | 08CEF10A1E92235800DF4F57 /* AnimatedButton.gif */, 92 | ); 93 | path = AnimatedButton; 94 | sourceTree = ""; 95 | }; 96 | 081ECA631E54814700AAF353 /* Supporting Files */ = { 97 | isa = PBXGroup; 98 | children = ( 99 | 081ECA641E54814700AAF353 /* main.m */, 100 | ); 101 | name = "Supporting Files"; 102 | sourceTree = ""; 103 | }; 104 | 081ECA7A1E54816E00AAF353 /* AnimatedButton */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | 081ECA7B1E54817A00AAF353 /* MagnificationButton.h */, 108 | 081ECA7C1E54817A00AAF353 /* MagnificationButton.m */, 109 | 081ECA831E5485CB00AAF353 /* PressButton.h */, 110 | 081ECA841E5485CB00AAF353 /* PressButton.m */, 111 | 080A7EDB1E55622600F2A541 /* SelectionButton.h */, 112 | 080A7EDC1E55622600F2A541 /* SelectionButton.m */, 113 | 08A0B5D11E558C9C002042D6 /* FamButton.h */, 114 | 08A0B5D21E558C9C002042D6 /* FamButton.m */, 115 | ); 116 | path = AnimatedButton; 117 | sourceTree = ""; 118 | }; 119 | /* End PBXGroup section */ 120 | 121 | /* Begin PBXNativeTarget section */ 122 | 081ECA5F1E54814700AAF353 /* AnimatedButton */ = { 123 | isa = PBXNativeTarget; 124 | buildConfigurationList = 081ECA771E54814700AAF353 /* Build configuration list for PBXNativeTarget "AnimatedButton" */; 125 | buildPhases = ( 126 | 081ECA5C1E54814700AAF353 /* Sources */, 127 | 081ECA5D1E54814700AAF353 /* Frameworks */, 128 | 081ECA5E1E54814700AAF353 /* Resources */, 129 | ); 130 | buildRules = ( 131 | ); 132 | dependencies = ( 133 | ); 134 | name = AnimatedButton; 135 | productName = AnimatedButton; 136 | productReference = 081ECA601E54814700AAF353 /* AnimatedButton.app */; 137 | productType = "com.apple.product-type.application"; 138 | }; 139 | /* End PBXNativeTarget section */ 140 | 141 | /* Begin PBXProject section */ 142 | 081ECA581E54814700AAF353 /* Project object */ = { 143 | isa = PBXProject; 144 | attributes = { 145 | LastUpgradeCheck = 0820; 146 | ORGANIZATIONNAME = yahya; 147 | TargetAttributes = { 148 | 081ECA5F1E54814700AAF353 = { 149 | CreatedOnToolsVersion = 8.2.1; 150 | DevelopmentTeam = 69AXYX9773; 151 | ProvisioningStyle = Automatic; 152 | }; 153 | }; 154 | }; 155 | buildConfigurationList = 081ECA5B1E54814700AAF353 /* Build configuration list for PBXProject "AnimatedButton" */; 156 | compatibilityVersion = "Xcode 3.2"; 157 | developmentRegion = English; 158 | hasScannedForEncodings = 0; 159 | knownRegions = ( 160 | en, 161 | Base, 162 | ); 163 | mainGroup = 081ECA571E54814700AAF353; 164 | productRefGroup = 081ECA611E54814700AAF353 /* Products */; 165 | projectDirPath = ""; 166 | projectRoot = ""; 167 | targets = ( 168 | 081ECA5F1E54814700AAF353 /* AnimatedButton */, 169 | ); 170 | }; 171 | /* End PBXProject section */ 172 | 173 | /* Begin PBXResourcesBuildPhase section */ 174 | 081ECA5E1E54814700AAF353 /* Resources */ = { 175 | isa = PBXResourcesBuildPhase; 176 | buildActionMask = 2147483647; 177 | files = ( 178 | 081ECA731E54814700AAF353 /* LaunchScreen.storyboard in Resources */, 179 | 08CEF10D1E92258500DF4F57 /* LICENCE in Resources */, 180 | 08CEF10B1E92235800DF4F57 /* AnimatedButton.gif in Resources */, 181 | 081ECA821E5481C200AAF353 /* ViewController.xib in Resources */, 182 | 081ECA701E54814700AAF353 /* Assets.xcassets in Resources */, 183 | ); 184 | runOnlyForDeploymentPostprocessing = 0; 185 | }; 186 | /* End PBXResourcesBuildPhase section */ 187 | 188 | /* Begin PBXSourcesBuildPhase section */ 189 | 081ECA5C1E54814700AAF353 /* Sources */ = { 190 | isa = PBXSourcesBuildPhase; 191 | buildActionMask = 2147483647; 192 | files = ( 193 | 080A7EDD1E55622600F2A541 /* SelectionButton.m in Sources */, 194 | 08A0B5D31E558C9C002042D6 /* FamButton.m in Sources */, 195 | 081ECA681E54814700AAF353 /* AppDelegate.m in Sources */, 196 | 081ECA851E5485CB00AAF353 /* PressButton.m in Sources */, 197 | 081ECA651E54814700AAF353 /* main.m in Sources */, 198 | 081ECA811E5481C200AAF353 /* ViewController.m in Sources */, 199 | 08CEF1071E921EAD00DF4F57 /* README.md in Sources */, 200 | 081ECA7D1E54817A00AAF353 /* MagnificationButton.m in Sources */, 201 | ); 202 | runOnlyForDeploymentPostprocessing = 0; 203 | }; 204 | /* End PBXSourcesBuildPhase section */ 205 | 206 | /* Begin PBXVariantGroup section */ 207 | 081ECA711E54814700AAF353 /* LaunchScreen.storyboard */ = { 208 | isa = PBXVariantGroup; 209 | children = ( 210 | 081ECA721E54814700AAF353 /* Base */, 211 | ); 212 | name = LaunchScreen.storyboard; 213 | sourceTree = ""; 214 | }; 215 | /* End PBXVariantGroup section */ 216 | 217 | /* Begin XCBuildConfiguration section */ 218 | 081ECA751E54814700AAF353 /* Debug */ = { 219 | isa = XCBuildConfiguration; 220 | buildSettings = { 221 | ALWAYS_SEARCH_USER_PATHS = NO; 222 | CLANG_ANALYZER_NONNULL = YES; 223 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 224 | CLANG_CXX_LIBRARY = "libc++"; 225 | CLANG_ENABLE_MODULES = YES; 226 | CLANG_ENABLE_OBJC_ARC = YES; 227 | CLANG_WARN_BOOL_CONVERSION = YES; 228 | CLANG_WARN_CONSTANT_CONVERSION = YES; 229 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 230 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 231 | CLANG_WARN_EMPTY_BODY = YES; 232 | CLANG_WARN_ENUM_CONVERSION = YES; 233 | CLANG_WARN_INFINITE_RECURSION = YES; 234 | CLANG_WARN_INT_CONVERSION = YES; 235 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 236 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 237 | CLANG_WARN_UNREACHABLE_CODE = YES; 238 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 239 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 240 | COPY_PHASE_STRIP = NO; 241 | DEBUG_INFORMATION_FORMAT = dwarf; 242 | ENABLE_STRICT_OBJC_MSGSEND = YES; 243 | ENABLE_TESTABILITY = YES; 244 | GCC_C_LANGUAGE_STANDARD = gnu99; 245 | GCC_DYNAMIC_NO_PIC = NO; 246 | GCC_NO_COMMON_BLOCKS = YES; 247 | GCC_OPTIMIZATION_LEVEL = 0; 248 | GCC_PREPROCESSOR_DEFINITIONS = ( 249 | "DEBUG=1", 250 | "$(inherited)", 251 | ); 252 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 253 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 254 | GCC_WARN_UNDECLARED_SELECTOR = YES; 255 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 256 | GCC_WARN_UNUSED_FUNCTION = YES; 257 | GCC_WARN_UNUSED_VARIABLE = YES; 258 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 259 | MTL_ENABLE_DEBUG_INFO = YES; 260 | ONLY_ACTIVE_ARCH = YES; 261 | SDKROOT = iphoneos; 262 | TARGETED_DEVICE_FAMILY = "1,2"; 263 | }; 264 | name = Debug; 265 | }; 266 | 081ECA761E54814700AAF353 /* Release */ = { 267 | isa = XCBuildConfiguration; 268 | buildSettings = { 269 | ALWAYS_SEARCH_USER_PATHS = NO; 270 | CLANG_ANALYZER_NONNULL = YES; 271 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 272 | CLANG_CXX_LIBRARY = "libc++"; 273 | CLANG_ENABLE_MODULES = YES; 274 | CLANG_ENABLE_OBJC_ARC = YES; 275 | CLANG_WARN_BOOL_CONVERSION = YES; 276 | CLANG_WARN_CONSTANT_CONVERSION = YES; 277 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 278 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 279 | CLANG_WARN_EMPTY_BODY = YES; 280 | CLANG_WARN_ENUM_CONVERSION = YES; 281 | CLANG_WARN_INFINITE_RECURSION = YES; 282 | CLANG_WARN_INT_CONVERSION = YES; 283 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 284 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 285 | CLANG_WARN_UNREACHABLE_CODE = YES; 286 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 287 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 288 | COPY_PHASE_STRIP = NO; 289 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 290 | ENABLE_NS_ASSERTIONS = NO; 291 | ENABLE_STRICT_OBJC_MSGSEND = YES; 292 | GCC_C_LANGUAGE_STANDARD = gnu99; 293 | GCC_NO_COMMON_BLOCKS = YES; 294 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 295 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 296 | GCC_WARN_UNDECLARED_SELECTOR = YES; 297 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 298 | GCC_WARN_UNUSED_FUNCTION = YES; 299 | GCC_WARN_UNUSED_VARIABLE = YES; 300 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 301 | MTL_ENABLE_DEBUG_INFO = NO; 302 | SDKROOT = iphoneos; 303 | TARGETED_DEVICE_FAMILY = "1,2"; 304 | VALIDATE_PRODUCT = YES; 305 | }; 306 | name = Release; 307 | }; 308 | 081ECA781E54814700AAF353 /* Debug */ = { 309 | isa = XCBuildConfiguration; 310 | buildSettings = { 311 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 312 | DEVELOPMENT_TEAM = 69AXYX9773; 313 | INFOPLIST_FILE = AnimatedButton/Info.plist; 314 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 315 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 316 | PRODUCT_BUNDLE_IDENTIFIER = com.yahya.AnimatedButton; 317 | PRODUCT_NAME = "$(TARGET_NAME)"; 318 | }; 319 | name = Debug; 320 | }; 321 | 081ECA791E54814700AAF353 /* Release */ = { 322 | isa = XCBuildConfiguration; 323 | buildSettings = { 324 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 325 | DEVELOPMENT_TEAM = 69AXYX9773; 326 | INFOPLIST_FILE = AnimatedButton/Info.plist; 327 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 328 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 329 | PRODUCT_BUNDLE_IDENTIFIER = com.yahya.AnimatedButton; 330 | PRODUCT_NAME = "$(TARGET_NAME)"; 331 | }; 332 | name = Release; 333 | }; 334 | /* End XCBuildConfiguration section */ 335 | 336 | /* Begin XCConfigurationList section */ 337 | 081ECA5B1E54814700AAF353 /* Build configuration list for PBXProject "AnimatedButton" */ = { 338 | isa = XCConfigurationList; 339 | buildConfigurations = ( 340 | 081ECA751E54814700AAF353 /* Debug */, 341 | 081ECA761E54814700AAF353 /* Release */, 342 | ); 343 | defaultConfigurationIsVisible = 0; 344 | defaultConfigurationName = Release; 345 | }; 346 | 081ECA771E54814700AAF353 /* Build configuration list for PBXNativeTarget "AnimatedButton" */ = { 347 | isa = XCConfigurationList; 348 | buildConfigurations = ( 349 | 081ECA781E54814700AAF353 /* Debug */, 350 | 081ECA791E54814700AAF353 /* Release */, 351 | ); 352 | defaultConfigurationIsVisible = 0; 353 | defaultConfigurationName = Release; 354 | }; 355 | /* End XCConfigurationList section */ 356 | }; 357 | rootObject = 081ECA581E54814700AAF353 /* Project object */; 358 | } 359 | -------------------------------------------------------------------------------- /AnimatedButton.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AnimatedButton.xcodeproj/xcuserdata/yahya.xcuserdatad/xcschemes/AnimatedButton.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 | -------------------------------------------------------------------------------- /AnimatedButton.xcodeproj/xcuserdata/yahya.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | AnimatedButton.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 081ECA5F1E54814700AAF353 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /AnimatedButton/AnimatedButton.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YahyaBagia/AnimatedButton/46c26c7655e297be1ac4e2f67083975ee25a4fc1/AnimatedButton/AnimatedButton.gif -------------------------------------------------------------------------------- /AnimatedButton/AnimatedButton/FamButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // FamButton.h 3 | // AnimatedButton 4 | // 5 | // Created by Yahya on 16/02/17. 6 | // Copyright © 2017 yahya. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface FamButton : UIButton 12 | 13 | -(void)setSelected:(BOOL)selected withAnimation:(BOOL)shouldAnimate; 14 | -(void)setDefaultImageWithImageName:(NSString *)imageName; 15 | -(void)setSelectedImageWithImageName:(NSString *)imageName andColor:(UIColor*)color; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /AnimatedButton/AnimatedButton/FamButton.m: -------------------------------------------------------------------------------- 1 | // 2 | // FamButton.m 3 | // AnimatedButton 4 | // 5 | // Created by Yahya on 16/02/17. 6 | // Copyright © 2017 yahya. All rights reserved. 7 | // 8 | 9 | #import "FamButton.h" 10 | 11 | #define selectionDuration 0.2 12 | 13 | @implementation FamButton{ 14 | BOOL aSelected; 15 | } 16 | 17 | -(void)setSelected:(BOOL)selected withAnimation:(BOOL)shouldAnimate{ 18 | if(shouldAnimate){ 19 | aSelected = selected; 20 | if(selected){ 21 | [self selectionAnimation]; 22 | }else{ 23 | [self unselectionAnimation]; 24 | } 25 | }else{ 26 | /* usual selection without animation */ 27 | self.selected = selected; 28 | } 29 | } 30 | 31 | -(void)selectionAnimation{ 32 | [UIView animateWithDuration:selectionDuration animations:^{ 33 | self.alpha = 0.0; 34 | self.transform = CGAffineTransformMakeScale(0.0001, 0.0001); 35 | } completion:^(BOOL finished) { 36 | self.selected = aSelected; 37 | [UIView animateWithDuration:selectionDuration animations:^{ 38 | self.transform = CGAffineTransformMakeScale(1.5, 1.5); 39 | self.alpha = 1.0; 40 | } completion:^(BOOL finished) { 41 | [UIView animateWithDuration:selectionDuration animations:^{ 42 | self.transform = CGAffineTransformMakeScale(1.2, 1.2); 43 | }]; 44 | }]; 45 | }]; 46 | } 47 | 48 | -(void)unselectionAnimation{ 49 | self.selected = aSelected; 50 | [UIView animateWithDuration:selectionDuration animations:^{ 51 | self.transform = CGAffineTransformMakeScale(1.5, 1.5); 52 | } completion:^(BOOL finished) { 53 | [UIView animateWithDuration:selectionDuration animations:^{ 54 | self.transform = CGAffineTransformMakeScale(0.0001, 0.0001); 55 | self.alpha = 0.0; 56 | } completion:^(BOOL finished) { 57 | [UIView animateWithDuration:selectionDuration animations:^{ 58 | self.transform = CGAffineTransformMakeScale(1.0, 1.0); 59 | self.alpha = 1.0; 60 | }]; 61 | }]; 62 | }]; 63 | } 64 | 65 | -(void)setDefaultImageWithImageName:(NSString *)imageName{ 66 | UIImage *image = [UIImage imageNamed:imageName]; 67 | [self setImage:image forState:UIControlStateNormal]; 68 | } 69 | 70 | -(void)setSelectedImageWithImageName:(NSString *)imageName andColor:(UIColor*)color{ 71 | UIImage *image = [UIImage imageNamed:imageName]; 72 | image = [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; 73 | [self setImage:image forState:UIControlStateSelected]; 74 | [self setImage:image forState:UIControlStateHighlighted]; 75 | self.tintColor = color; 76 | } 77 | 78 | 79 | @end 80 | -------------------------------------------------------------------------------- /AnimatedButton/AnimatedButton/MagnificationButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // MagnificationButton.h 3 | // CustomButton 4 | // 5 | // Created by Yahya on 15/02/17. 6 | // Copyright © 2017 Yahya. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MagnificationButton : UIButton 12 | 13 | -(void)magnifyOnPress:(BOOL)animate; 14 | -(void)setDefaultImageWithImageName:(NSString *)imageName; 15 | -(void)setSelectedImageWithImageName:(NSString *)imageName andColor:(UIColor*)color; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /AnimatedButton/AnimatedButton/MagnificationButton.m: -------------------------------------------------------------------------------- 1 | // 2 | // MagnificationButton.h 3 | // CustomButton 4 | // 5 | // Created by Yahya on 15/02/17. 6 | // Copyright © 2017 Yahya. All rights reserved. 7 | // 8 | 9 | #import "MagnificationButton.h" 10 | 11 | #define magnificationDuration 0.1 12 | 13 | @implementation MagnificationButton 14 | 15 | -(void)magnifyOnPress:(BOOL)animate{ 16 | if(animate){ 17 | [self addTarget:self action:@selector(magnifyAnimation) forControlEvents:UIControlEventTouchDown]; 18 | [self addTarget:self action:@selector(unmagnifyAnimation) forControlEvents:UIControlEventTouchUpInside]; 19 | } 20 | } 21 | 22 | -(void)magnifyAnimation{ 23 | [UIView animateWithDuration:magnificationDuration animations:^{ 24 | self.transform = CGAffineTransformMakeScale(1.15, 1.15); 25 | }]; 26 | } 27 | 28 | -(void)unmagnifyAnimation{ 29 | [UIView animateWithDuration:magnificationDuration animations:^{ 30 | self.transform = CGAffineTransformMakeScale(1, 1); 31 | }]; 32 | } 33 | 34 | -(void)setDefaultImageWithImageName:(NSString *)imageName{ 35 | UIImage *image = [UIImage imageNamed:imageName]; 36 | [self setImage:image forState:UIControlStateNormal]; 37 | } 38 | 39 | -(void)setSelectedImageWithImageName:(NSString *)imageName andColor:(UIColor*)color{ 40 | UIImage *image = [UIImage imageNamed:imageName]; 41 | image = [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; 42 | [self setImage:image forState:UIControlStateSelected]; 43 | [self setImage:image forState:UIControlStateHighlighted]; 44 | self.tintColor = color; 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /AnimatedButton/AnimatedButton/PressButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // PressButton.h 3 | // AnimatedButton 4 | // 5 | // Created by Yahya on 15/02/17. 6 | // Copyright © 2017 yahya. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface PressButton : UIButton 12 | 13 | -(void)animateOnPress:(BOOL)animate; 14 | -(void)setDefaultImageWithImageName:(NSString *)imageName; 15 | -(void)setSelectedImageWithImageName:(NSString *)imageName andColor:(UIColor*)color; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /AnimatedButton/AnimatedButton/PressButton.m: -------------------------------------------------------------------------------- 1 | // 2 | // PressButton.m 3 | // AnimatedButton 4 | // 5 | // Created by Yahya on 15/02/17. 6 | // Copyright © 2017 yahya. All rights reserved. 7 | // 8 | 9 | #import "PressButton.h" 10 | 11 | #define pressDuration 0.1 12 | 13 | @implementation PressButton 14 | 15 | -(void)animateOnPress:(BOOL)animate{ 16 | if(animate){ 17 | [self addTarget:self action:@selector(pressAnimation) forControlEvents:UIControlEventTouchDown]; 18 | [self addTarget:self action:@selector(unpressAnimation) forControlEvents:UIControlEventTouchUpInside]; 19 | } 20 | } 21 | 22 | -(void)pressAnimation{ 23 | [UIView animateWithDuration:pressDuration animations:^{ 24 | self.transform = CGAffineTransformMakeScale(0.85, 0.85); 25 | }]; 26 | } 27 | 28 | -(void)unpressAnimation{ 29 | [UIView animateWithDuration:pressDuration animations:^{ 30 | self.transform = CGAffineTransformMakeScale(1, 1); 31 | }]; 32 | } 33 | 34 | -(void)setDefaultImageWithImageName:(NSString *)imageName{ 35 | UIImage *image = [UIImage imageNamed:imageName]; 36 | [self setImage:image forState:UIControlStateNormal]; 37 | } 38 | 39 | -(void)setSelectedImageWithImageName:(NSString *)imageName andColor:(UIColor*)color{ 40 | UIImage *image = [UIImage imageNamed:imageName]; 41 | image = [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; 42 | [self setImage:image forState:UIControlStateSelected]; 43 | [self setImage:image forState:UIControlStateHighlighted]; 44 | self.tintColor = color; 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /AnimatedButton/AnimatedButton/SelectionButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // SelectionButton.h 3 | // AnimatedButton 4 | // 5 | // Created by Yahya on 16/02/17. 6 | // Copyright © 2017 yahya. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SelectionButton : UIButton 12 | 13 | -(void)setSelected:(BOOL)selected withAnimation:(BOOL)shouldAnimate; 14 | -(void)setDefaultImageWithImageName:(NSString *)imageName; 15 | -(void)setSelectedImageWithImageName:(NSString *)imageName andColor:(UIColor*)color; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /AnimatedButton/AnimatedButton/SelectionButton.m: -------------------------------------------------------------------------------- 1 | // 2 | // SelectionButton.m 3 | // AnimatedButton 4 | // 5 | // Created by Yahya on 16/02/17. 6 | // Copyright © 2017 yahya. All rights reserved. 7 | // 8 | 9 | #import "SelectionButton.h" 10 | 11 | #define selectionDuration 0.2 12 | 13 | @implementation SelectionButton 14 | 15 | -(void)setSelected:(BOOL)selected withAnimation:(BOOL)shouldAnimate{ 16 | if(shouldAnimate){ 17 | self.selected = selected; 18 | if(selected){ 19 | [self selectionAnimation]; 20 | }else{ 21 | [self unselectionAnimation]; 22 | } 23 | }else{ 24 | /* usual selection without animation */ 25 | self.selected = selected; 26 | } 27 | } 28 | 29 | -(void)selectionAnimation{ 30 | [UIView animateWithDuration:selectionDuration animations:^{ 31 | self.transform = CGAffineTransformMakeScale(0.8, 0.8); 32 | } completion:^(BOOL finished) { 33 | [UIView animateWithDuration:selectionDuration animations:^{ 34 | self.transform = CGAffineTransformMakeScale(1.2, 1.2); 35 | }]; 36 | }]; 37 | } 38 | 39 | -(void)unselectionAnimation{ 40 | [UIView animateWithDuration:selectionDuration animations:^{ 41 | self.transform = CGAffineTransformMakeScale(1.4, 1.4); 42 | } completion:^(BOOL finished) { 43 | [UIView animateWithDuration:selectionDuration animations:^{ 44 | self.transform = CGAffineTransformMakeScale(1.0, 1.0); 45 | }]; 46 | }]; 47 | } 48 | 49 | -(void)setDefaultImageWithImageName:(NSString *)imageName{ 50 | UIImage *image = [UIImage imageNamed:imageName]; 51 | [self setImage:image forState:UIControlStateNormal]; 52 | } 53 | 54 | -(void)setSelectedImageWithImageName:(NSString *)imageName andColor:(UIColor*)color{ 55 | UIImage *image = [UIImage imageNamed:imageName]; 56 | image = [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; 57 | [self setImage:image forState:UIControlStateSelected]; 58 | [self setImage:image forState:UIControlStateHighlighted]; 59 | self.tintColor = color; 60 | } 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /AnimatedButton/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // AnimatedButton 4 | // 5 | // Created by Yahya on 15/02/17. 6 | // Copyright © 2017 yahya. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /AnimatedButton/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // AnimatedButton 4 | // 5 | // Created by Yahya on 15/02/17. 6 | // Copyright © 2017 yahya. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "ViewController.h" 11 | 12 | @interface AppDelegate () 13 | 14 | @end 15 | 16 | @implementation AppDelegate 17 | 18 | 19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 20 | 21 | _window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 22 | _window.rootViewController = [ViewController new]; 23 | [_window makeKeyAndVisible]; 24 | 25 | return YES; 26 | } 27 | 28 | 29 | - (void)applicationWillResignActive:(UIApplication *)application { 30 | // 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. 31 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 32 | } 33 | 34 | 35 | - (void)applicationDidEnterBackground:(UIApplication *)application { 36 | // 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. 37 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 38 | } 39 | 40 | 41 | - (void)applicationWillEnterForeground:(UIApplication *)application { 42 | // 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. 43 | } 44 | 45 | 46 | - (void)applicationDidBecomeActive:(UIApplication *)application { 47 | // 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. 48 | } 49 | 50 | 51 | - (void)applicationWillTerminate:(UIApplication *)application { 52 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 53 | } 54 | 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /AnimatedButton/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 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | } 88 | ], 89 | "info" : { 90 | "version" : 1, 91 | "author" : "xcode" 92 | } 93 | } -------------------------------------------------------------------------------- /AnimatedButton/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /AnimatedButton/Assets.xcassets/icon_name.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "stop.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "stop1.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /AnimatedButton/Assets.xcassets/icon_name.imageset/stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YahyaBagia/AnimatedButton/46c26c7655e297be1ac4e2f67083975ee25a4fc1/AnimatedButton/Assets.xcassets/icon_name.imageset/stop.png -------------------------------------------------------------------------------- /AnimatedButton/Assets.xcassets/icon_name.imageset/stop1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YahyaBagia/AnimatedButton/46c26c7655e297be1ac4e2f67083975ee25a4fc1/AnimatedButton/Assets.xcassets/icon_name.imageset/stop1.png -------------------------------------------------------------------------------- /AnimatedButton/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 | -------------------------------------------------------------------------------- /AnimatedButton/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 | UIRequiredDeviceCapabilities 26 | 27 | armv7 28 | 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | 33 | UISupportedInterfaceOrientations~ipad 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationPortraitUpsideDown 37 | UIInterfaceOrientationLandscapeLeft 38 | UIInterfaceOrientationLandscapeRight 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /AnimatedButton/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // AnimatedButton 4 | // 5 | // Created by Yahya on 15/02/17. 6 | // Copyright © 2017 yahya. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MagnificationButton.h" 11 | #import "PressButton.h" 12 | #import "SelectionButton.h" 13 | #import "FamButton.h" 14 | 15 | @interface ViewController : UIViewController 16 | 17 | @property (weak, nonatomic) IBOutlet SelectionButton *btnSelection; 18 | - (IBAction)btnSelectionClicked:(id)sender; 19 | 20 | @property (weak, nonatomic) IBOutlet PressButton *btnPress; 21 | - (IBAction)btnPressClicked:(id)sender; 22 | 23 | @property (weak, nonatomic) IBOutlet MagnificationButton *btnMagnify; 24 | - (IBAction)btnMagnifyClicked:(id)sender; 25 | 26 | @property (weak, nonatomic) IBOutlet FamButton *btnFam; 27 | - (IBAction)btnFamClicked:(id)sender; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /AnimatedButton/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // AnimatedButton 4 | // 5 | // Created by Yahya on 15/02/17. 6 | // Copyright © 2017 yahya. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @interface ViewController () 12 | 13 | @end 14 | 15 | @implementation ViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | 20 | [self setUpSelectionButton]; 21 | [self setUpPressAnimationButton]; 22 | [self setUpMagnificationAnimationButton]; 23 | [self setUpFamButton]; 24 | } 25 | 26 | - (void)didReceiveMemoryWarning { 27 | [super didReceiveMemoryWarning]; 28 | } 29 | 30 | #pragma mark - Button Selection 31 | -(void)setUpSelectionButton{ 32 | [_btnSelection setDefaultImageWithImageName:@"icon_name"]; 33 | [_btnSelection setSelectedImageWithImageName:@"icon_name" andColor:[UIColor redColor]]; 34 | } 35 | 36 | - (IBAction)btnSelectionClicked:(id)sender { 37 | [_btnSelection setSelected:!_btnSelection.isSelected withAnimation:YES]; 38 | } 39 | #pragma mark - 40 | 41 | #pragma mark - Button Press 42 | -(void)setUpPressAnimationButton{ 43 | [_btnPress setDefaultImageWithImageName:@"icon_name"]; 44 | [_btnPress setSelectedImageWithImageName:@"icon_name" andColor:[UIColor purpleColor]]; 45 | [_btnPress animateOnPress:YES]; 46 | } 47 | 48 | - (IBAction)btnPressClicked:(id)sender { 49 | _btnPress.selected = !_btnPress.isSelected; 50 | } 51 | #pragma mark - 52 | 53 | #pragma mark - Button Magnify 54 | -(void)setUpMagnificationAnimationButton{ 55 | [_btnMagnify setDefaultImageWithImageName:@"icon_name"]; 56 | [_btnMagnify setSelectedImageWithImageName:@"icon_name" andColor:[UIColor purpleColor]]; 57 | [_btnMagnify magnifyOnPress:YES]; 58 | } 59 | 60 | - (IBAction)btnMagnifyClicked:(id)sender { 61 | _btnMagnify.selected = !_btnMagnify.isSelected; 62 | } 63 | #pragma mark - 64 | 65 | #pragma mark - Button Fam (Fade-out and magnification) 66 | -(void)setUpFamButton{ 67 | [_btnFam setDefaultImageWithImageName:@"icon_name"]; 68 | [_btnFam setSelectedImageWithImageName:@"icon_name" andColor:[UIColor redColor]]; 69 | } 70 | - (IBAction)btnFamClicked:(id)sender { 71 | [_btnFam setSelected:!_btnFam.isSelected withAnimation:YES]; 72 | } 73 | @end 74 | -------------------------------------------------------------------------------- /AnimatedButton/ViewController.xib: -------------------------------------------------------------------------------- 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 | 33 | 40 | 47 | 54 | 61 | 68 | 75 | 82 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /AnimatedButton/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // AnimatedButton 4 | // 5 | // Created by Yahya on 15/02/17. 6 | // Copyright © 2017 yahya. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /LICENCE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Yahya Bagia 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 | # AnimatedButton 2 | UIButton subclass which performs animation on selection (click). It is an Objective-C port of [ButtonSelectionAnimation](https://github.com/tungfam/ButtonSelectionAnimation). 3 | 4 | ### Description 5 | There are 4 different custom subclusses of UIButton. Hope it will be useful for you. 6 | 7 | ### Screenshot 8 | ![](https://github.com/YahyaBagia/AnimatedButton/blob/master/AnimatedButton/AnimatedButton.gif) 9 | 10 | ### Usage / Installation 11 | - Choose the animation you like. 12 | - Clone or Download AnimatedButton github repo. 13 | - Assign the chosen custom class to the button you want to animate. Custom classes are located in AnimatedButton folder. 14 | - Check out ViewController.m class to see how to simply implement the animation into your code. 15 | - Done! Enjoy the button animation :) 16 | 17 | ### Requirements 18 | iOS 7.0+ 19 | 20 | ### License 21 | MIT License 22 | --------------------------------------------------------------------------------