├── .gitignore ├── LTBounceSheet.xcodeproj ├── project.pbxproj └── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ └── LTBounceSheet.xccheckout ├── LTBounceSheet ├── AppDelegate.h ├── AppDelegate.m ├── Base.lproj │ └── Main.storyboard ├── Images.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── LaunchImage.launchimage │ │ └── Contents.json ├── LTBounceSheet-Info.plist ├── LTBounceSheet-Prefix.pch ├── LTBounceSheet.h ├── LTBounceSheet.m ├── ViewController.h ├── ViewController.m ├── en.lproj │ └── InfoPlist.strings └── main.m ├── LTBounceSheetTests ├── LTBounceSheetTests-Info.plist ├── LTBounceSheetTests.m └── en.lproj │ └── InfoPlist.strings ├── README.md └── demo.gif /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.swp 3 | *~.nib 4 | 5 | build/ 6 | xcuserdata/ 7 | *.pbxuser 8 | *.perspective 9 | *.perspectivev3 10 | -------------------------------------------------------------------------------- /LTBounceSheet.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | FA864B6019B6D3220075E24F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA864B5F19B6D3220075E24F /* Foundation.framework */; }; 11 | FA864B6219B6D3220075E24F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA864B6119B6D3220075E24F /* CoreGraphics.framework */; }; 12 | FA864B6419B6D3220075E24F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA864B6319B6D3220075E24F /* UIKit.framework */; }; 13 | FA864B6A19B6D3220075E24F /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = FA864B6819B6D3220075E24F /* InfoPlist.strings */; }; 14 | FA864B6C19B6D3220075E24F /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = FA864B6B19B6D3220075E24F /* main.m */; }; 15 | FA864B7019B6D3220075E24F /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = FA864B6F19B6D3220075E24F /* AppDelegate.m */; }; 16 | FA864B7319B6D3220075E24F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FA864B7119B6D3220075E24F /* Main.storyboard */; }; 17 | FA864B7619B6D3220075E24F /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FA864B7519B6D3220075E24F /* ViewController.m */; }; 18 | FA864B7819B6D3220075E24F /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FA864B7719B6D3220075E24F /* Images.xcassets */; }; 19 | FA864B7F19B6D3230075E24F /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA864B7E19B6D3230075E24F /* XCTest.framework */; }; 20 | FA864B8019B6D3230075E24F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA864B5F19B6D3220075E24F /* Foundation.framework */; }; 21 | FA864B8119B6D3230075E24F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA864B6319B6D3220075E24F /* UIKit.framework */; }; 22 | FA864B8919B6D3230075E24F /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = FA864B8719B6D3230075E24F /* InfoPlist.strings */; }; 23 | FA864B8B19B6D3230075E24F /* LTBounceSheetTests.m in Sources */ = {isa = PBXBuildFile; fileRef = FA864B8A19B6D3230075E24F /* LTBounceSheetTests.m */; }; 24 | FA864B9619B6D33F0075E24F /* LTBounceSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = FA864B9519B6D33F0075E24F /* LTBounceSheet.m */; }; 25 | /* End PBXBuildFile section */ 26 | 27 | /* Begin PBXContainerItemProxy section */ 28 | FA864B8219B6D3230075E24F /* PBXContainerItemProxy */ = { 29 | isa = PBXContainerItemProxy; 30 | containerPortal = FA864B5419B6D3220075E24F /* Project object */; 31 | proxyType = 1; 32 | remoteGlobalIDString = FA864B5B19B6D3220075E24F; 33 | remoteInfo = LTBounceSheet; 34 | }; 35 | /* End PBXContainerItemProxy section */ 36 | 37 | /* Begin PBXFileReference section */ 38 | FA864B5C19B6D3220075E24F /* LTBounceSheet.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LTBounceSheet.app; sourceTree = BUILT_PRODUCTS_DIR; }; 39 | FA864B5F19B6D3220075E24F /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 40 | FA864B6119B6D3220075E24F /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 41 | FA864B6319B6D3220075E24F /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 42 | FA864B6719B6D3220075E24F /* LTBounceSheet-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "LTBounceSheet-Info.plist"; sourceTree = ""; }; 43 | FA864B6919B6D3220075E24F /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 44 | FA864B6B19B6D3220075E24F /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 45 | FA864B6D19B6D3220075E24F /* LTBounceSheet-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "LTBounceSheet-Prefix.pch"; sourceTree = ""; }; 46 | FA864B6E19B6D3220075E24F /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 47 | FA864B6F19B6D3220075E24F /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 48 | FA864B7219B6D3220075E24F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 49 | FA864B7419B6D3220075E24F /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 50 | FA864B7519B6D3220075E24F /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 51 | FA864B7719B6D3220075E24F /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 52 | FA864B7D19B6D3230075E24F /* LTBounceSheetTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LTBounceSheetTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 53 | FA864B7E19B6D3230075E24F /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 54 | FA864B8619B6D3230075E24F /* LTBounceSheetTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "LTBounceSheetTests-Info.plist"; sourceTree = ""; }; 55 | FA864B8819B6D3230075E24F /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 56 | FA864B8A19B6D3230075E24F /* LTBounceSheetTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LTBounceSheetTests.m; sourceTree = ""; }; 57 | FA864B9419B6D33F0075E24F /* LTBounceSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LTBounceSheet.h; sourceTree = ""; }; 58 | FA864B9519B6D33F0075E24F /* LTBounceSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LTBounceSheet.m; sourceTree = ""; }; 59 | /* End PBXFileReference section */ 60 | 61 | /* Begin PBXFrameworksBuildPhase section */ 62 | FA864B5919B6D3220075E24F /* Frameworks */ = { 63 | isa = PBXFrameworksBuildPhase; 64 | buildActionMask = 2147483647; 65 | files = ( 66 | FA864B6219B6D3220075E24F /* CoreGraphics.framework in Frameworks */, 67 | FA864B6419B6D3220075E24F /* UIKit.framework in Frameworks */, 68 | FA864B6019B6D3220075E24F /* Foundation.framework in Frameworks */, 69 | ); 70 | runOnlyForDeploymentPostprocessing = 0; 71 | }; 72 | FA864B7A19B6D3220075E24F /* Frameworks */ = { 73 | isa = PBXFrameworksBuildPhase; 74 | buildActionMask = 2147483647; 75 | files = ( 76 | FA864B7F19B6D3230075E24F /* XCTest.framework in Frameworks */, 77 | FA864B8119B6D3230075E24F /* UIKit.framework in Frameworks */, 78 | FA864B8019B6D3230075E24F /* Foundation.framework in Frameworks */, 79 | ); 80 | runOnlyForDeploymentPostprocessing = 0; 81 | }; 82 | /* End PBXFrameworksBuildPhase section */ 83 | 84 | /* Begin PBXGroup section */ 85 | FA864B5319B6D3220075E24F = { 86 | isa = PBXGroup; 87 | children = ( 88 | FA864B6519B6D3220075E24F /* LTBounceSheet */, 89 | FA864B8419B6D3230075E24F /* LTBounceSheetTests */, 90 | FA864B5E19B6D3220075E24F /* Frameworks */, 91 | FA864B5D19B6D3220075E24F /* Products */, 92 | ); 93 | sourceTree = ""; 94 | }; 95 | FA864B5D19B6D3220075E24F /* Products */ = { 96 | isa = PBXGroup; 97 | children = ( 98 | FA864B5C19B6D3220075E24F /* LTBounceSheet.app */, 99 | FA864B7D19B6D3230075E24F /* LTBounceSheetTests.xctest */, 100 | ); 101 | name = Products; 102 | sourceTree = ""; 103 | }; 104 | FA864B5E19B6D3220075E24F /* Frameworks */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | FA864B5F19B6D3220075E24F /* Foundation.framework */, 108 | FA864B6119B6D3220075E24F /* CoreGraphics.framework */, 109 | FA864B6319B6D3220075E24F /* UIKit.framework */, 110 | FA864B7E19B6D3230075E24F /* XCTest.framework */, 111 | ); 112 | name = Frameworks; 113 | sourceTree = ""; 114 | }; 115 | FA864B6519B6D3220075E24F /* LTBounceSheet */ = { 116 | isa = PBXGroup; 117 | children = ( 118 | FA864B9419B6D33F0075E24F /* LTBounceSheet.h */, 119 | FA864B9519B6D33F0075E24F /* LTBounceSheet.m */, 120 | FA864B6E19B6D3220075E24F /* AppDelegate.h */, 121 | FA864B6F19B6D3220075E24F /* AppDelegate.m */, 122 | FA864B7119B6D3220075E24F /* Main.storyboard */, 123 | FA864B7419B6D3220075E24F /* ViewController.h */, 124 | FA864B7519B6D3220075E24F /* ViewController.m */, 125 | FA864B7719B6D3220075E24F /* Images.xcassets */, 126 | FA864B6619B6D3220075E24F /* Supporting Files */, 127 | ); 128 | path = LTBounceSheet; 129 | sourceTree = ""; 130 | }; 131 | FA864B6619B6D3220075E24F /* Supporting Files */ = { 132 | isa = PBXGroup; 133 | children = ( 134 | FA864B6719B6D3220075E24F /* LTBounceSheet-Info.plist */, 135 | FA864B6819B6D3220075E24F /* InfoPlist.strings */, 136 | FA864B6B19B6D3220075E24F /* main.m */, 137 | FA864B6D19B6D3220075E24F /* LTBounceSheet-Prefix.pch */, 138 | ); 139 | name = "Supporting Files"; 140 | sourceTree = ""; 141 | }; 142 | FA864B8419B6D3230075E24F /* LTBounceSheetTests */ = { 143 | isa = PBXGroup; 144 | children = ( 145 | FA864B8A19B6D3230075E24F /* LTBounceSheetTests.m */, 146 | FA864B8519B6D3230075E24F /* Supporting Files */, 147 | ); 148 | path = LTBounceSheetTests; 149 | sourceTree = ""; 150 | }; 151 | FA864B8519B6D3230075E24F /* Supporting Files */ = { 152 | isa = PBXGroup; 153 | children = ( 154 | FA864B8619B6D3230075E24F /* LTBounceSheetTests-Info.plist */, 155 | FA864B8719B6D3230075E24F /* InfoPlist.strings */, 156 | ); 157 | name = "Supporting Files"; 158 | sourceTree = ""; 159 | }; 160 | /* End PBXGroup section */ 161 | 162 | /* Begin PBXNativeTarget section */ 163 | FA864B5B19B6D3220075E24F /* LTBounceSheet */ = { 164 | isa = PBXNativeTarget; 165 | buildConfigurationList = FA864B8E19B6D3230075E24F /* Build configuration list for PBXNativeTarget "LTBounceSheet" */; 166 | buildPhases = ( 167 | FA864B5819B6D3220075E24F /* Sources */, 168 | FA864B5919B6D3220075E24F /* Frameworks */, 169 | FA864B5A19B6D3220075E24F /* Resources */, 170 | ); 171 | buildRules = ( 172 | ); 173 | dependencies = ( 174 | ); 175 | name = LTBounceSheet; 176 | productName = LTBounceSheet; 177 | productReference = FA864B5C19B6D3220075E24F /* LTBounceSheet.app */; 178 | productType = "com.apple.product-type.application"; 179 | }; 180 | FA864B7C19B6D3220075E24F /* LTBounceSheetTests */ = { 181 | isa = PBXNativeTarget; 182 | buildConfigurationList = FA864B9119B6D3230075E24F /* Build configuration list for PBXNativeTarget "LTBounceSheetTests" */; 183 | buildPhases = ( 184 | FA864B7919B6D3220075E24F /* Sources */, 185 | FA864B7A19B6D3220075E24F /* Frameworks */, 186 | FA864B7B19B6D3220075E24F /* Resources */, 187 | ); 188 | buildRules = ( 189 | ); 190 | dependencies = ( 191 | FA864B8319B6D3230075E24F /* PBXTargetDependency */, 192 | ); 193 | name = LTBounceSheetTests; 194 | productName = LTBounceSheetTests; 195 | productReference = FA864B7D19B6D3230075E24F /* LTBounceSheetTests.xctest */; 196 | productType = "com.apple.product-type.bundle.unit-test"; 197 | }; 198 | /* End PBXNativeTarget section */ 199 | 200 | /* Begin PBXProject section */ 201 | FA864B5419B6D3220075E24F /* Project object */ = { 202 | isa = PBXProject; 203 | attributes = { 204 | LastUpgradeCheck = 0510; 205 | ORGANIZATIONNAME = ltebean; 206 | TargetAttributes = { 207 | FA864B7C19B6D3220075E24F = { 208 | TestTargetID = FA864B5B19B6D3220075E24F; 209 | }; 210 | }; 211 | }; 212 | buildConfigurationList = FA864B5719B6D3220075E24F /* Build configuration list for PBXProject "LTBounceSheet" */; 213 | compatibilityVersion = "Xcode 3.2"; 214 | developmentRegion = English; 215 | hasScannedForEncodings = 0; 216 | knownRegions = ( 217 | en, 218 | Base, 219 | ); 220 | mainGroup = FA864B5319B6D3220075E24F; 221 | productRefGroup = FA864B5D19B6D3220075E24F /* Products */; 222 | projectDirPath = ""; 223 | projectRoot = ""; 224 | targets = ( 225 | FA864B5B19B6D3220075E24F /* LTBounceSheet */, 226 | FA864B7C19B6D3220075E24F /* LTBounceSheetTests */, 227 | ); 228 | }; 229 | /* End PBXProject section */ 230 | 231 | /* Begin PBXResourcesBuildPhase section */ 232 | FA864B5A19B6D3220075E24F /* Resources */ = { 233 | isa = PBXResourcesBuildPhase; 234 | buildActionMask = 2147483647; 235 | files = ( 236 | FA864B7819B6D3220075E24F /* Images.xcassets in Resources */, 237 | FA864B6A19B6D3220075E24F /* InfoPlist.strings in Resources */, 238 | FA864B7319B6D3220075E24F /* Main.storyboard in Resources */, 239 | ); 240 | runOnlyForDeploymentPostprocessing = 0; 241 | }; 242 | FA864B7B19B6D3220075E24F /* Resources */ = { 243 | isa = PBXResourcesBuildPhase; 244 | buildActionMask = 2147483647; 245 | files = ( 246 | FA864B8919B6D3230075E24F /* InfoPlist.strings in Resources */, 247 | ); 248 | runOnlyForDeploymentPostprocessing = 0; 249 | }; 250 | /* End PBXResourcesBuildPhase section */ 251 | 252 | /* Begin PBXSourcesBuildPhase section */ 253 | FA864B5819B6D3220075E24F /* Sources */ = { 254 | isa = PBXSourcesBuildPhase; 255 | buildActionMask = 2147483647; 256 | files = ( 257 | FA864B7619B6D3220075E24F /* ViewController.m in Sources */, 258 | FA864B7019B6D3220075E24F /* AppDelegate.m in Sources */, 259 | FA864B6C19B6D3220075E24F /* main.m in Sources */, 260 | FA864B9619B6D33F0075E24F /* LTBounceSheet.m in Sources */, 261 | ); 262 | runOnlyForDeploymentPostprocessing = 0; 263 | }; 264 | FA864B7919B6D3220075E24F /* Sources */ = { 265 | isa = PBXSourcesBuildPhase; 266 | buildActionMask = 2147483647; 267 | files = ( 268 | FA864B8B19B6D3230075E24F /* LTBounceSheetTests.m in Sources */, 269 | ); 270 | runOnlyForDeploymentPostprocessing = 0; 271 | }; 272 | /* End PBXSourcesBuildPhase section */ 273 | 274 | /* Begin PBXTargetDependency section */ 275 | FA864B8319B6D3230075E24F /* PBXTargetDependency */ = { 276 | isa = PBXTargetDependency; 277 | target = FA864B5B19B6D3220075E24F /* LTBounceSheet */; 278 | targetProxy = FA864B8219B6D3230075E24F /* PBXContainerItemProxy */; 279 | }; 280 | /* End PBXTargetDependency section */ 281 | 282 | /* Begin PBXVariantGroup section */ 283 | FA864B6819B6D3220075E24F /* InfoPlist.strings */ = { 284 | isa = PBXVariantGroup; 285 | children = ( 286 | FA864B6919B6D3220075E24F /* en */, 287 | ); 288 | name = InfoPlist.strings; 289 | sourceTree = ""; 290 | }; 291 | FA864B7119B6D3220075E24F /* Main.storyboard */ = { 292 | isa = PBXVariantGroup; 293 | children = ( 294 | FA864B7219B6D3220075E24F /* Base */, 295 | ); 296 | name = Main.storyboard; 297 | sourceTree = ""; 298 | }; 299 | FA864B8719B6D3230075E24F /* InfoPlist.strings */ = { 300 | isa = PBXVariantGroup; 301 | children = ( 302 | FA864B8819B6D3230075E24F /* en */, 303 | ); 304 | name = InfoPlist.strings; 305 | sourceTree = ""; 306 | }; 307 | /* End PBXVariantGroup section */ 308 | 309 | /* Begin XCBuildConfiguration section */ 310 | FA864B8C19B6D3230075E24F /* Debug */ = { 311 | isa = XCBuildConfiguration; 312 | buildSettings = { 313 | ALWAYS_SEARCH_USER_PATHS = NO; 314 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 315 | CLANG_CXX_LIBRARY = "libc++"; 316 | CLANG_ENABLE_MODULES = YES; 317 | CLANG_ENABLE_OBJC_ARC = YES; 318 | CLANG_WARN_BOOL_CONVERSION = YES; 319 | CLANG_WARN_CONSTANT_CONVERSION = YES; 320 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 321 | CLANG_WARN_EMPTY_BODY = YES; 322 | CLANG_WARN_ENUM_CONVERSION = YES; 323 | CLANG_WARN_INT_CONVERSION = YES; 324 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 325 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 326 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 327 | COPY_PHASE_STRIP = NO; 328 | GCC_C_LANGUAGE_STANDARD = gnu99; 329 | GCC_DYNAMIC_NO_PIC = NO; 330 | GCC_OPTIMIZATION_LEVEL = 0; 331 | GCC_PREPROCESSOR_DEFINITIONS = ( 332 | "DEBUG=1", 333 | "$(inherited)", 334 | ); 335 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 336 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 337 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 338 | GCC_WARN_UNDECLARED_SELECTOR = YES; 339 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 340 | GCC_WARN_UNUSED_FUNCTION = YES; 341 | GCC_WARN_UNUSED_VARIABLE = YES; 342 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 343 | ONLY_ACTIVE_ARCH = YES; 344 | SDKROOT = iphoneos; 345 | }; 346 | name = Debug; 347 | }; 348 | FA864B8D19B6D3230075E24F /* Release */ = { 349 | isa = XCBuildConfiguration; 350 | buildSettings = { 351 | ALWAYS_SEARCH_USER_PATHS = NO; 352 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 353 | CLANG_CXX_LIBRARY = "libc++"; 354 | CLANG_ENABLE_MODULES = YES; 355 | CLANG_ENABLE_OBJC_ARC = YES; 356 | CLANG_WARN_BOOL_CONVERSION = YES; 357 | CLANG_WARN_CONSTANT_CONVERSION = YES; 358 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 359 | CLANG_WARN_EMPTY_BODY = YES; 360 | CLANG_WARN_ENUM_CONVERSION = YES; 361 | CLANG_WARN_INT_CONVERSION = YES; 362 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 363 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 364 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 365 | COPY_PHASE_STRIP = YES; 366 | ENABLE_NS_ASSERTIONS = NO; 367 | GCC_C_LANGUAGE_STANDARD = gnu99; 368 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 369 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 370 | GCC_WARN_UNDECLARED_SELECTOR = YES; 371 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 372 | GCC_WARN_UNUSED_FUNCTION = YES; 373 | GCC_WARN_UNUSED_VARIABLE = YES; 374 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 375 | SDKROOT = iphoneos; 376 | VALIDATE_PRODUCT = YES; 377 | }; 378 | name = Release; 379 | }; 380 | FA864B8F19B6D3230075E24F /* Debug */ = { 381 | isa = XCBuildConfiguration; 382 | buildSettings = { 383 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 384 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 385 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 386 | GCC_PREFIX_HEADER = "LTBounceSheet/LTBounceSheet-Prefix.pch"; 387 | INFOPLIST_FILE = "LTBounceSheet/LTBounceSheet-Info.plist"; 388 | PRODUCT_NAME = "$(TARGET_NAME)"; 389 | WRAPPER_EXTENSION = app; 390 | }; 391 | name = Debug; 392 | }; 393 | FA864B9019B6D3230075E24F /* Release */ = { 394 | isa = XCBuildConfiguration; 395 | buildSettings = { 396 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 397 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 398 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 399 | GCC_PREFIX_HEADER = "LTBounceSheet/LTBounceSheet-Prefix.pch"; 400 | INFOPLIST_FILE = "LTBounceSheet/LTBounceSheet-Info.plist"; 401 | PRODUCT_NAME = "$(TARGET_NAME)"; 402 | WRAPPER_EXTENSION = app; 403 | }; 404 | name = Release; 405 | }; 406 | FA864B9219B6D3230075E24F /* Debug */ = { 407 | isa = XCBuildConfiguration; 408 | buildSettings = { 409 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/LTBounceSheet.app/LTBounceSheet"; 410 | FRAMEWORK_SEARCH_PATHS = ( 411 | "$(SDKROOT)/Developer/Library/Frameworks", 412 | "$(inherited)", 413 | "$(DEVELOPER_FRAMEWORKS_DIR)", 414 | ); 415 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 416 | GCC_PREFIX_HEADER = "LTBounceSheet/LTBounceSheet-Prefix.pch"; 417 | GCC_PREPROCESSOR_DEFINITIONS = ( 418 | "DEBUG=1", 419 | "$(inherited)", 420 | ); 421 | INFOPLIST_FILE = "LTBounceSheetTests/LTBounceSheetTests-Info.plist"; 422 | PRODUCT_NAME = "$(TARGET_NAME)"; 423 | TEST_HOST = "$(BUNDLE_LOADER)"; 424 | WRAPPER_EXTENSION = xctest; 425 | }; 426 | name = Debug; 427 | }; 428 | FA864B9319B6D3230075E24F /* Release */ = { 429 | isa = XCBuildConfiguration; 430 | buildSettings = { 431 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/LTBounceSheet.app/LTBounceSheet"; 432 | FRAMEWORK_SEARCH_PATHS = ( 433 | "$(SDKROOT)/Developer/Library/Frameworks", 434 | "$(inherited)", 435 | "$(DEVELOPER_FRAMEWORKS_DIR)", 436 | ); 437 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 438 | GCC_PREFIX_HEADER = "LTBounceSheet/LTBounceSheet-Prefix.pch"; 439 | INFOPLIST_FILE = "LTBounceSheetTests/LTBounceSheetTests-Info.plist"; 440 | PRODUCT_NAME = "$(TARGET_NAME)"; 441 | TEST_HOST = "$(BUNDLE_LOADER)"; 442 | WRAPPER_EXTENSION = xctest; 443 | }; 444 | name = Release; 445 | }; 446 | /* End XCBuildConfiguration section */ 447 | 448 | /* Begin XCConfigurationList section */ 449 | FA864B5719B6D3220075E24F /* Build configuration list for PBXProject "LTBounceSheet" */ = { 450 | isa = XCConfigurationList; 451 | buildConfigurations = ( 452 | FA864B8C19B6D3230075E24F /* Debug */, 453 | FA864B8D19B6D3230075E24F /* Release */, 454 | ); 455 | defaultConfigurationIsVisible = 0; 456 | defaultConfigurationName = Release; 457 | }; 458 | FA864B8E19B6D3230075E24F /* Build configuration list for PBXNativeTarget "LTBounceSheet" */ = { 459 | isa = XCConfigurationList; 460 | buildConfigurations = ( 461 | FA864B8F19B6D3230075E24F /* Debug */, 462 | FA864B9019B6D3230075E24F /* Release */, 463 | ); 464 | defaultConfigurationIsVisible = 0; 465 | }; 466 | FA864B9119B6D3230075E24F /* Build configuration list for PBXNativeTarget "LTBounceSheetTests" */ = { 467 | isa = XCConfigurationList; 468 | buildConfigurations = ( 469 | FA864B9219B6D3230075E24F /* Debug */, 470 | FA864B9319B6D3230075E24F /* Release */, 471 | ); 472 | defaultConfigurationIsVisible = 0; 473 | }; 474 | /* End XCConfigurationList section */ 475 | }; 476 | rootObject = FA864B5419B6D3220075E24F /* Project object */; 477 | } 478 | -------------------------------------------------------------------------------- /LTBounceSheet.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /LTBounceSheet.xcodeproj/project.xcworkspace/xcshareddata/LTBounceSheet.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 34BBF0B6-C2CE-415E-A743-0EB1175A79BB 9 | IDESourceControlProjectName 10 | LTBounceSheet 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | E3C96D28-5735-4CDF-9AB2-D2F39C00FD75 14 | https://github.com/ltebean/LTBounceSheet.git 15 | 16 | IDESourceControlProjectPath 17 | LTBounceSheet.xcodeproj/project.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | E3C96D28-5735-4CDF-9AB2-D2F39C00FD75 21 | ../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/ltebean/LTBounceSheet.git 25 | IDESourceControlProjectVersion 26 | 110 27 | IDESourceControlProjectWCCIdentifier 28 | E3C96D28-5735-4CDF-9AB2-D2F39C00FD75 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | E3C96D28-5735-4CDF-9AB2-D2F39C00FD75 36 | IDESourceControlWCCName 37 | LTBounceSheet 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /LTBounceSheet/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // LTBounceSheet 4 | // 5 | // Created by ltebean on 14-9-3. 6 | // Copyright (c) 2014年 ltebean. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /LTBounceSheet/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // LTBounceSheet 4 | // 5 | // Created by ltebean on 14-9-3. 6 | // Copyright (c) 2014年 ltebean. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @implementation AppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | // Override point for customization after application launch. 16 | return YES; 17 | } 18 | 19 | - (void)applicationWillResignActive:(UIApplication *)application 20 | { 21 | // 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. 22 | // 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. 23 | } 24 | 25 | - (void)applicationDidEnterBackground:(UIApplication *)application 26 | { 27 | // 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. 28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 29 | } 30 | 31 | - (void)applicationWillEnterForeground:(UIApplication *)application 32 | { 33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | - (void)applicationDidBecomeActive:(UIApplication *)application 37 | { 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 | { 43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /LTBounceSheet/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /LTBounceSheet/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" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /LTBounceSheet/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /LTBounceSheet/LTBounceSheet-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | org.ltebean.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /LTBounceSheet/LTBounceSheet-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /LTBounceSheet/LTBounceSheet.h: -------------------------------------------------------------------------------- 1 | // 2 | // LTBounceSheet.h 3 | // LTBounceSheet 4 | // 5 | // Created by ltebean on 14-9-3. 6 | // Copyright (c) 2014年 ltebean. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LTBounceSheet : UIView 12 | - (id) initWithHeight:(CGFloat) height bgColor:(UIColor*) color; 13 | -(void) addView:(UIView*) view; 14 | -(void) show; 15 | -(void) hide; 16 | -(void) toggle; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /LTBounceSheet/LTBounceSheet.m: -------------------------------------------------------------------------------- 1 | // 2 | // TestView.m 3 | // ViewTest 4 | // 5 | // Created by ltebean on 14-9-1. 6 | // Copyright (c) 2014年 ltebean. All rights reserved. 7 | // 8 | 9 | #import "LTBounceSheet.h" 10 | 11 | #define duration 0.55 12 | 13 | #define sideViewDamping 0.87 14 | #define sideViewVelocity 10 15 | 16 | #define centerViewDamping 1.0 17 | #define centerViewVelocity 8 18 | 19 | @interface LTBounceSheet() 20 | @property(nonatomic,strong) UIView* sideHelperView; 21 | @property(nonatomic,strong) UIView* centerHelperView; 22 | @property(nonatomic,strong) CADisplayLink *displayLink; 23 | @property(nonatomic,strong) UIView *contentView; 24 | @property(nonatomic,strong) UIColor *bgColor; 25 | @property BOOL shown; 26 | @property int counter; 27 | @property CGFloat height; 28 | @end 29 | 30 | @implementation LTBounceSheet 31 | 32 | - (id) initWithHeight:(CGFloat) height bgColor:(UIColor*) color; 33 | { 34 | self.height=height; 35 | self.bgColor=color; 36 | CGRect screenRect = [[UIScreen mainScreen] bounds]; 37 | CGFloat screenWidth = CGRectGetWidth(screenRect); 38 | CGFloat screenHeight = CGRectGetHeight(screenRect); 39 | 40 | self=[super initWithFrame:CGRectMake(0, screenHeight-height, screenWidth, height)]; 41 | if(self){ 42 | 43 | self.counter = 0; 44 | 45 | self.contentView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, screenWidth, height)]; 46 | self.contentView.transform = CGAffineTransformMakeTranslation(0, self.height); 47 | [self addSubview:self.contentView]; 48 | 49 | self.sideHelperView = [[UIView alloc] initWithFrame:CGRectMake(0, height, 0, 0)]; 50 | self.sideHelperView.backgroundColor=[UIColor blackColor]; 51 | [self addSubview:self.sideHelperView]; 52 | 53 | 54 | self.centerHelperView = [[UIView alloc] initWithFrame:CGRectMake(screenWidth/2, height, 0, 0)]; 55 | self.centerHelperView.backgroundColor=[UIColor blackColor]; 56 | [self addSubview:self.centerHelperView]; 57 | 58 | self.backgroundColor=[UIColor clearColor]; 59 | 60 | } 61 | return self; 62 | } 63 | 64 | -(void) addView:(UIView *)view 65 | { 66 | [self.contentView addSubview:view]; 67 | } 68 | 69 | -(void) toggle 70 | { 71 | if(self.shown){ 72 | [self hide]; 73 | }else{ 74 | [self show]; 75 | } 76 | } 77 | 78 | 79 | 80 | -(void) show 81 | { 82 | if(self.counter!=0){ 83 | return; 84 | } 85 | [[[UIApplication sharedApplication] keyWindow] addSubview:self]; 86 | self.shown=YES; 87 | [self start]; 88 | [self animateSideHelperViewToPoint:CGPointMake(self.sideHelperView.center.x, 0)]; 89 | [self animateCenterHelperViewToPoint: CGPointMake(self.centerHelperView.center.x, 0)]; 90 | [self animateContentViewToHeight:0]; 91 | 92 | } 93 | 94 | -(void) hide 95 | { 96 | if(self.counter!=0){ 97 | return; 98 | } 99 | self.shown=NO; 100 | [self start]; 101 | CGFloat height = CGRectGetHeight(self.bounds); 102 | 103 | [self animateSideHelperViewToPoint:CGPointMake(self.sideHelperView.center.x, height)]; 104 | [self animateCenterHelperViewToPoint: CGPointMake(self.centerHelperView.center.x, height)]; 105 | [self animateContentViewToHeight:self.height]; 106 | 107 | } 108 | 109 | -(void) animateSideHelperViewToPoint:(CGPoint) point 110 | { 111 | 112 | [UIView animateWithDuration:duration delay:0 usingSpringWithDamping:sideViewDamping initialSpringVelocity:sideViewVelocity options:0 animations:^{ 113 | self.sideHelperView.center = point; 114 | } completion:^(BOOL finished) { 115 | [self complete]; 116 | 117 | }]; 118 | } 119 | 120 | 121 | -(void) animateCenterHelperViewToPoint:(CGPoint) point 122 | { 123 | 124 | [UIView animateWithDuration:duration delay:0 usingSpringWithDamping:centerViewDamping initialSpringVelocity:centerViewVelocity options:0 animations:^{ 125 | self.centerHelperView.center = point; 126 | 127 | } completion:^(BOOL finished) { 128 | [self complete]; 129 | }]; 130 | } 131 | 132 | -(void) animateContentViewToHeight:(CGFloat) height 133 | { 134 | [UIView animateWithDuration:duration delay:0 usingSpringWithDamping:centerViewDamping initialSpringVelocity:centerViewVelocity options:0 animations:^{ 135 | self.contentView.transform = CGAffineTransformMakeTranslation(0, height); 136 | } completion:^(BOOL finished) { 137 | }]; 138 | } 139 | 140 | 141 | 142 | 143 | -(void) tick:(CADisplayLink*) displayLink 144 | { 145 | //NSLog(@"%@", NSStringFromCGPoint(self.centerHelperView.center)); 146 | [self setNeedsDisplay]; 147 | } 148 | 149 | -(void) start 150 | { 151 | if (self.displayLink == nil) { 152 | self.displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(tick:)]; 153 | 154 | [self.displayLink addToRunLoop:[NSRunLoop currentRunLoop] 155 | forMode:NSDefaultRunLoopMode]; 156 | self.counter=2; 157 | } 158 | } 159 | 160 | -(void) complete 161 | { 162 | self.counter--; 163 | if(self.counter==0){ 164 | [self.displayLink invalidate]; 165 | self.displayLink = nil; 166 | if(!self.shown){ 167 | [self removeFromSuperview]; 168 | } 169 | } 170 | } 171 | - (void)drawRect:(CGRect)rect 172 | { 173 | if(self.counter==0){ 174 | return; 175 | } 176 | CALayer* sideLayer=self.sideHelperView.layer.presentationLayer; 177 | CGPoint sidePoint=sideLayer.frame.origin; 178 | 179 | CALayer* centerLayer =self.centerHelperView.layer.presentationLayer; 180 | CGPoint centerPoint=centerLayer.frame.origin; 181 | 182 | UIBezierPath* path = [UIBezierPath bezierPath]; 183 | 184 | [self.bgColor setFill]; 185 | 186 | [path moveToPoint:sidePoint]; 187 | [path addQuadCurveToPoint:CGPointMake(320, sidePoint.y) controlPoint:centerPoint]; 188 | [path addLineToPoint:CGPointMake(320, CGRectGetHeight(self.bounds))]; 189 | [path addLineToPoint:CGPointMake(0, CGRectGetHeight(self.bounds))]; 190 | [path closePath]; 191 | 192 | [path fill]; 193 | } 194 | 195 | 196 | @end 197 | -------------------------------------------------------------------------------- /LTBounceSheet/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // LTBounceSheet 4 | // 5 | // Created by ltebean on 14-9-3. 6 | // Copyright (c) 2014年 ltebean. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /LTBounceSheet/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // LTBounceSheet 4 | // 5 | // Created by ltebean on 14-9-3. 6 | // Copyright (c) 2014年 ltebean. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "LTBounceSheet.h" 11 | 12 | #define color [UIColor colorWithRed:0/255.0 green:175/255.0 blue:240/255.0 alpha:1] 13 | 14 | @interface ViewController () 15 | @property(nonatomic,strong) LTBounceSheet *sheet; 16 | @property(nonatomic) BOOL shown; 17 | @end 18 | 19 | @implementation ViewController 20 | 21 | - (void)viewDidLoad 22 | { 23 | [super viewDidLoad]; 24 | // Do any additional setup after loading the view, typically from a nib. 25 | } 26 | 27 | -(void) viewDidAppear:(BOOL)animated 28 | { 29 | [super viewDidAppear:YES]; 30 | 31 | self.sheet = [[LTBounceSheet alloc]initWithHeight:250 bgColor:color]; 32 | 33 | UIButton * option1 = [self produceButtonWithTitle:@"take photo"]; 34 | option1.frame=CGRectMake(15, 30, 290, 46); 35 | [self.sheet addView:option1]; 36 | 37 | UIButton * option2 = [self produceButtonWithTitle:@"choose existing photo"]; 38 | option2.frame=CGRectMake(15, 90, 290, 46); 39 | [self.sheet addView:option2]; 40 | 41 | UIButton * cancel = [self produceButtonWithTitle:@"cancel"]; 42 | cancel.frame=CGRectMake(15, 170, 290, 46); 43 | [self.sheet addView:cancel]; 44 | 45 | [[[UIApplication sharedApplication] keyWindow] addSubview:self.sheet]; 46 | } 47 | 48 | 49 | -(UIButton *) produceButtonWithTitle:(NSString*) title 50 | { 51 | UIButton * button =[UIButton buttonWithType:UIButtonTypeCustom]; 52 | button.backgroundColor= [UIColor whiteColor]; 53 | button.layer.cornerRadius=23; 54 | button.titleLabel.textAlignment = NSTextAlignmentCenter; 55 | button.titleLabel.font = [UIFont fontWithName:@"Helvetica Neue" size:16]; 56 | [button setTitle:title forState:UIControlStateNormal]; 57 | [button setTitleColor:color forState:UIControlStateNormal]; 58 | return button; 59 | } 60 | 61 | 62 | - (IBAction)toggle:(id)sender { 63 | [self.sheet toggle]; 64 | } 65 | 66 | 67 | @end 68 | -------------------------------------------------------------------------------- /LTBounceSheet/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /LTBounceSheet/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // LTBounceSheet 4 | // 5 | // Created by ltebean on 14-9-3. 6 | // Copyright (c) 2014年 ltebean. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /LTBounceSheetTests/LTBounceSheetTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.ltebean.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /LTBounceSheetTests/LTBounceSheetTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // LTBounceSheetTests.m 3 | // LTBounceSheetTests 4 | // 5 | // Created by ltebean on 14-9-3. 6 | // Copyright (c) 2014年 ltebean. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LTBounceSheetTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation LTBounceSheetTests 16 | 17 | - (void)setUp 18 | { 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 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /LTBounceSheetTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ![LTBounceSheet](https://raw.githubusercontent.com/ltebean/LTBounceSheet/master/demo.gif) 2 | 3 | ## Usage 4 | ```objective-c 5 | 6 | // construct the action sheet 7 | self.sheet = [[LTBounceSheet alloc]initWithHeight:250 bgColor:color]; 8 | 9 | UIButton * option1 = [self produceButtonWithTitle:@"take photo"]; 10 | option1.frame=CGRectMake(15, 30, 290, 46); 11 | [self.sheet addView:option1]; 12 | 13 | UIButton * option2 = [self produceButtonWithTitle:@"choose existing photo"]; 14 | option2.frame=CGRectMake(15, 90, 290, 46); 15 | [self.sheet addView:option2]; 16 | 17 | UIButton * cancel = [self produceButtonWithTitle:@"cancel"]; 18 | cancel.frame=CGRectMake(15, 170, 290, 46); 19 | [self.sheet addView:cancel]; 20 | 21 | 22 | //toggle the sheet 23 | [self.sheet toggle]; 24 | 25 | ``` -------------------------------------------------------------------------------- /demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ltebean/LTBounceSheet/6090ea33686dfebb2937ee0d110f90e378f52729/demo.gif --------------------------------------------------------------------------------