├── .gitignore ├── ATDraggableDynamicView.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── ATDraggableDynamicView ├── AppDelegate.h ├── AppDelegate.m ├── Base.lproj │ ├── LaunchScreen.xib │ └── Main.storyboard ├── Classes │ ├── ATDraggableDynamicAnimator │ │ ├── ATDraggableDynamicAnimator.h │ │ └── ATDraggableDynamicAnimator.m │ ├── ATDraggableDynamicView.h │ └── ATDraggableDynamicView.m ├── Images.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Info.plist ├── ViewController.h ├── ViewController.m └── main.m ├── ATDraggableDynamicViewTests ├── ATDraggableDynamicViewTests.m └── Info.plist ├── README.md └── demo.gif /.gitignore: -------------------------------------------------------------------------------- 1 | # OS X noise 2 | .DS_Store 3 | 4 | # TextMate noise 5 | *.tm_build_errors 6 | 7 | # Xcode noise, 8 | # https://github.com/github/gitignore/blob/master/Objective-C.gitignore 9 | *.pbxuser 10 | !default.pbxuser 11 | *.mode1v3 12 | !default.mode1v3 13 | *.mode2v3 14 | !default.mode2v3 15 | *.perspectivev3 16 | !default.perspectivev3 17 | xcuserdata 18 | *.moved-aside 19 | *~.nib 20 | *.xccheckout 21 | 22 | # TMP data 23 | Build/* 24 | DerivedData 25 | cintegration/output 26 | .idea/ 27 | tmp 28 | 29 | # CocoaPods 30 | Pods 31 | 32 | # Cedar helper 33 | spec_arc_support.rb 34 | 35 | Megogo.xcodeproj/project.pbxproj.bak 36 | calabash.framework/ 37 | features/ 38 | -------------------------------------------------------------------------------- /ATDraggableDynamicView.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 3374261C2DD96BAF0C635FA7 /* ATDraggableDynamicView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3374273390F109EC70C99EA1 /* ATDraggableDynamicView.m */; }; 11 | 33742F5DDDF9994BF34DE1D2 /* ATDraggableDynamicAnimator.m in Sources */ = {isa = PBXBuildFile; fileRef = 337424C2B3986F493F1B63D5 /* ATDraggableDynamicAnimator.m */; }; 12 | 9940D4741B1E24A100BA4312 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9940D4731B1E24A100BA4312 /* main.m */; }; 13 | 9940D4771B1E24A100BA4312 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9940D4761B1E24A100BA4312 /* AppDelegate.m */; }; 14 | 9940D47A1B1E24A100BA4312 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9940D4791B1E24A100BA4312 /* ViewController.m */; }; 15 | 9940D47D1B1E24A100BA4312 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9940D47B1B1E24A100BA4312 /* Main.storyboard */; }; 16 | 9940D47F1B1E24A100BA4312 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9940D47E1B1E24A100BA4312 /* Images.xcassets */; }; 17 | 9940D4821B1E24A100BA4312 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9940D4801B1E24A100BA4312 /* LaunchScreen.xib */; }; 18 | 9940D48E1B1E24A100BA4312 /* ATDraggableDynamicViewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 9940D48D1B1E24A100BA4312 /* ATDraggableDynamicViewTests.m */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXContainerItemProxy section */ 22 | 9940D4881B1E24A100BA4312 /* PBXContainerItemProxy */ = { 23 | isa = PBXContainerItemProxy; 24 | containerPortal = 9940D4661B1E24A100BA4312 /* Project object */; 25 | proxyType = 1; 26 | remoteGlobalIDString = 9940D46D1B1E24A100BA4312; 27 | remoteInfo = ATDraggableDynamicView; 28 | }; 29 | /* End PBXContainerItemProxy section */ 30 | 31 | /* Begin PBXFileReference section */ 32 | 337422BA15C97CD9BFBB818B /* ATDraggableDynamicAnimator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ATDraggableDynamicAnimator.h; sourceTree = ""; }; 33 | 337424C2B3986F493F1B63D5 /* ATDraggableDynamicAnimator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ATDraggableDynamicAnimator.m; sourceTree = ""; }; 34 | 3374273390F109EC70C99EA1 /* ATDraggableDynamicView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ATDraggableDynamicView.m; sourceTree = ""; }; 35 | 33742F27E55138AB16C5873D /* ATDraggableDynamicView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ATDraggableDynamicView.h; sourceTree = ""; }; 36 | 9940D46E1B1E24A100BA4312 /* ATDraggableDynamicView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ATDraggableDynamicView.app; sourceTree = BUILT_PRODUCTS_DIR; }; 37 | 9940D4721B1E24A100BA4312 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 38 | 9940D4731B1E24A100BA4312 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 39 | 9940D4751B1E24A100BA4312 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 40 | 9940D4761B1E24A100BA4312 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 41 | 9940D4781B1E24A100BA4312 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 42 | 9940D4791B1E24A100BA4312 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 43 | 9940D47C1B1E24A100BA4312 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 44 | 9940D47E1B1E24A100BA4312 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 45 | 9940D4811B1E24A100BA4312 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 46 | 9940D4871B1E24A100BA4312 /* ATDraggableDynamicViewTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ATDraggableDynamicViewTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 47 | 9940D48C1B1E24A100BA4312 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 48 | 9940D48D1B1E24A100BA4312 /* ATDraggableDynamicViewTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ATDraggableDynamicViewTests.m; sourceTree = ""; }; 49 | /* End PBXFileReference section */ 50 | 51 | /* Begin PBXFrameworksBuildPhase section */ 52 | 9940D46B1B1E24A100BA4312 /* Frameworks */ = { 53 | isa = PBXFrameworksBuildPhase; 54 | buildActionMask = 2147483647; 55 | files = ( 56 | ); 57 | runOnlyForDeploymentPostprocessing = 0; 58 | }; 59 | 9940D4841B1E24A100BA4312 /* Frameworks */ = { 60 | isa = PBXFrameworksBuildPhase; 61 | buildActionMask = 2147483647; 62 | files = ( 63 | ); 64 | runOnlyForDeploymentPostprocessing = 0; 65 | }; 66 | /* End PBXFrameworksBuildPhase section */ 67 | 68 | /* Begin PBXGroup section */ 69 | 33742417CF727FE21AE1BD4E /* Classes */ = { 70 | isa = PBXGroup; 71 | children = ( 72 | 3374273390F109EC70C99EA1 /* ATDraggableDynamicView.m */, 73 | 33742F27E55138AB16C5873D /* ATDraggableDynamicView.h */, 74 | 337424CAC9F7CE56D9036964 /* ATDraggableDynamicAnimator */, 75 | ); 76 | path = Classes; 77 | sourceTree = ""; 78 | }; 79 | 337424CAC9F7CE56D9036964 /* ATDraggableDynamicAnimator */ = { 80 | isa = PBXGroup; 81 | children = ( 82 | 337424C2B3986F493F1B63D5 /* ATDraggableDynamicAnimator.m */, 83 | 337422BA15C97CD9BFBB818B /* ATDraggableDynamicAnimator.h */, 84 | ); 85 | path = ATDraggableDynamicAnimator; 86 | sourceTree = ""; 87 | }; 88 | 9940D4651B1E24A100BA4312 = { 89 | isa = PBXGroup; 90 | children = ( 91 | 9940D4701B1E24A100BA4312 /* ATDraggableDynamicView */, 92 | 9940D48A1B1E24A100BA4312 /* ATDraggableDynamicViewTests */, 93 | 9940D46F1B1E24A100BA4312 /* Products */, 94 | ); 95 | sourceTree = ""; 96 | }; 97 | 9940D46F1B1E24A100BA4312 /* Products */ = { 98 | isa = PBXGroup; 99 | children = ( 100 | 9940D46E1B1E24A100BA4312 /* ATDraggableDynamicView.app */, 101 | 9940D4871B1E24A100BA4312 /* ATDraggableDynamicViewTests.xctest */, 102 | ); 103 | name = Products; 104 | sourceTree = ""; 105 | }; 106 | 9940D4701B1E24A100BA4312 /* ATDraggableDynamicView */ = { 107 | isa = PBXGroup; 108 | children = ( 109 | 9940D4751B1E24A100BA4312 /* AppDelegate.h */, 110 | 9940D4761B1E24A100BA4312 /* AppDelegate.m */, 111 | 9940D4781B1E24A100BA4312 /* ViewController.h */, 112 | 9940D4791B1E24A100BA4312 /* ViewController.m */, 113 | 9940D47B1B1E24A100BA4312 /* Main.storyboard */, 114 | 9940D47E1B1E24A100BA4312 /* Images.xcassets */, 115 | 9940D4801B1E24A100BA4312 /* LaunchScreen.xib */, 116 | 9940D4711B1E24A100BA4312 /* Supporting Files */, 117 | 33742417CF727FE21AE1BD4E /* Classes */, 118 | ); 119 | path = ATDraggableDynamicView; 120 | sourceTree = ""; 121 | }; 122 | 9940D4711B1E24A100BA4312 /* Supporting Files */ = { 123 | isa = PBXGroup; 124 | children = ( 125 | 9940D4721B1E24A100BA4312 /* Info.plist */, 126 | 9940D4731B1E24A100BA4312 /* main.m */, 127 | ); 128 | name = "Supporting Files"; 129 | sourceTree = ""; 130 | }; 131 | 9940D48A1B1E24A100BA4312 /* ATDraggableDynamicViewTests */ = { 132 | isa = PBXGroup; 133 | children = ( 134 | 9940D48D1B1E24A100BA4312 /* ATDraggableDynamicViewTests.m */, 135 | 9940D48B1B1E24A100BA4312 /* Supporting Files */, 136 | ); 137 | path = ATDraggableDynamicViewTests; 138 | sourceTree = ""; 139 | }; 140 | 9940D48B1B1E24A100BA4312 /* Supporting Files */ = { 141 | isa = PBXGroup; 142 | children = ( 143 | 9940D48C1B1E24A100BA4312 /* Info.plist */, 144 | ); 145 | name = "Supporting Files"; 146 | sourceTree = ""; 147 | }; 148 | /* End PBXGroup section */ 149 | 150 | /* Begin PBXNativeTarget section */ 151 | 9940D46D1B1E24A100BA4312 /* ATDraggableDynamicView */ = { 152 | isa = PBXNativeTarget; 153 | buildConfigurationList = 9940D4911B1E24A100BA4312 /* Build configuration list for PBXNativeTarget "ATDraggableDynamicView" */; 154 | buildPhases = ( 155 | 9940D46A1B1E24A100BA4312 /* Sources */, 156 | 9940D46B1B1E24A100BA4312 /* Frameworks */, 157 | 9940D46C1B1E24A100BA4312 /* Resources */, 158 | ); 159 | buildRules = ( 160 | ); 161 | dependencies = ( 162 | ); 163 | name = ATDraggableDynamicView; 164 | productName = ATDraggableDynamicView; 165 | productReference = 9940D46E1B1E24A100BA4312 /* ATDraggableDynamicView.app */; 166 | productType = "com.apple.product-type.application"; 167 | }; 168 | 9940D4861B1E24A100BA4312 /* ATDraggableDynamicViewTests */ = { 169 | isa = PBXNativeTarget; 170 | buildConfigurationList = 9940D4941B1E24A100BA4312 /* Build configuration list for PBXNativeTarget "ATDraggableDynamicViewTests" */; 171 | buildPhases = ( 172 | 9940D4831B1E24A100BA4312 /* Sources */, 173 | 9940D4841B1E24A100BA4312 /* Frameworks */, 174 | 9940D4851B1E24A100BA4312 /* Resources */, 175 | ); 176 | buildRules = ( 177 | ); 178 | dependencies = ( 179 | 9940D4891B1E24A100BA4312 /* PBXTargetDependency */, 180 | ); 181 | name = ATDraggableDynamicViewTests; 182 | productName = ATDraggableDynamicViewTests; 183 | productReference = 9940D4871B1E24A100BA4312 /* ATDraggableDynamicViewTests.xctest */; 184 | productType = "com.apple.product-type.bundle.unit-test"; 185 | }; 186 | /* End PBXNativeTarget section */ 187 | 188 | /* Begin PBXProject section */ 189 | 9940D4661B1E24A100BA4312 /* Project object */ = { 190 | isa = PBXProject; 191 | attributes = { 192 | LastUpgradeCheck = 0630; 193 | ORGANIZATIONNAME = "Alex Tkachenko"; 194 | TargetAttributes = { 195 | 9940D46D1B1E24A100BA4312 = { 196 | CreatedOnToolsVersion = 6.3; 197 | }; 198 | 9940D4861B1E24A100BA4312 = { 199 | CreatedOnToolsVersion = 6.3; 200 | TestTargetID = 9940D46D1B1E24A100BA4312; 201 | }; 202 | }; 203 | }; 204 | buildConfigurationList = 9940D4691B1E24A100BA4312 /* Build configuration list for PBXProject "ATDraggableDynamicView" */; 205 | compatibilityVersion = "Xcode 3.2"; 206 | developmentRegion = English; 207 | hasScannedForEncodings = 0; 208 | knownRegions = ( 209 | en, 210 | Base, 211 | ); 212 | mainGroup = 9940D4651B1E24A100BA4312; 213 | productRefGroup = 9940D46F1B1E24A100BA4312 /* Products */; 214 | projectDirPath = ""; 215 | projectRoot = ""; 216 | targets = ( 217 | 9940D46D1B1E24A100BA4312 /* ATDraggableDynamicView */, 218 | 9940D4861B1E24A100BA4312 /* ATDraggableDynamicViewTests */, 219 | ); 220 | }; 221 | /* End PBXProject section */ 222 | 223 | /* Begin PBXResourcesBuildPhase section */ 224 | 9940D46C1B1E24A100BA4312 /* Resources */ = { 225 | isa = PBXResourcesBuildPhase; 226 | buildActionMask = 2147483647; 227 | files = ( 228 | 9940D47D1B1E24A100BA4312 /* Main.storyboard in Resources */, 229 | 9940D4821B1E24A100BA4312 /* LaunchScreen.xib in Resources */, 230 | 9940D47F1B1E24A100BA4312 /* Images.xcassets in Resources */, 231 | ); 232 | runOnlyForDeploymentPostprocessing = 0; 233 | }; 234 | 9940D4851B1E24A100BA4312 /* Resources */ = { 235 | isa = PBXResourcesBuildPhase; 236 | buildActionMask = 2147483647; 237 | files = ( 238 | ); 239 | runOnlyForDeploymentPostprocessing = 0; 240 | }; 241 | /* End PBXResourcesBuildPhase section */ 242 | 243 | /* Begin PBXSourcesBuildPhase section */ 244 | 9940D46A1B1E24A100BA4312 /* Sources */ = { 245 | isa = PBXSourcesBuildPhase; 246 | buildActionMask = 2147483647; 247 | files = ( 248 | 9940D47A1B1E24A100BA4312 /* ViewController.m in Sources */, 249 | 9940D4771B1E24A100BA4312 /* AppDelegate.m in Sources */, 250 | 9940D4741B1E24A100BA4312 /* main.m in Sources */, 251 | 3374261C2DD96BAF0C635FA7 /* ATDraggableDynamicView.m in Sources */, 252 | 33742F5DDDF9994BF34DE1D2 /* ATDraggableDynamicAnimator.m in Sources */, 253 | ); 254 | runOnlyForDeploymentPostprocessing = 0; 255 | }; 256 | 9940D4831B1E24A100BA4312 /* Sources */ = { 257 | isa = PBXSourcesBuildPhase; 258 | buildActionMask = 2147483647; 259 | files = ( 260 | 9940D48E1B1E24A100BA4312 /* ATDraggableDynamicViewTests.m in Sources */, 261 | ); 262 | runOnlyForDeploymentPostprocessing = 0; 263 | }; 264 | /* End PBXSourcesBuildPhase section */ 265 | 266 | /* Begin PBXTargetDependency section */ 267 | 9940D4891B1E24A100BA4312 /* PBXTargetDependency */ = { 268 | isa = PBXTargetDependency; 269 | target = 9940D46D1B1E24A100BA4312 /* ATDraggableDynamicView */; 270 | targetProxy = 9940D4881B1E24A100BA4312 /* PBXContainerItemProxy */; 271 | }; 272 | /* End PBXTargetDependency section */ 273 | 274 | /* Begin PBXVariantGroup section */ 275 | 9940D47B1B1E24A100BA4312 /* Main.storyboard */ = { 276 | isa = PBXVariantGroup; 277 | children = ( 278 | 9940D47C1B1E24A100BA4312 /* Base */, 279 | ); 280 | name = Main.storyboard; 281 | sourceTree = ""; 282 | }; 283 | 9940D4801B1E24A100BA4312 /* LaunchScreen.xib */ = { 284 | isa = PBXVariantGroup; 285 | children = ( 286 | 9940D4811B1E24A100BA4312 /* Base */, 287 | ); 288 | name = LaunchScreen.xib; 289 | sourceTree = ""; 290 | }; 291 | /* End PBXVariantGroup section */ 292 | 293 | /* Begin XCBuildConfiguration section */ 294 | 9940D48F1B1E24A100BA4312 /* Debug */ = { 295 | isa = XCBuildConfiguration; 296 | buildSettings = { 297 | ALWAYS_SEARCH_USER_PATHS = NO; 298 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 299 | CLANG_CXX_LIBRARY = "libc++"; 300 | CLANG_ENABLE_MODULES = YES; 301 | CLANG_ENABLE_OBJC_ARC = YES; 302 | CLANG_WARN_BOOL_CONVERSION = YES; 303 | CLANG_WARN_CONSTANT_CONVERSION = YES; 304 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 305 | CLANG_WARN_EMPTY_BODY = YES; 306 | CLANG_WARN_ENUM_CONVERSION = YES; 307 | CLANG_WARN_INT_CONVERSION = YES; 308 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 309 | CLANG_WARN_UNREACHABLE_CODE = YES; 310 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 311 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 312 | COPY_PHASE_STRIP = NO; 313 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 314 | ENABLE_STRICT_OBJC_MSGSEND = YES; 315 | GCC_C_LANGUAGE_STANDARD = gnu99; 316 | GCC_DYNAMIC_NO_PIC = NO; 317 | GCC_NO_COMMON_BLOCKS = YES; 318 | GCC_OPTIMIZATION_LEVEL = 0; 319 | GCC_PREPROCESSOR_DEFINITIONS = ( 320 | "DEBUG=1", 321 | "$(inherited)", 322 | ); 323 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 324 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 325 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 326 | GCC_WARN_UNDECLARED_SELECTOR = YES; 327 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 328 | GCC_WARN_UNUSED_FUNCTION = YES; 329 | GCC_WARN_UNUSED_VARIABLE = YES; 330 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 331 | MTL_ENABLE_DEBUG_INFO = YES; 332 | ONLY_ACTIVE_ARCH = YES; 333 | SDKROOT = iphoneos; 334 | TARGETED_DEVICE_FAMILY = "1,2"; 335 | }; 336 | name = Debug; 337 | }; 338 | 9940D4901B1E24A100BA4312 /* Release */ = { 339 | isa = XCBuildConfiguration; 340 | buildSettings = { 341 | ALWAYS_SEARCH_USER_PATHS = NO; 342 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 343 | CLANG_CXX_LIBRARY = "libc++"; 344 | CLANG_ENABLE_MODULES = YES; 345 | CLANG_ENABLE_OBJC_ARC = YES; 346 | CLANG_WARN_BOOL_CONVERSION = YES; 347 | CLANG_WARN_CONSTANT_CONVERSION = YES; 348 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 349 | CLANG_WARN_EMPTY_BODY = YES; 350 | CLANG_WARN_ENUM_CONVERSION = YES; 351 | CLANG_WARN_INT_CONVERSION = YES; 352 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 353 | CLANG_WARN_UNREACHABLE_CODE = YES; 354 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 355 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 356 | COPY_PHASE_STRIP = NO; 357 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 358 | ENABLE_NS_ASSERTIONS = NO; 359 | ENABLE_STRICT_OBJC_MSGSEND = YES; 360 | GCC_C_LANGUAGE_STANDARD = gnu99; 361 | GCC_NO_COMMON_BLOCKS = YES; 362 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 363 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 364 | GCC_WARN_UNDECLARED_SELECTOR = YES; 365 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 366 | GCC_WARN_UNUSED_FUNCTION = YES; 367 | GCC_WARN_UNUSED_VARIABLE = YES; 368 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 369 | MTL_ENABLE_DEBUG_INFO = NO; 370 | SDKROOT = iphoneos; 371 | TARGETED_DEVICE_FAMILY = "1,2"; 372 | VALIDATE_PRODUCT = YES; 373 | }; 374 | name = Release; 375 | }; 376 | 9940D4921B1E24A100BA4312 /* Debug */ = { 377 | isa = XCBuildConfiguration; 378 | buildSettings = { 379 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 380 | INFOPLIST_FILE = ATDraggableDynamicView/Info.plist; 381 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 382 | PRODUCT_NAME = "$(TARGET_NAME)"; 383 | }; 384 | name = Debug; 385 | }; 386 | 9940D4931B1E24A100BA4312 /* Release */ = { 387 | isa = XCBuildConfiguration; 388 | buildSettings = { 389 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 390 | INFOPLIST_FILE = ATDraggableDynamicView/Info.plist; 391 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 392 | PRODUCT_NAME = "$(TARGET_NAME)"; 393 | }; 394 | name = Release; 395 | }; 396 | 9940D4951B1E24A100BA4312 /* Debug */ = { 397 | isa = XCBuildConfiguration; 398 | buildSettings = { 399 | BUNDLE_LOADER = "$(TEST_HOST)"; 400 | FRAMEWORK_SEARCH_PATHS = ( 401 | "$(SDKROOT)/Developer/Library/Frameworks", 402 | "$(inherited)", 403 | ); 404 | GCC_PREPROCESSOR_DEFINITIONS = ( 405 | "DEBUG=1", 406 | "$(inherited)", 407 | ); 408 | INFOPLIST_FILE = ATDraggableDynamicViewTests/Info.plist; 409 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 410 | PRODUCT_NAME = "$(TARGET_NAME)"; 411 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ATDraggableDynamicView.app/ATDraggableDynamicView"; 412 | }; 413 | name = Debug; 414 | }; 415 | 9940D4961B1E24A100BA4312 /* Release */ = { 416 | isa = XCBuildConfiguration; 417 | buildSettings = { 418 | BUNDLE_LOADER = "$(TEST_HOST)"; 419 | FRAMEWORK_SEARCH_PATHS = ( 420 | "$(SDKROOT)/Developer/Library/Frameworks", 421 | "$(inherited)", 422 | ); 423 | INFOPLIST_FILE = ATDraggableDynamicViewTests/Info.plist; 424 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 425 | PRODUCT_NAME = "$(TARGET_NAME)"; 426 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ATDraggableDynamicView.app/ATDraggableDynamicView"; 427 | }; 428 | name = Release; 429 | }; 430 | /* End XCBuildConfiguration section */ 431 | 432 | /* Begin XCConfigurationList section */ 433 | 9940D4691B1E24A100BA4312 /* Build configuration list for PBXProject "ATDraggableDynamicView" */ = { 434 | isa = XCConfigurationList; 435 | buildConfigurations = ( 436 | 9940D48F1B1E24A100BA4312 /* Debug */, 437 | 9940D4901B1E24A100BA4312 /* Release */, 438 | ); 439 | defaultConfigurationIsVisible = 0; 440 | defaultConfigurationName = Release; 441 | }; 442 | 9940D4911B1E24A100BA4312 /* Build configuration list for PBXNativeTarget "ATDraggableDynamicView" */ = { 443 | isa = XCConfigurationList; 444 | buildConfigurations = ( 445 | 9940D4921B1E24A100BA4312 /* Debug */, 446 | 9940D4931B1E24A100BA4312 /* Release */, 447 | ); 448 | defaultConfigurationIsVisible = 0; 449 | }; 450 | 9940D4941B1E24A100BA4312 /* Build configuration list for PBXNativeTarget "ATDraggableDynamicViewTests" */ = { 451 | isa = XCConfigurationList; 452 | buildConfigurations = ( 453 | 9940D4951B1E24A100BA4312 /* Debug */, 454 | 9940D4961B1E24A100BA4312 /* Release */, 455 | ); 456 | defaultConfigurationIsVisible = 0; 457 | }; 458 | /* End XCConfigurationList section */ 459 | }; 460 | rootObject = 9940D4661B1E24A100BA4312 /* Project object */; 461 | } 462 | -------------------------------------------------------------------------------- /ATDraggableDynamicView.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ATDraggableDynamicView/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // ATDraggableDynamicView 4 | // 5 | // Created by Alex Tkachenko on 6/2/15. 6 | // Copyright (c) 2015 Alex Tkachenko. 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 | -------------------------------------------------------------------------------- /ATDraggableDynamicView/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // ATDraggableDynamicView 4 | // 5 | // Created by Alex Tkachenko on 6/2/15. 6 | // Copyright (c) 2015 Alex Tkachenko. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // 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. 25 | // 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. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // 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. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // 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. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // 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. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /ATDraggableDynamicView/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /ATDraggableDynamicView/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /ATDraggableDynamicView/Classes/ATDraggableDynamicAnimator/ATDraggableDynamicAnimator.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Alex Tkachenko on 6/2/15. 3 | // Copyright (c) 2015 Alex Tkachenko. All rights reserved. 4 | // 5 | 6 | #import 7 | #import 8 | 9 | /** 10 | * Animator automatically removes view from superview when it's already behind the screen bounds 11 | */ 12 | @interface ATDraggableDynamicAnimator : NSObject 13 | 14 | @property (nonatomic, weak, readonly) UIView *view; 15 | 16 | @property (nonatomic, readonly) UIDynamicAnimator *animator; 17 | @property (nonatomic, weak, readonly) UIDynamicItemBehavior *dynamicItemBehavior; 18 | @property (nonatomic, weak, readonly) UIGestureRecognizer *panGesture; 19 | 20 | // View is strongly captured by internal UIKit animator object 21 | - (instancetype)initWithView:(UIView *)view; 22 | 23 | - (void)moveOutsideWithTheVelocity:(CGPoint)velocity; 24 | @end -------------------------------------------------------------------------------- /ATDraggableDynamicView/Classes/ATDraggableDynamicAnimator/ATDraggableDynamicAnimator.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Alex Tkachenko on 6/2/15. 3 | // Copyright (c) 2015 Alex Tkachenko. All rights reserved. 4 | // 5 | 6 | #import "ATDraggableDynamicAnimator.h" 7 | 8 | static const int kATATDraggableDynamicViewScalarVelocityToSnap = 300; 9 | 10 | @interface ATDraggableDynamicAnimator() 11 | 12 | @property(nonatomic, weak) UIView *view; 13 | @property(nonatomic, weak) UIGestureRecognizer *panGesture; 14 | 15 | @property (nonatomic, strong) UIDynamicAnimator *animator; 16 | @property (nonatomic, weak) UIDynamicItemBehavior *dynamicItemBehavior; 17 | @property (nonatomic, weak) UIAttachmentBehavior *attachment; 18 | @property (nonatomic, weak) UISnapBehavior *snapBehavior; 19 | 20 | @property (nonatomic) CGPoint startTouchCenter; 21 | 22 | @end 23 | 24 | 25 | @implementation ATDraggableDynamicAnimator 26 | 27 | #pragma mark - Init 28 | 29 | - (instancetype)initWithView:(UIView *)view { 30 | self = [super init]; 31 | if (self) { 32 | self.view = view; 33 | [self setupAnimators]; 34 | } 35 | return self; 36 | } 37 | 38 | 39 | #pragma mark - Setup 40 | 41 | - (void)setupAnimators { 42 | UIDynamicItemBehavior *behavior = [[UIDynamicItemBehavior alloc] initWithItems:@[self.view]]; 43 | behavior.angularResistance = 1.25f; 44 | typeof(self) __weak weakSelf = self; 45 | behavior.action = ^{ 46 | if (!CGRectIntersectsRect(weakSelf.view.superview.bounds, weakSelf.view.frame)) { 47 | //view is outside it's superview bounds 48 | [self cleanupUIKitDynamics]; 49 | } 50 | }; 51 | self.dynamicItemBehavior = behavior; 52 | 53 | UIPanGestureRecognizer *panGestureRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePan:)]; 54 | [self.view addGestureRecognizer:panGestureRecognizer]; 55 | self.panGesture = panGestureRecognizer; 56 | 57 | UIDynamicAnimator *animator = [[UIDynamicAnimator alloc] initWithReferenceView:self.view.superview]; 58 | [animator addBehavior:behavior]; 59 | self.animator = animator; 60 | } 61 | 62 | 63 | #pragma mark - Pan gesture 64 | 65 | - (void)handlePan:(UIPanGestureRecognizer *)gesture { 66 | // variables for calculating angular velocity 67 | static CFAbsoluteTime lastTime; 68 | static CGFloat lastAngle; 69 | static CGFloat angularVelocity; 70 | 71 | if (gesture.state == UIGestureRecognizerStateBegan) { 72 | if (self.snapBehavior) { 73 | [self.animator removeBehavior:self.snapBehavior]; 74 | } 75 | self.startTouchCenter = gesture.view.center; 76 | 77 | // calculate the center offset and anchor point 78 | CGPoint pointWithinAnimatedView = [gesture locationInView:gesture.view]; 79 | 80 | UIOffset offset = UIOffsetMake((CGFloat) (pointWithinAnimatedView.x - gesture.view.bounds.size.width / 2.0), 81 | (CGFloat) (pointWithinAnimatedView.y - gesture.view.bounds.size.height / 2.0)); 82 | 83 | CGPoint anchor = [gesture locationInView:gesture.view.superview]; 84 | 85 | UIAttachmentBehavior *attachment = [[UIAttachmentBehavior alloc] initWithItem:gesture.view 86 | offsetFromCenter:offset 87 | attachedToAnchor:anchor]; 88 | self.attachment = attachment; 89 | 90 | // code to calculate angular velocity (seems curious that I have to calculate this myself, but I can if I have to) 91 | 92 | lastTime = CFAbsoluteTimeGetCurrent(); 93 | lastAngle = [self angleOfView:gesture.view]; 94 | 95 | typeof(self) __weak weakSelf = self; 96 | 97 | self.attachment.action = ^{ 98 | CFAbsoluteTime time = CFAbsoluteTimeGetCurrent(); 99 | CGFloat angle = [weakSelf angleOfView:gesture.view]; 100 | if (time > lastTime) { 101 | angularVelocity = (CGFloat) ((angle - lastAngle) / (time - lastTime)); 102 | lastTime = time; 103 | lastAngle = angle; 104 | } 105 | }; 106 | 107 | [self.animator addBehavior:attachment]; 108 | } else if (gesture.state == UIGestureRecognizerStateChanged) { 109 | // as user makes gesture, update attachment behavior's anchor point, achieving drag 'n' rotate 110 | 111 | CGPoint anchor = [gesture locationInView:gesture.view.superview]; 112 | self.attachment.anchorPoint = anchor; 113 | } else if (gesture.state == UIGestureRecognizerStateEnded || (gesture.state == UIGestureRecognizerStateCancelled)) { 114 | [self.animator removeBehavior:self.attachment]; 115 | 116 | CGPoint velocity = [gesture velocityInView:gesture.view.superview]; 117 | 118 | float scalarVelocity = sqrtf((velocity.x * velocity.x) + 119 | (velocity.y * velocity.y)); 120 | // If scalarVelocity is not enough we just snap it back 121 | if (scalarVelocity < kATATDraggableDynamicViewScalarVelocityToSnap) { 122 | UISnapBehavior *behavior = [[UISnapBehavior alloc] initWithItem:gesture.view snapToPoint:self.startTouchCenter]; 123 | [self.animator addBehavior:behavior]; 124 | self.snapBehavior = behavior; 125 | return; 126 | } 127 | 128 | [self.dynamicItemBehavior addLinearVelocity:velocity forItem:gesture.view]; 129 | [self.dynamicItemBehavior addAngularVelocity:angularVelocity forItem:gesture.view]; 130 | } 131 | } 132 | 133 | 134 | - (void)moveOutsideWithTheVelocity:(CGPoint)velocity { 135 | [self.dynamicItemBehavior addLinearVelocity:velocity forItem:self.view]; 136 | } 137 | 138 | 139 | - (CGFloat)angleOfView:(UIView *)view { 140 | return (CGFloat) atan2(view.transform.b, view.transform.a); 141 | } 142 | 143 | 144 | #pragma mark - Cleanup 145 | 146 | - (void)cleanupUIKitDynamics { 147 | [self.animator removeAllBehaviors]; 148 | [self.view removeGestureRecognizer:self.panGesture]; 149 | [self.view removeFromSuperview]; 150 | self.animator = nil; 151 | } 152 | 153 | @end -------------------------------------------------------------------------------- /ATDraggableDynamicView/Classes/ATDraggableDynamicView.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Alex Tkachenko on 6/2/15. 3 | // Copyright (c) 2015 Alex Tkachenko. All rights reserved. 4 | // 5 | 6 | #import 7 | #import 8 | 9 | @class ATDraggableDynamicAnimator; 10 | 11 | @interface ATDraggableDynamicView : UIView 12 | 13 | @end -------------------------------------------------------------------------------- /ATDraggableDynamicView/Classes/ATDraggableDynamicView.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Alex Tkachenko on 6/2/15. 3 | // Copyright (c) 2015 Alex Tkachenko. All rights reserved. 4 | // 5 | 6 | #import "ATDraggableDynamicView.h" 7 | #import "ATDraggableDynamicAnimator.h" 8 | 9 | @interface ATDraggableDynamicView() 10 | @property(nonatomic, weak) ATDraggableDynamicAnimator *draggableAnimator; 11 | @end 12 | 13 | @implementation ATDraggableDynamicView 14 | 15 | - (void)willMoveToSuperview:(UIView *)newSuperview { 16 | [super willMoveToSuperview:newSuperview]; 17 | if (newSuperview) { 18 | //uikit dynamics animator should be set up in the next runloop when superview will be ready 19 | typeof(self) __weak weakSelf = self; 20 | dispatch_after(DISPATCH_TIME_NOW, dispatch_get_main_queue(), ^(void) { 21 | ATDraggableDynamicAnimator *animator = [[ATDraggableDynamicAnimator alloc] initWithView:weakSelf]; 22 | weakSelf.draggableAnimator = animator; 23 | }); 24 | } 25 | else { 26 | self.draggableAnimator = nil; 27 | } 28 | } 29 | 30 | 31 | @end -------------------------------------------------------------------------------- /ATDraggableDynamicView/Images.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 | } -------------------------------------------------------------------------------- /ATDraggableDynamicView/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | alex.$(PRODUCT_NAME:rfc1034identifier) 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 | -------------------------------------------------------------------------------- /ATDraggableDynamicView/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // ATDraggableDynamicView 4 | // 5 | // Created by Alex Tkachenko on 6/2/15. 6 | // Copyright (c) 2015 Alex Tkachenko. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /ATDraggableDynamicView/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // ATDraggableDynamicView 4 | // 5 | // Created by Alex Tkachenko on 6/2/15. 6 | // Copyright (c) 2015 Alex Tkachenko. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "ATDraggableDynamicView.h" 11 | 12 | @implementation ViewController 13 | 14 | #pragma mark - View Controller lifecycle 15 | 16 | - (void)viewDidLoad { 17 | [super viewDidLoad]; 18 | // Do any additional setup after loading the view, typically from a nib. 19 | } 20 | 21 | 22 | - (void)didReceiveMemoryWarning { 23 | [super didReceiveMemoryWarning]; 24 | // Dispose of any resources that can be recreated. 25 | } 26 | 27 | 28 | #pragma mark - Button callbacks 29 | 30 | - (IBAction)presentView:(id)sender { 31 | ATDraggableDynamicView *view = [[ATDraggableDynamicView alloc] initWithFrame:CGRectMake(0, 0, 300, 120)]; 32 | view.backgroundColor = [UIColor greenColor]; 33 | view.center = self.view.center; 34 | [self.view addSubview:view]; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /ATDraggableDynamicView/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // ATDraggableDynamicView 4 | // 5 | // Created by Alex Tkachenko on 6/2/15. 6 | // Copyright (c) 2015 Alex Tkachenko. 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 | -------------------------------------------------------------------------------- /ATDraggableDynamicViewTests/ATDraggableDynamicViewTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ATDraggableDynamicViewTests.m 3 | // ATDraggableDynamicViewTests 4 | // 5 | // Created by Alex Tkachenko on 6/2/15. 6 | // Copyright (c) 2015 Alex Tkachenko. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface ATDraggableDynamicViewTests : XCTestCase 13 | 14 | @end 15 | 16 | @implementation ATDraggableDynamicViewTests 17 | 18 | - (void)setUp { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown { 24 | // Put teardown code here. This method is called after the invocation of each test method in the class. 25 | [super tearDown]; 26 | } 27 | 28 | - (void)testExample { 29 | // This is an example of a functional test case. 30 | XCTAssert(YES, @"Pass"); 31 | } 32 | 33 | - (void)testPerformanceExample { 34 | // This is an example of a performance test case. 35 | [self measureBlock:^{ 36 | // Put the code you want to measure the time of here. 37 | }]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /ATDraggableDynamicViewTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | alex.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Draggable view for creating notification views that use UIKit dynamics for user interaction 2 | 3 | Demo 4 | ---- 5 | 6 | # ![Screenshot](https://github.com/tkach/ATDraggableDynamicView/blob/master/demo.gif) 7 | -------------------------------------------------------------------------------- /demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tkach/ATDraggableDynamicView/39ecd389d912e9d292524a58dd11ec656d5dd9de/demo.gif --------------------------------------------------------------------------------