├── README.md ├── alert.gif └── expendAlertViewDemo ├── expendAlertViewDemo.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── expendAlertViewDemo.xccheckout │ └── xcuserdata │ │ ├── broydenty.xcuserdatad │ │ └── UserInterfaceState.xcuserstate │ │ └── denty.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ ├── broydenty.xcuserdatad │ └── xcschemes │ │ ├── expendAlertViewDemo.xcscheme │ │ └── xcschememanagement.plist │ └── denty.xcuserdatad │ └── xcschemes │ ├── expendAlertViewDemo.xcscheme │ └── xcschememanagement.plist ├── expendAlertViewDemo ├── AppDelegate.h ├── AppDelegate.m ├── ExpandAlertView │ ├── AlartViewController.h │ ├── AlartViewController.m │ └── AlartViewController.xib ├── Images.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── ViewController.h ├── ViewController.m ├── en.lproj │ └── InfoPlist.strings ├── expendAlertViewDemo-Info.plist ├── expendAlertViewDemo-Prefix.pch ├── main.m └── openScreen.xib └── expendAlertViewDemoTests ├── en.lproj └── InfoPlist.strings ├── expendAlertViewDemoTests-Info.plist └── expendAlertViewDemoTests.m /README.md: -------------------------------------------------------------------------------- 1 | ExpandAlertView 2 | =============== 3 | expandAlertView 4 | If you think that useful plz star it!! 5 | 6 | ![image](https://github.com/denty/ExpandAlertView/blob/master/alert.gif) 7 | -------------------------------------------------------------------------------- /alert.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denty/ExpandAlertView/d08c9a926ffd599845b1728172f2ae572fd54abb/alert.gif -------------------------------------------------------------------------------- /expendAlertViewDemo/expendAlertViewDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | BF6AFBF71A81ECF2008858CA /* openScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = BF6AFBF61A81ECF2008858CA /* openScreen.xib */; }; 11 | ECA3E6C1198F6FC10029EF9E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ECA3E6C0198F6FC10029EF9E /* Foundation.framework */; }; 12 | ECA3E6C3198F6FC10029EF9E /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ECA3E6C2198F6FC10029EF9E /* CoreGraphics.framework */; }; 13 | ECA3E6C5198F6FC10029EF9E /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ECA3E6C4198F6FC10029EF9E /* UIKit.framework */; }; 14 | ECA3E6CB198F6FC10029EF9E /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = ECA3E6C9198F6FC10029EF9E /* InfoPlist.strings */; }; 15 | ECA3E6CD198F6FC10029EF9E /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = ECA3E6CC198F6FC10029EF9E /* main.m */; }; 16 | ECA3E6D1198F6FC10029EF9E /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = ECA3E6D0198F6FC10029EF9E /* AppDelegate.m */; }; 17 | ECA3E6D7198F6FC10029EF9E /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = ECA3E6D6198F6FC10029EF9E /* ViewController.m */; }; 18 | ECA3E6D9198F6FC10029EF9E /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = ECA3E6D8198F6FC10029EF9E /* Images.xcassets */; }; 19 | ECA3E6E0198F6FC10029EF9E /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ECA3E6DF198F6FC10029EF9E /* XCTest.framework */; }; 20 | ECA3E6E1198F6FC10029EF9E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ECA3E6C0198F6FC10029EF9E /* Foundation.framework */; }; 21 | ECA3E6E2198F6FC10029EF9E /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ECA3E6C4198F6FC10029EF9E /* UIKit.framework */; }; 22 | ECA3E6EA198F6FC10029EF9E /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = ECA3E6E8198F6FC10029EF9E /* InfoPlist.strings */; }; 23 | ECA3E6EC198F6FC10029EF9E /* expendAlertViewDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = ECA3E6EB198F6FC10029EF9E /* expendAlertViewDemoTests.m */; }; 24 | ECA3E6F9198F711C0029EF9E /* AlartViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = ECA3E6F7198F711C0029EF9E /* AlartViewController.m */; }; 25 | ECA3E6FA198F711C0029EF9E /* AlartViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = ECA3E6F8198F711C0029EF9E /* AlartViewController.xib */; }; 26 | /* End PBXBuildFile section */ 27 | 28 | /* Begin PBXContainerItemProxy section */ 29 | ECA3E6E3198F6FC10029EF9E /* PBXContainerItemProxy */ = { 30 | isa = PBXContainerItemProxy; 31 | containerPortal = ECA3E6B5198F6FC10029EF9E /* Project object */; 32 | proxyType = 1; 33 | remoteGlobalIDString = ECA3E6BC198F6FC10029EF9E; 34 | remoteInfo = expendAlertViewDemo; 35 | }; 36 | /* End PBXContainerItemProxy section */ 37 | 38 | /* Begin PBXFileReference section */ 39 | BF6AFBF61A81ECF2008858CA /* openScreen.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = openScreen.xib; sourceTree = ""; }; 40 | ECA3E6BD198F6FC10029EF9E /* expendAlertViewDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = expendAlertViewDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | ECA3E6C0198F6FC10029EF9E /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 42 | ECA3E6C2198F6FC10029EF9E /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 43 | ECA3E6C4198F6FC10029EF9E /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 44 | ECA3E6C8198F6FC10029EF9E /* expendAlertViewDemo-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "expendAlertViewDemo-Info.plist"; sourceTree = ""; }; 45 | ECA3E6CA198F6FC10029EF9E /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 46 | ECA3E6CC198F6FC10029EF9E /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 47 | ECA3E6CE198F6FC10029EF9E /* expendAlertViewDemo-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "expendAlertViewDemo-Prefix.pch"; sourceTree = ""; }; 48 | ECA3E6CF198F6FC10029EF9E /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 49 | ECA3E6D0198F6FC10029EF9E /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 50 | ECA3E6D5198F6FC10029EF9E /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 51 | ECA3E6D6198F6FC10029EF9E /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 52 | ECA3E6D8198F6FC10029EF9E /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 53 | ECA3E6DE198F6FC10029EF9E /* expendAlertViewDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = expendAlertViewDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 54 | ECA3E6DF198F6FC10029EF9E /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 55 | ECA3E6E7198F6FC10029EF9E /* expendAlertViewDemoTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "expendAlertViewDemoTests-Info.plist"; sourceTree = ""; }; 56 | ECA3E6E9198F6FC10029EF9E /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 57 | ECA3E6EB198F6FC10029EF9E /* expendAlertViewDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = expendAlertViewDemoTests.m; sourceTree = ""; }; 58 | ECA3E6F6198F711C0029EF9E /* AlartViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AlartViewController.h; sourceTree = ""; }; 59 | ECA3E6F7198F711C0029EF9E /* AlartViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AlartViewController.m; sourceTree = ""; }; 60 | ECA3E6F8198F711C0029EF9E /* AlartViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = AlartViewController.xib; sourceTree = ""; }; 61 | /* End PBXFileReference section */ 62 | 63 | /* Begin PBXFrameworksBuildPhase section */ 64 | ECA3E6BA198F6FC10029EF9E /* Frameworks */ = { 65 | isa = PBXFrameworksBuildPhase; 66 | buildActionMask = 2147483647; 67 | files = ( 68 | ECA3E6C3198F6FC10029EF9E /* CoreGraphics.framework in Frameworks */, 69 | ECA3E6C5198F6FC10029EF9E /* UIKit.framework in Frameworks */, 70 | ECA3E6C1198F6FC10029EF9E /* Foundation.framework in Frameworks */, 71 | ); 72 | runOnlyForDeploymentPostprocessing = 0; 73 | }; 74 | ECA3E6DB198F6FC10029EF9E /* Frameworks */ = { 75 | isa = PBXFrameworksBuildPhase; 76 | buildActionMask = 2147483647; 77 | files = ( 78 | ECA3E6E0198F6FC10029EF9E /* XCTest.framework in Frameworks */, 79 | ECA3E6E2198F6FC10029EF9E /* UIKit.framework in Frameworks */, 80 | ECA3E6E1198F6FC10029EF9E /* Foundation.framework in Frameworks */, 81 | ); 82 | runOnlyForDeploymentPostprocessing = 0; 83 | }; 84 | /* End PBXFrameworksBuildPhase section */ 85 | 86 | /* Begin PBXGroup section */ 87 | ECA3E6B4198F6FC10029EF9E = { 88 | isa = PBXGroup; 89 | children = ( 90 | ECA3E6C6198F6FC10029EF9E /* expendAlertViewDemo */, 91 | ECA3E6E5198F6FC10029EF9E /* expendAlertViewDemoTests */, 92 | ECA3E6BF198F6FC10029EF9E /* Frameworks */, 93 | ECA3E6BE198F6FC10029EF9E /* Products */, 94 | ); 95 | sourceTree = ""; 96 | }; 97 | ECA3E6BE198F6FC10029EF9E /* Products */ = { 98 | isa = PBXGroup; 99 | children = ( 100 | ECA3E6BD198F6FC10029EF9E /* expendAlertViewDemo.app */, 101 | ECA3E6DE198F6FC10029EF9E /* expendAlertViewDemoTests.xctest */, 102 | ); 103 | name = Products; 104 | sourceTree = ""; 105 | }; 106 | ECA3E6BF198F6FC10029EF9E /* Frameworks */ = { 107 | isa = PBXGroup; 108 | children = ( 109 | ECA3E6C0198F6FC10029EF9E /* Foundation.framework */, 110 | ECA3E6C2198F6FC10029EF9E /* CoreGraphics.framework */, 111 | ECA3E6C4198F6FC10029EF9E /* UIKit.framework */, 112 | ECA3E6DF198F6FC10029EF9E /* XCTest.framework */, 113 | ); 114 | name = Frameworks; 115 | sourceTree = ""; 116 | }; 117 | ECA3E6C6198F6FC10029EF9E /* expendAlertViewDemo */ = { 118 | isa = PBXGroup; 119 | children = ( 120 | ECA3E6CF198F6FC10029EF9E /* AppDelegate.h */, 121 | ECA3E6D0198F6FC10029EF9E /* AppDelegate.m */, 122 | ECA3E6D5198F6FC10029EF9E /* ViewController.h */, 123 | BF6AFBF61A81ECF2008858CA /* openScreen.xib */, 124 | ECA3E6D6198F6FC10029EF9E /* ViewController.m */, 125 | ECA3E6F5198F711C0029EF9E /* ExpandAlertView */, 126 | ECA3E6D8198F6FC10029EF9E /* Images.xcassets */, 127 | ECA3E6C7198F6FC10029EF9E /* Supporting Files */, 128 | ); 129 | path = expendAlertViewDemo; 130 | sourceTree = ""; 131 | }; 132 | ECA3E6C7198F6FC10029EF9E /* Supporting Files */ = { 133 | isa = PBXGroup; 134 | children = ( 135 | ECA3E6C8198F6FC10029EF9E /* expendAlertViewDemo-Info.plist */, 136 | ECA3E6C9198F6FC10029EF9E /* InfoPlist.strings */, 137 | ECA3E6CC198F6FC10029EF9E /* main.m */, 138 | ECA3E6CE198F6FC10029EF9E /* expendAlertViewDemo-Prefix.pch */, 139 | ); 140 | name = "Supporting Files"; 141 | sourceTree = ""; 142 | }; 143 | ECA3E6E5198F6FC10029EF9E /* expendAlertViewDemoTests */ = { 144 | isa = PBXGroup; 145 | children = ( 146 | ECA3E6EB198F6FC10029EF9E /* expendAlertViewDemoTests.m */, 147 | ECA3E6E6198F6FC10029EF9E /* Supporting Files */, 148 | ); 149 | path = expendAlertViewDemoTests; 150 | sourceTree = ""; 151 | }; 152 | ECA3E6E6198F6FC10029EF9E /* Supporting Files */ = { 153 | isa = PBXGroup; 154 | children = ( 155 | ECA3E6E7198F6FC10029EF9E /* expendAlertViewDemoTests-Info.plist */, 156 | ECA3E6E8198F6FC10029EF9E /* InfoPlist.strings */, 157 | ); 158 | name = "Supporting Files"; 159 | sourceTree = ""; 160 | }; 161 | ECA3E6F5198F711C0029EF9E /* ExpandAlertView */ = { 162 | isa = PBXGroup; 163 | children = ( 164 | ECA3E6F6198F711C0029EF9E /* AlartViewController.h */, 165 | ECA3E6F7198F711C0029EF9E /* AlartViewController.m */, 166 | ECA3E6F8198F711C0029EF9E /* AlartViewController.xib */, 167 | ); 168 | path = ExpandAlertView; 169 | sourceTree = ""; 170 | }; 171 | /* End PBXGroup section */ 172 | 173 | /* Begin PBXNativeTarget section */ 174 | ECA3E6BC198F6FC10029EF9E /* expendAlertViewDemo */ = { 175 | isa = PBXNativeTarget; 176 | buildConfigurationList = ECA3E6EF198F6FC20029EF9E /* Build configuration list for PBXNativeTarget "expendAlertViewDemo" */; 177 | buildPhases = ( 178 | ECA3E6B9198F6FC10029EF9E /* Sources */, 179 | ECA3E6BA198F6FC10029EF9E /* Frameworks */, 180 | ECA3E6BB198F6FC10029EF9E /* Resources */, 181 | ); 182 | buildRules = ( 183 | ); 184 | dependencies = ( 185 | ); 186 | name = expendAlertViewDemo; 187 | productName = expendAlertViewDemo; 188 | productReference = ECA3E6BD198F6FC10029EF9E /* expendAlertViewDemo.app */; 189 | productType = "com.apple.product-type.application"; 190 | }; 191 | ECA3E6DD198F6FC10029EF9E /* expendAlertViewDemoTests */ = { 192 | isa = PBXNativeTarget; 193 | buildConfigurationList = ECA3E6F2198F6FC20029EF9E /* Build configuration list for PBXNativeTarget "expendAlertViewDemoTests" */; 194 | buildPhases = ( 195 | ECA3E6DA198F6FC10029EF9E /* Sources */, 196 | ECA3E6DB198F6FC10029EF9E /* Frameworks */, 197 | ECA3E6DC198F6FC10029EF9E /* Resources */, 198 | ); 199 | buildRules = ( 200 | ); 201 | dependencies = ( 202 | ECA3E6E4198F6FC10029EF9E /* PBXTargetDependency */, 203 | ); 204 | name = expendAlertViewDemoTests; 205 | productName = expendAlertViewDemoTests; 206 | productReference = ECA3E6DE198F6FC10029EF9E /* expendAlertViewDemoTests.xctest */; 207 | productType = "com.apple.product-type.bundle.unit-test"; 208 | }; 209 | /* End PBXNativeTarget section */ 210 | 211 | /* Begin PBXProject section */ 212 | ECA3E6B5198F6FC10029EF9E /* Project object */ = { 213 | isa = PBXProject; 214 | attributes = { 215 | LastUpgradeCheck = 0510; 216 | ORGANIZATIONNAME = denty; 217 | TargetAttributes = { 218 | ECA3E6DD198F6FC10029EF9E = { 219 | TestTargetID = ECA3E6BC198F6FC10029EF9E; 220 | }; 221 | }; 222 | }; 223 | buildConfigurationList = ECA3E6B8198F6FC10029EF9E /* Build configuration list for PBXProject "expendAlertViewDemo" */; 224 | compatibilityVersion = "Xcode 3.2"; 225 | developmentRegion = English; 226 | hasScannedForEncodings = 0; 227 | knownRegions = ( 228 | en, 229 | Base, 230 | ); 231 | mainGroup = ECA3E6B4198F6FC10029EF9E; 232 | productRefGroup = ECA3E6BE198F6FC10029EF9E /* Products */; 233 | projectDirPath = ""; 234 | projectRoot = ""; 235 | targets = ( 236 | ECA3E6BC198F6FC10029EF9E /* expendAlertViewDemo */, 237 | ECA3E6DD198F6FC10029EF9E /* expendAlertViewDemoTests */, 238 | ); 239 | }; 240 | /* End PBXProject section */ 241 | 242 | /* Begin PBXResourcesBuildPhase section */ 243 | ECA3E6BB198F6FC10029EF9E /* Resources */ = { 244 | isa = PBXResourcesBuildPhase; 245 | buildActionMask = 2147483647; 246 | files = ( 247 | ECA3E6D9198F6FC10029EF9E /* Images.xcassets in Resources */, 248 | BF6AFBF71A81ECF2008858CA /* openScreen.xib in Resources */, 249 | ECA3E6CB198F6FC10029EF9E /* InfoPlist.strings in Resources */, 250 | ECA3E6FA198F711C0029EF9E /* AlartViewController.xib in Resources */, 251 | ); 252 | runOnlyForDeploymentPostprocessing = 0; 253 | }; 254 | ECA3E6DC198F6FC10029EF9E /* Resources */ = { 255 | isa = PBXResourcesBuildPhase; 256 | buildActionMask = 2147483647; 257 | files = ( 258 | ECA3E6EA198F6FC10029EF9E /* InfoPlist.strings in Resources */, 259 | ); 260 | runOnlyForDeploymentPostprocessing = 0; 261 | }; 262 | /* End PBXResourcesBuildPhase section */ 263 | 264 | /* Begin PBXSourcesBuildPhase section */ 265 | ECA3E6B9198F6FC10029EF9E /* Sources */ = { 266 | isa = PBXSourcesBuildPhase; 267 | buildActionMask = 2147483647; 268 | files = ( 269 | ECA3E6D7198F6FC10029EF9E /* ViewController.m in Sources */, 270 | ECA3E6D1198F6FC10029EF9E /* AppDelegate.m in Sources */, 271 | ECA3E6CD198F6FC10029EF9E /* main.m in Sources */, 272 | ECA3E6F9198F711C0029EF9E /* AlartViewController.m in Sources */, 273 | ); 274 | runOnlyForDeploymentPostprocessing = 0; 275 | }; 276 | ECA3E6DA198F6FC10029EF9E /* Sources */ = { 277 | isa = PBXSourcesBuildPhase; 278 | buildActionMask = 2147483647; 279 | files = ( 280 | ECA3E6EC198F6FC10029EF9E /* expendAlertViewDemoTests.m in Sources */, 281 | ); 282 | runOnlyForDeploymentPostprocessing = 0; 283 | }; 284 | /* End PBXSourcesBuildPhase section */ 285 | 286 | /* Begin PBXTargetDependency section */ 287 | ECA3E6E4198F6FC10029EF9E /* PBXTargetDependency */ = { 288 | isa = PBXTargetDependency; 289 | target = ECA3E6BC198F6FC10029EF9E /* expendAlertViewDemo */; 290 | targetProxy = ECA3E6E3198F6FC10029EF9E /* PBXContainerItemProxy */; 291 | }; 292 | /* End PBXTargetDependency section */ 293 | 294 | /* Begin PBXVariantGroup section */ 295 | ECA3E6C9198F6FC10029EF9E /* InfoPlist.strings */ = { 296 | isa = PBXVariantGroup; 297 | children = ( 298 | ECA3E6CA198F6FC10029EF9E /* en */, 299 | ); 300 | name = InfoPlist.strings; 301 | sourceTree = ""; 302 | }; 303 | ECA3E6E8198F6FC10029EF9E /* InfoPlist.strings */ = { 304 | isa = PBXVariantGroup; 305 | children = ( 306 | ECA3E6E9198F6FC10029EF9E /* en */, 307 | ); 308 | name = InfoPlist.strings; 309 | sourceTree = ""; 310 | }; 311 | /* End PBXVariantGroup section */ 312 | 313 | /* Begin XCBuildConfiguration section */ 314 | ECA3E6ED198F6FC20029EF9E /* Debug */ = { 315 | isa = XCBuildConfiguration; 316 | buildSettings = { 317 | ALWAYS_SEARCH_USER_PATHS = NO; 318 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 319 | CLANG_CXX_LIBRARY = "libc++"; 320 | CLANG_ENABLE_MODULES = YES; 321 | CLANG_ENABLE_OBJC_ARC = YES; 322 | CLANG_WARN_BOOL_CONVERSION = YES; 323 | CLANG_WARN_CONSTANT_CONVERSION = YES; 324 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 325 | CLANG_WARN_EMPTY_BODY = YES; 326 | CLANG_WARN_ENUM_CONVERSION = YES; 327 | CLANG_WARN_INT_CONVERSION = YES; 328 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 329 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 330 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 331 | COPY_PHASE_STRIP = NO; 332 | GCC_C_LANGUAGE_STANDARD = gnu99; 333 | GCC_DYNAMIC_NO_PIC = NO; 334 | GCC_OPTIMIZATION_LEVEL = 0; 335 | GCC_PREPROCESSOR_DEFINITIONS = ( 336 | "DEBUG=1", 337 | "$(inherited)", 338 | ); 339 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 340 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 341 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 342 | GCC_WARN_UNDECLARED_SELECTOR = YES; 343 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 344 | GCC_WARN_UNUSED_FUNCTION = YES; 345 | GCC_WARN_UNUSED_VARIABLE = YES; 346 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 347 | ONLY_ACTIVE_ARCH = YES; 348 | SDKROOT = iphoneos; 349 | }; 350 | name = Debug; 351 | }; 352 | ECA3E6EE198F6FC20029EF9E /* Release */ = { 353 | isa = XCBuildConfiguration; 354 | buildSettings = { 355 | ALWAYS_SEARCH_USER_PATHS = NO; 356 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 357 | CLANG_CXX_LIBRARY = "libc++"; 358 | CLANG_ENABLE_MODULES = YES; 359 | CLANG_ENABLE_OBJC_ARC = YES; 360 | CLANG_WARN_BOOL_CONVERSION = YES; 361 | CLANG_WARN_CONSTANT_CONVERSION = YES; 362 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 363 | CLANG_WARN_EMPTY_BODY = YES; 364 | CLANG_WARN_ENUM_CONVERSION = YES; 365 | CLANG_WARN_INT_CONVERSION = YES; 366 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 367 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 368 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 369 | COPY_PHASE_STRIP = YES; 370 | ENABLE_NS_ASSERTIONS = NO; 371 | GCC_C_LANGUAGE_STANDARD = gnu99; 372 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 373 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 374 | GCC_WARN_UNDECLARED_SELECTOR = YES; 375 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 376 | GCC_WARN_UNUSED_FUNCTION = YES; 377 | GCC_WARN_UNUSED_VARIABLE = YES; 378 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 379 | SDKROOT = iphoneos; 380 | VALIDATE_PRODUCT = YES; 381 | }; 382 | name = Release; 383 | }; 384 | ECA3E6F0198F6FC20029EF9E /* Debug */ = { 385 | isa = XCBuildConfiguration; 386 | buildSettings = { 387 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 388 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 389 | GCC_PREFIX_HEADER = "expendAlertViewDemo/expendAlertViewDemo-Prefix.pch"; 390 | INFOPLIST_FILE = "expendAlertViewDemo/expendAlertViewDemo-Info.plist"; 391 | IPHONEOS_DEPLOYMENT_TARGET = 8.1; 392 | PRODUCT_NAME = "$(TARGET_NAME)"; 393 | WRAPPER_EXTENSION = app; 394 | }; 395 | name = Debug; 396 | }; 397 | ECA3E6F1198F6FC20029EF9E /* Release */ = { 398 | isa = XCBuildConfiguration; 399 | buildSettings = { 400 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 401 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 402 | GCC_PREFIX_HEADER = "expendAlertViewDemo/expendAlertViewDemo-Prefix.pch"; 403 | INFOPLIST_FILE = "expendAlertViewDemo/expendAlertViewDemo-Info.plist"; 404 | IPHONEOS_DEPLOYMENT_TARGET = 8.1; 405 | PRODUCT_NAME = "$(TARGET_NAME)"; 406 | WRAPPER_EXTENSION = app; 407 | }; 408 | name = Release; 409 | }; 410 | ECA3E6F3198F6FC20029EF9E /* Debug */ = { 411 | isa = XCBuildConfiguration; 412 | buildSettings = { 413 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/expendAlertViewDemo.app/expendAlertViewDemo"; 414 | FRAMEWORK_SEARCH_PATHS = ( 415 | "$(SDKROOT)/Developer/Library/Frameworks", 416 | "$(inherited)", 417 | "$(DEVELOPER_FRAMEWORKS_DIR)", 418 | ); 419 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 420 | GCC_PREFIX_HEADER = "expendAlertViewDemo/expendAlertViewDemo-Prefix.pch"; 421 | GCC_PREPROCESSOR_DEFINITIONS = ( 422 | "DEBUG=1", 423 | "$(inherited)", 424 | ); 425 | INFOPLIST_FILE = "expendAlertViewDemoTests/expendAlertViewDemoTests-Info.plist"; 426 | PRODUCT_NAME = "$(TARGET_NAME)"; 427 | TEST_HOST = "$(BUNDLE_LOADER)"; 428 | WRAPPER_EXTENSION = xctest; 429 | }; 430 | name = Debug; 431 | }; 432 | ECA3E6F4198F6FC20029EF9E /* Release */ = { 433 | isa = XCBuildConfiguration; 434 | buildSettings = { 435 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/expendAlertViewDemo.app/expendAlertViewDemo"; 436 | FRAMEWORK_SEARCH_PATHS = ( 437 | "$(SDKROOT)/Developer/Library/Frameworks", 438 | "$(inherited)", 439 | "$(DEVELOPER_FRAMEWORKS_DIR)", 440 | ); 441 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 442 | GCC_PREFIX_HEADER = "expendAlertViewDemo/expendAlertViewDemo-Prefix.pch"; 443 | INFOPLIST_FILE = "expendAlertViewDemoTests/expendAlertViewDemoTests-Info.plist"; 444 | PRODUCT_NAME = "$(TARGET_NAME)"; 445 | TEST_HOST = "$(BUNDLE_LOADER)"; 446 | WRAPPER_EXTENSION = xctest; 447 | }; 448 | name = Release; 449 | }; 450 | /* End XCBuildConfiguration section */ 451 | 452 | /* Begin XCConfigurationList section */ 453 | ECA3E6B8198F6FC10029EF9E /* Build configuration list for PBXProject "expendAlertViewDemo" */ = { 454 | isa = XCConfigurationList; 455 | buildConfigurations = ( 456 | ECA3E6ED198F6FC20029EF9E /* Debug */, 457 | ECA3E6EE198F6FC20029EF9E /* Release */, 458 | ); 459 | defaultConfigurationIsVisible = 0; 460 | defaultConfigurationName = Release; 461 | }; 462 | ECA3E6EF198F6FC20029EF9E /* Build configuration list for PBXNativeTarget "expendAlertViewDemo" */ = { 463 | isa = XCConfigurationList; 464 | buildConfigurations = ( 465 | ECA3E6F0198F6FC20029EF9E /* Debug */, 466 | ECA3E6F1198F6FC20029EF9E /* Release */, 467 | ); 468 | defaultConfigurationIsVisible = 0; 469 | defaultConfigurationName = Release; 470 | }; 471 | ECA3E6F2198F6FC20029EF9E /* Build configuration list for PBXNativeTarget "expendAlertViewDemoTests" */ = { 472 | isa = XCConfigurationList; 473 | buildConfigurations = ( 474 | ECA3E6F3198F6FC20029EF9E /* Debug */, 475 | ECA3E6F4198F6FC20029EF9E /* Release */, 476 | ); 477 | defaultConfigurationIsVisible = 0; 478 | defaultConfigurationName = Release; 479 | }; 480 | /* End XCConfigurationList section */ 481 | }; 482 | rootObject = ECA3E6B5198F6FC10029EF9E /* Project object */; 483 | } 484 | -------------------------------------------------------------------------------- /expendAlertViewDemo/expendAlertViewDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /expendAlertViewDemo/expendAlertViewDemo.xcodeproj/project.xcworkspace/xcshareddata/expendAlertViewDemo.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 99E4972C-F397-4858-B583-5926AFCC3E84 9 | IDESourceControlProjectName 10 | expendAlertViewDemo 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | D9BE9392C4FAEFF66E36F4E374B0B69F9514C411 14 | https://github.com/denty/ExpandAlertView.git 15 | 16 | IDESourceControlProjectPath 17 | expendAlertViewDemo/expendAlertViewDemo.xcodeproj 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | D9BE9392C4FAEFF66E36F4E374B0B69F9514C411 21 | ../../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/denty/ExpandAlertView.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | D9BE9392C4FAEFF66E36F4E374B0B69F9514C411 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | D9BE9392C4FAEFF66E36F4E374B0B69F9514C411 36 | IDESourceControlWCCName 37 | ExpandAlertView 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /expendAlertViewDemo/expendAlertViewDemo.xcodeproj/project.xcworkspace/xcuserdata/broydenty.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denty/ExpandAlertView/d08c9a926ffd599845b1728172f2ae572fd54abb/expendAlertViewDemo/expendAlertViewDemo.xcodeproj/project.xcworkspace/xcuserdata/broydenty.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /expendAlertViewDemo/expendAlertViewDemo.xcodeproj/project.xcworkspace/xcuserdata/denty.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denty/ExpandAlertView/d08c9a926ffd599845b1728172f2ae572fd54abb/expendAlertViewDemo/expendAlertViewDemo.xcodeproj/project.xcworkspace/xcuserdata/denty.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /expendAlertViewDemo/expendAlertViewDemo.xcodeproj/xcuserdata/broydenty.xcuserdatad/xcschemes/expendAlertViewDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 61 | 62 | 68 | 69 | 70 | 71 | 72 | 73 | 79 | 80 | 86 | 87 | 88 | 89 | 91 | 92 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /expendAlertViewDemo/expendAlertViewDemo.xcodeproj/xcuserdata/broydenty.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | expendAlertViewDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | ECA3E6BC198F6FC10029EF9E 16 | 17 | primary 18 | 19 | 20 | ECA3E6DD198F6FC10029EF9E 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /expendAlertViewDemo/expendAlertViewDemo.xcodeproj/xcuserdata/denty.xcuserdatad/xcschemes/expendAlertViewDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 94 | 100 | 101 | 102 | 103 | 105 | 106 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /expendAlertViewDemo/expendAlertViewDemo.xcodeproj/xcuserdata/denty.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | expendAlertViewDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | ECA3E6BC198F6FC10029EF9E 16 | 17 | primary 18 | 19 | 20 | ECA3E6DD198F6FC10029EF9E 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /expendAlertViewDemo/expendAlertViewDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // expendAlertViewDemo 4 | // 5 | // Created by broy denty on 14-8-4. 6 | // Copyright (c) 2014年 denty. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /expendAlertViewDemo/expendAlertViewDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // expendAlertViewDemo 4 | // 5 | // Created by broy denty on 14-8-4. 6 | // Copyright (c) 2014年 denty. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "ViewController.h" 11 | 12 | @implementation AppDelegate 13 | 14 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 15 | { 16 | // Override point for customization after application launch. 17 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 18 | ViewController *aViewController = [[ViewController alloc] init]; 19 | UINavigationController *aUINavigationController = [[UINavigationController alloc] initWithRootViewController:aViewController]; 20 | [self.window setRootViewController:aUINavigationController]; 21 | [self.window makeKeyAndVisible]; 22 | return YES; 23 | return YES; 24 | } 25 | 26 | - (void)applicationWillResignActive:(UIApplication *)application 27 | { 28 | // 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. 29 | // 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. 30 | } 31 | 32 | - (void)applicationDidEnterBackground:(UIApplication *)application 33 | { 34 | // 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. 35 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 36 | } 37 | 38 | - (void)applicationWillEnterForeground:(UIApplication *)application 39 | { 40 | // 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. 41 | } 42 | 43 | - (void)applicationDidBecomeActive:(UIApplication *)application 44 | { 45 | // 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. 46 | } 47 | 48 | - (void)applicationWillTerminate:(UIApplication *)application 49 | { 50 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 51 | } 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /expendAlertViewDemo/expendAlertViewDemo/ExpandAlertView/AlartViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // AlartViewController.h 3 | // MyReader 4 | // 5 | // Created by broy denty on 14-8-4. 6 | // Copyright (c) 2014年 denty. All rights reserved. 7 | // 8 | 9 | #import 10 | #define DEVICE_HEIGHT ([[UIScreen mainScreen] bounds].size.height) 11 | #define DEVICE_WIDTH ([[UIScreen mainScreen] bounds].size.width) 12 | @protocol ExpendableAlartViewDelegate 13 | 14 | - (void)positiveButtonAction; 15 | - (void)negativeButtonAction; 16 | - (void)closeButtonAction; 17 | @end 18 | 19 | @protocol ExpendableAlartViewDataSource 20 | 21 | @optional 22 | - (NSString *)loadTextWithTitle; 23 | - (NSString *)loadTextWithPositiveTitle; 24 | - (NSString *)loadTextWithNegativeTitle; 25 | - (NSString *)loadTextWithConfirmTitle; 26 | - (NSString *)loadTextWithEnsureTitle; 27 | 28 | - (UIColor *)loadTitleViewColor; 29 | - (UIColor *)loadPositiveViewColor; 30 | - (UIColor *)loadNegativeViewColor; 31 | @end 32 | 33 | @interface AlartViewController : UIViewController 34 | @property (nonatomic,strong) UIView *titleView; 35 | 36 | @property (nonatomic,weak) id expendAbleAlartViewDelegate; 37 | @property (nonatomic,weak) id expendAbleAlartViewDataSource; 38 | - (void)showView:(UIViewController *)VC; 39 | CA_EXTERN CATransform3D CATransform3DMakePerspective(CGPoint center, float disZ); 40 | 41 | 42 | CA_EXTERN CATransform3D CATransform3DPerspect(CATransform3D t, CGPoint center, float disZ); 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /expendAlertViewDemo/expendAlertViewDemo/ExpandAlertView/AlartViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // AlartViewController.m 3 | // MyReader 4 | // 5 | // Created by broy denty on 14-8-4. 6 | // Copyright (c) 2014年 denty. All rights reserved. 7 | // 8 | 9 | #import "AlartViewController.h" 10 | 11 | @interface AlartViewController () 12 | 13 | @end 14 | 15 | @implementation AlartViewController 16 | { 17 | UIView *positiveView; 18 | UIView *negativeView; 19 | UIButton *cancelButton; 20 | UILabel *titleLabel; 21 | 22 | NSString *titleText; 23 | NSString *positiveText; 24 | NSString *negativeText; 25 | NSString *ensureTitleText; 26 | NSString *confirmText; 27 | 28 | UIColor *titleViewColor; 29 | UIColor *positiveButtonColor; 30 | UIColor *negativeButtonColor; 31 | } 32 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 33 | { 34 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 35 | if (self) { 36 | // Custom initialization 37 | } 38 | return self; 39 | } 40 | 41 | - (void)viewDidLoad 42 | { 43 | [super viewDidLoad]; 44 | // title set 45 | if ([self.expendAbleAlartViewDataSource respondsToSelector:@selector(loadTextWithTitle)]) { 46 | titleText = [self.expendAbleAlartViewDataSource loadTextWithTitle]; 47 | } 48 | 49 | if ([self.expendAbleAlartViewDataSource respondsToSelector:@selector(loadTextWithPositiveTitle)]) { 50 | positiveText = [self.expendAbleAlartViewDataSource loadTextWithPositiveTitle]; 51 | } 52 | 53 | if ([self.expendAbleAlartViewDataSource respondsToSelector:@selector(loadTextWithNegativeTitle)]) { 54 | negativeText = [self.expendAbleAlartViewDataSource loadTextWithNegativeTitle]; 55 | } 56 | 57 | if ([self.expendAbleAlartViewDataSource respondsToSelector:@selector(loadTextWithEnsureTitle)]) { 58 | ensureTitleText = [self.expendAbleAlartViewDataSource loadTextWithEnsureTitle]; 59 | } 60 | 61 | if ([self.expendAbleAlartViewDataSource respondsToSelector:@selector(loadTextWithConfirmTitle)]) { 62 | confirmText = [self.expendAbleAlartViewDataSource loadTextWithConfirmTitle]; 63 | } 64 | // color set 65 | if ([self.expendAbleAlartViewDataSource respondsToSelector:@selector(loadTitleViewColor)]) { 66 | titleViewColor = [self.expendAbleAlartViewDataSource loadTitleViewColor]; 67 | } 68 | 69 | if ([self.expendAbleAlartViewDataSource respondsToSelector:@selector(loadPositiveViewColor)]) { 70 | positiveButtonColor = [self.expendAbleAlartViewDataSource loadPositiveViewColor]; 71 | } 72 | 73 | if ([self.expendAbleAlartViewDataSource respondsToSelector:@selector(loadNegativeViewColor)]) { 74 | negativeButtonColor = [self.expendAbleAlartViewDataSource loadNegativeViewColor]; 75 | } 76 | 77 | [self.view setBackgroundColor:[UIColor colorWithRed:0 green:0 blue:0 alpha:0.5]]; 78 | self.titleView = [[UIView alloc] initWithFrame:CGRectMake(20, -70, DEVICE_WIDTH-40, 120)]; 79 | [self.titleView setBackgroundColor:[UIColor whiteColor]]; 80 | [self.view addSubview:self.titleView]; 81 | 82 | 83 | positiveView = [[UIView alloc] init]; 84 | [positiveView setFrame:CGRectMake(0, 90, self.titleView.frame.size.width/2, 50)]; 85 | [positiveView.layer setAnchorPoint:CGPointMake(0.5, 1)]; 86 | if (positiveButtonColor == nil) { 87 | [positiveView setBackgroundColor:[UIColor colorWithRed:0.20 green:0.28 blue:0.41 alpha:1]]; 88 | }else 89 | { 90 | [positiveView setBackgroundColor:positiveButtonColor]; 91 | } 92 | [positiveView.layer setZPosition:-1]; 93 | UILabel *positiveLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, positiveView.frame.size.width, 50)]; 94 | positiveLabel.layer.transform = CATransform3DMakeRotation(M_PI, 1, 0, 0); 95 | if (titleText.length>0) { 96 | [positiveLabel setText:positiveText]; 97 | }else 98 | { 99 | [positiveLabel setText:@"positive"]; 100 | } 101 | [positiveLabel setTextAlignment:NSTextAlignmentCenter]; 102 | [positiveLabel setTextColor:[UIColor lightTextColor]]; 103 | [positiveView addSubview:positiveLabel]; 104 | [self.titleView addSubview:positiveView]; 105 | 106 | 107 | negativeView = [[UIView alloc] init]; 108 | [negativeView setFrame:CGRectMake(self.titleView.frame.size.width/2, 90, self.titleView.frame.size.width/2, 50)]; 109 | [negativeView.layer setAnchorPoint:CGPointMake(0.5, 1)]; 110 | if (negativeButtonColor == nil) { 111 | [negativeView setBackgroundColor:[UIColor colorWithRed:0.26 green:0.33 blue:0.48 alpha:1]]; 112 | }else 113 | { 114 | [negativeView setBackgroundColor:negativeButtonColor]; 115 | } 116 | [negativeView.layer setZPosition:-1]; 117 | UILabel *negativeLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.titleView.frame.size.width/2, 50)]; 118 | negativeLabel.layer.transform = CATransform3DMakeRotation(M_PI, 1, 0, 0); 119 | if (negativeText.length>0) { 120 | [negativeLabel setText:negativeText]; 121 | }else 122 | { 123 | [negativeLabel setText:@"negative"]; 124 | } 125 | [negativeLabel setTextAlignment:NSTextAlignmentCenter]; 126 | [negativeLabel setTextColor:[UIColor lightTextColor]]; 127 | [negativeView addSubview:negativeLabel]; 128 | [self.titleView addSubview:negativeView]; 129 | 130 | 131 | UIView* titleHolder = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.titleView.frame.size.width, self.titleView.frame.size.height)]; 132 | 133 | if (titleViewColor == nil) { 134 | [titleHolder setBackgroundColor:[UIColor colorWithRed:0.20 green:0.25 blue:0.33 alpha:1]]; 135 | }else 136 | { 137 | [titleHolder setBackgroundColor:titleViewColor]; 138 | } 139 | titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.titleView.frame.size.width, 120)]; 140 | if (titleText.length>0) { 141 | [titleLabel setText:titleText]; 142 | }else 143 | { 144 | [titleLabel setText:@"alertView"]; 145 | } 146 | [titleLabel setTextAlignment:NSTextAlignmentCenter]; 147 | [titleLabel setTextColor:[UIColor lightTextColor]]; 148 | [titleHolder addSubview:titleLabel]; 149 | [self.titleView addSubview:titleHolder]; 150 | [self.titleView.layer setZPosition:1]; 151 | 152 | 153 | cancelButton = [[UIButton alloc] initWithFrame:CGRectMake((DEVICE_WIDTH-30)/2, DEVICE_HEIGHT, 30, 30)]; 154 | [cancelButton.layer setBorderColor:[UIColor lightTextColor].CGColor]; 155 | [cancelButton.layer setBorderWidth:1]; 156 | [cancelButton.layer setCornerRadius:15]; 157 | [cancelButton setTitle:@"x" forState:UIControlStateNormal]; 158 | [cancelButton setTitleColor:[UIColor lightTextColor] forState:UIControlStateNormal]; 159 | [cancelButton addTarget:self action:@selector(cancelClick) forControlEvents:UIControlEventTouchUpInside]; 160 | [self.view addSubview:cancelButton]; 161 | UITapGestureRecognizer *gesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(nagetiveAction:)]; 162 | [self.view addGestureRecognizer:gesture]; 163 | // Do any additional setup after loading the view from its nib. 164 | } 165 | 166 | - (void)viewWillAppear:(BOOL)animated 167 | { 168 | [super viewWillAppear:animated]; 169 | } 170 | 171 | - (void)viewDidAppear:(BOOL)animated 172 | { 173 | [super viewDidAppear:animated]; 174 | 175 | [UIView animateWithDuration:0.25 animations:^{ 176 | [self.titleView setFrame:CGRectMake(self.titleView.frame.origin.x, 160, self.titleView.frame.size.width, self.titleView.frame.size.height)]; 177 | }]; 178 | CAKeyframeAnimation *animation = [[CAKeyframeAnimation alloc] init]; 179 | [animation setDelegate:self]; 180 | animation.values = @[@(M_PI/64),@(-M_PI/64),@(M_PI/64),@(0)]; 181 | animation.duration = 0.5; 182 | [animation setKeyPath:@"transform.rotation"]; 183 | animation.removedOnCompletion = NO; 184 | animation.fillMode = kCAFillModeForwards; 185 | [self.titleView.layer addAnimation:animation forKey:@"shake"]; 186 | } 187 | 188 | - (void)viewWillDisappear:(BOOL)animated 189 | { 190 | [NSObject cancelPreviousPerformRequestsWithTarget:self]; 191 | } 192 | 193 | - (void)didReceiveMemoryWarning 194 | { 195 | [super didReceiveMemoryWarning]; 196 | // Dispose of any resources that can be recreated. 197 | } 198 | 199 | - (void)showView:(UIViewController *)VC 200 | { 201 | [VC addChildViewController:self]; 202 | self.view.frame = VC.view.bounds; 203 | [VC.view addSubview:self.view]; 204 | } 205 | 206 | - (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag 207 | { 208 | if (flag == YES) { 209 | if ([anim isEqual:[self.titleView.layer animationForKey:@"shake"]]) 210 | { 211 | CATransform3D trans = CATransform3DPerspect(CATransform3DMakeRotation(-M_PI-0.0001, 1, 0, 0), CGPointMake(0, 0), 200) ; 212 | CABasicAnimation *animation = [[CABasicAnimation alloc] init]; 213 | [animation setDelegate:self]; 214 | animation.keyPath = @"transform"; 215 | animation.toValue = [NSValue valueWithCATransform3D:trans]; 216 | animation.duration = 0.25; 217 | animation.removedOnCompletion = NO; 218 | animation.fillMode = kCAFillModeForwards; 219 | [positiveView.layer addAnimation:animation forKey:@"rotate"]; 220 | } 221 | else if([anim isEqual:[positiveView.layer animationForKey:@"rotate"]]) 222 | { 223 | CATransform3D trans = CATransform3DPerspect(CATransform3DMakeRotation(-M_PI-0.0001, 1, 0, 0), CGPointMake(0, 0), 200) ; 224 | CABasicAnimation *animation = [[CABasicAnimation alloc] init]; 225 | [animation setDelegate:self]; 226 | animation.keyPath = @"transform"; 227 | animation.toValue = [NSValue valueWithCATransform3D:trans]; 228 | animation.duration = 0.25; 229 | animation.removedOnCompletion = NO; 230 | animation.fillMode = kCAFillModeForwards; 231 | [negativeView.layer addAnimation:animation forKey:@"rotate2"]; 232 | } 233 | else if ([anim isEqual:[negativeView.layer animationForKey:@"rotate2"]]) 234 | { 235 | [UIView animateWithDuration:0.5 animations:^{ 236 | [cancelButton setFrame:CGRectMake(cancelButton.frame.origin.x, 350, cancelButton.frame.size.width, cancelButton.frame.size.height)]; 237 | }]; 238 | CABasicAnimation *rotateAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"]; 239 | rotateAnimation.fromValue = [NSNumber numberWithFloat:0.0]; 240 | rotateAnimation.toValue = [NSNumber numberWithFloat:2 * M_PI]; 241 | rotateAnimation.duration = 0.75; 242 | [cancelButton.layer addAnimation:rotateAnimation forKey:@"rotate3"]; 243 | } 244 | else if([anim isEqual:[self.titleView.layer animationForKey:@"rotate"]]) 245 | { 246 | if (ensureTitleText.length>0) { 247 | [titleLabel setText:ensureTitleText]; 248 | }else 249 | { 250 | [titleLabel setText:@"Are you sure ?"]; 251 | } 252 | } 253 | else if ([anim isEqual:[positiveView.layer animationForKey:@"close"]]) 254 | { 255 | CATransform3D transFrom = CATransform3DPerspect(CATransform3DMakeRotation(-M_PI-0.0001, 1, 0, 0), CGPointMake(0, 0), 200); 256 | CATransform3D trans = CATransform3DIdentity ; 257 | CABasicAnimation *animation = [[CABasicAnimation alloc] init]; 258 | [animation setDelegate:self]; 259 | animation.keyPath = @"transform"; 260 | animation.fromValue = [NSValue valueWithCATransform3D:transFrom]; 261 | animation.toValue = [NSValue valueWithCATransform3D:trans]; 262 | animation.duration = 0.25; 263 | animation.removedOnCompletion = NO; 264 | animation.fillMode = kCAFillModeForwards; 265 | [negativeView.layer addAnimation:animation forKey:@"close2"]; 266 | } 267 | else if ([anim isEqual:[negativeView.layer animationForKey:@"close2"]]) 268 | { 269 | CATransform3D trans = CATransform3DPerspect(CATransform3DMakeRotation(-M_PI-0.0001, 0, 1, 0), CGPointMake(0, 0), 200) ; 270 | CABasicAnimation *animation = [[CABasicAnimation alloc] init]; 271 | [animation setDelegate:self]; 272 | animation.keyPath = @"transform"; 273 | animation.toValue = [NSValue valueWithCATransform3D:trans]; 274 | animation.duration = 0.5; 275 | animation.removedOnCompletion = NO; 276 | [self.titleView.layer addAnimation:animation forKey:@"surerotate"]; 277 | } 278 | else if ([anim isEqual:[self.titleView.layer animationForKey:@"surerotate"]]) 279 | { 280 | if (confirmText.length>0) { 281 | [titleLabel setText:confirmText]; 282 | }else 283 | { 284 | [titleLabel setText:@"success!"]; 285 | } 286 | [self performSelector:@selector(cancelAction) withObject:self afterDelay:1]; 287 | } 288 | } 289 | } 290 | 291 | CA_EXTERN CATransform3D CATransform3DMakePerspective(CGPoint center, float disZ) 292 | { 293 | CATransform3D transToCenter = CATransform3DMakeTranslation(-center.x, -center.y, 0); 294 | CATransform3D transBack = CATransform3DMakeTranslation(center.x, center.y, 0); 295 | CATransform3D scale = CATransform3DIdentity; 296 | scale.m34 = -1.0f/disZ; 297 | return CATransform3DConcat(CATransform3DConcat(transToCenter, scale), transBack); 298 | } 299 | 300 | CA_EXTERN CATransform3D CATransform3DPerspect(CATransform3D t, CGPoint center, float disZ) 301 | { 302 | return CATransform3DConcat(t, CATransform3DMakePerspective(center, disZ)); 303 | } 304 | 305 | - (void)cancelClick 306 | { 307 | [self.expendAbleAlartViewDelegate closeButtonAction]; 308 | [self cancelAction]; 309 | } 310 | 311 | - (void)cancelAction 312 | { 313 | [UIView animateWithDuration:0.5 animations:^{ 314 | [cancelButton setFrame:CGRectMake(cancelButton.frame.origin.x, DEVICE_HEIGHT+190, cancelButton.frame.size.width, cancelButton.frame.size.height)]; 315 | [self.titleView setFrame:CGRectMake(self.titleView.frame.origin.x, DEVICE_HEIGHT, self.titleView.frame.size.width, self.titleView.frame.size.height)]; 316 | 317 | } completion:^(BOOL finished) { 318 | [self.view removeFromSuperview]; 319 | [self removeFromParentViewController]; 320 | }]; 321 | } 322 | 323 | - (void)nagetiveAction:(UIGestureRecognizer*) gesture 324 | { 325 | CGPoint touchPoint = [gesture locationInView:self.titleView]; 326 | if ([negativeView.layer.presentationLayer hitTest:touchPoint]) 327 | { 328 | [self.expendAbleAlartViewDelegate positiveButtonAction]; 329 | // NSLog(@"nagetiveAction"); 330 | [self cancelAction]; 331 | } 332 | else if([positiveView.layer.presentationLayer hitTest:touchPoint]) 333 | { 334 | [self.expendAbleAlartViewDelegate positiveButtonAction]; 335 | if (self.titleView.layer.animationKeys.count>1) 336 | { 337 | CATransform3D transFrom = CATransform3DPerspect(CATransform3DMakeRotation(-M_PI-0.0001, 1, 0, 0), CGPointMake(0, 0), 200); 338 | CATransform3D trans = CATransform3DIdentity ; 339 | CABasicAnimation *animation = [[CABasicAnimation alloc] init]; 340 | [animation setDelegate:self]; 341 | animation.keyPath = @"transform"; 342 | animation.fromValue = [NSValue valueWithCATransform3D:transFrom]; 343 | animation.toValue = [NSValue valueWithCATransform3D:trans]; 344 | animation.duration = 0.25; 345 | animation.removedOnCompletion = NO; 346 | animation.fillMode = kCAFillModeForwards; 347 | [positiveView.layer addAnimation:animation forKey:@"close"]; 348 | }else 349 | { 350 | CATransform3D trans = CATransform3DPerspect(CATransform3DMakeRotation(-M_PI-0.0001, 0, 1, 0), CGPointMake(0, 0), 200) ; 351 | CABasicAnimation *animation = [[CABasicAnimation alloc] init]; 352 | [animation setDelegate:self]; 353 | animation.keyPath = @"transform"; 354 | animation.toValue = [NSValue valueWithCATransform3D:trans]; 355 | animation.duration = 0.5; 356 | animation.removedOnCompletion = NO; 357 | [self.titleView.layer addAnimation:animation forKey:@"rotate"]; 358 | } 359 | } 360 | } 361 | @end 362 | -------------------------------------------------------------------------------- /expendAlertViewDemo/expendAlertViewDemo/ExpandAlertView/AlartViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /expendAlertViewDemo/expendAlertViewDemo/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 | "idiom" : "iphone", 20 | "size" : "60x60", 21 | "scale" : "3x" 22 | } 23 | ], 24 | "info" : { 25 | "version" : 1, 26 | "author" : "xcode" 27 | } 28 | } -------------------------------------------------------------------------------- /expendAlertViewDemo/expendAlertViewDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // expendAlertViewDemo 4 | // 5 | // Created by broy denty on 14-8-4. 6 | // Copyright (c) 2014年 denty. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AlartViewController.h" 11 | @interface ViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /expendAlertViewDemo/expendAlertViewDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // expendAlertViewDemo 4 | // 5 | // Created by broy denty on 14-8-4. 6 | // Copyright (c) 2014年 denty. 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 | { 19 | [super viewDidLoad]; 20 | [self.view setBackgroundColor:[UIColor whiteColor]]; 21 | UIButton *alertButton = [[UIButton alloc] initWithFrame:CGRectMake(100, 200, 120, 50)]; 22 | [alertButton setBackgroundColor:[UIColor orangeColor]]; 23 | [alertButton addTarget:self action:@selector(alertAction) forControlEvents:UIControlEventTouchUpInside]; 24 | [alertButton setTitle:@"alertAction" forState:UIControlStateNormal]; 25 | [self.view addSubview:alertButton]; 26 | // Do any additional setup after loading the view, typically from a nib. 27 | } 28 | 29 | - (void)didReceiveMemoryWarning 30 | { 31 | [super didReceiveMemoryWarning]; 32 | // Dispose of any resources that can be recreated. 33 | } 34 | 35 | - (void)alertAction 36 | { 37 | NSLog(@"buttonAction"); 38 | AlartViewController *aAlartViewController = [[AlartViewController alloc] init]; 39 | aAlartViewController.expendAbleAlartViewDelegate = self; 40 | aAlartViewController.expendAbleAlartViewDataSource = self; 41 | __weak UIViewController *weakVC = self; 42 | [aAlartViewController showView:weakVC]; 43 | } 44 | 45 | - (void)negativeButtonAction 46 | { 47 | NSLog(@"negative Action"); 48 | } 49 | 50 | - (void)positiveButtonAction 51 | { 52 | NSLog(@"positive Action"); 53 | } 54 | 55 | - (void)closeButtonAction 56 | { 57 | NSLog(@"close Action"); 58 | } 59 | 60 | - (NSString *)loadTextWithNegativeTitle 61 | { 62 | // return nil; 63 | return @"取消"; 64 | } 65 | 66 | - (NSString *)loadTextWithTitle 67 | { 68 | // return nil; 69 | return @"注意,真的要这样么"; 70 | } 71 | 72 | - (NSString *)loadTextWithPositiveTitle 73 | { 74 | // return nil; 75 | return @"确定"; 76 | } 77 | 78 | - (NSString *)loadTextWithEnsureTitle 79 | { 80 | // return nil; 81 | return @"确定么?"; 82 | } 83 | 84 | - (NSString *)loadTextWithConfirmTitle 85 | { 86 | // return nil; 87 | return @"操作成功"; 88 | } 89 | 90 | //- (UIColor *)loadTitleViewColor 91 | //{ 92 | // return [UIColor greenColor]; 93 | //} 94 | @end 95 | -------------------------------------------------------------------------------- /expendAlertViewDemo/expendAlertViewDemo/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /expendAlertViewDemo/expendAlertViewDemo/expendAlertViewDemo-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | myproject.${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 | UILaunchStoryboardName 28 | openScreen 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /expendAlertViewDemo/expendAlertViewDemo/expendAlertViewDemo-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 | -------------------------------------------------------------------------------- /expendAlertViewDemo/expendAlertViewDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // expendAlertViewDemo 4 | // 5 | // Created by broy denty on 14-8-4. 6 | // Copyright (c) 2014年 denty. 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 | -------------------------------------------------------------------------------- /expendAlertViewDemo/expendAlertViewDemo/openScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /expendAlertViewDemo/expendAlertViewDemoTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /expendAlertViewDemo/expendAlertViewDemoTests/expendAlertViewDemoTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | myproject.${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 | -------------------------------------------------------------------------------- /expendAlertViewDemo/expendAlertViewDemoTests/expendAlertViewDemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // expendAlertViewDemoTests.m 3 | // expendAlertViewDemoTests 4 | // 5 | // Created by broy denty on 14-8-4. 6 | // Copyright (c) 2014年 denty. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface expendAlertViewDemoTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation expendAlertViewDemoTests 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 | --------------------------------------------------------------------------------