├── README.md ├── UDStackView.xcodeproj └── project.pbxproj └── UDStackView ├── Classes ├── Controller │ ├── UDColoredViewController.h │ ├── UDColoredViewController.m │ ├── UDMainViewController.h │ └── UDMainViewController.m ├── Support │ └── UDStackViewController │ │ ├── UDStackNavigationController.h │ │ └── UDStackNavigationController.m ├── UDAppDelegate.h └── UDAppDelegate.m ├── Prefix.pch ├── Resources ├── Image │ ├── Default.png │ ├── Icon.png │ ├── filler.png │ ├── triangle.png │ └── ud7logo.png ├── Info.plist └── View │ ├── UDColoredView.xib │ └── UDMainView.xib └── main.m /README.md: -------------------------------------------------------------------------------- 1 | UDStackViewController 2 | ========= 3 | 4 | UDStackViewController similar to what @linkedin app uses for it's main view... 5 | check out how it works @ http://www.youtube.com/watch?v=yHbUXie7a34 6 | 7 | Requirements 8 | ---------- 9 | You will need LLVM 3.0+ to build, but code is iOS4.0+. (actualy iOS4.0+ only because of animation blocks - could be ported to 3.0 easy) 10 | If you want to use other compile move all declarations from .m to .h 11 | 12 | What's different on this branch from v0.1 13 | ---------- 14 | There is v0.1 also - its implementation differs from this one. You should check both if you looking for something like this. 15 | This version rewrite from scrach of v0.1. It uses single navigation controller you should use instead of UINavigationController. 16 | 17 | How To Use It 18 | ------------- 19 | basically it's same UINavigationControler. Check attached project. 20 | -------------------------------------------------------------------------------- /UDStackView.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | F05B385D14016859004C2A46 /* ud7logo.png in Resources */ = {isa = PBXBuildFile; fileRef = F05B385C14016859004C2A46 /* ud7logo.png */; }; 11 | F05B386014016CC1004C2A46 /* triangle.png in Resources */ = {isa = PBXBuildFile; fileRef = F05B385F14016CC1004C2A46 /* triangle.png */; }; 12 | F05B3868140174A2004C2A46 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = F05B3867140174A2004C2A46 /* Icon.png */; }; 13 | F05B3872140174FA004C2A46 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = F05B3871140174FA004C2A46 /* Default.png */; }; 14 | F05B387614017A3B004C2A46 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F05B387514017A3B004C2A46 /* CoreGraphics.framework */; }; 15 | F05B388114018712004C2A46 /* UDStackNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = F05B387E14018712004C2A46 /* UDStackNavigationController.m */; }; 16 | F0C111931400C1B9001F5A6E /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F0C111921400C1B9001F5A6E /* UIKit.framework */; }; 17 | F0C111951400C1B9001F5A6E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F0C111941400C1B9001F5A6E /* Foundation.framework */; }; 18 | F0C111C41400C4BA001F5A6E /* UDAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = F0C111BB1400C4BA001F5A6E /* UDAppDelegate.m */; }; 19 | F0C111C51400C4BA001F5A6E /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = F0C111BD1400C4BA001F5A6E /* main.m */; }; 20 | F0EE82651402593F003A1507 /* filler.png in Resources */ = {isa = PBXBuildFile; fileRef = F0EE82641402593F003A1507 /* filler.png */; }; 21 | F0EE97041400CD1100E20CD9 /* UDMainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F0EE97031400CD1100E20CD9 /* UDMainViewController.m */; }; 22 | F0EE97061400CD7F00E20CD9 /* UDMainView.xib in Resources */ = {isa = PBXBuildFile; fileRef = F0EE97051400CD7F00E20CD9 /* UDMainView.xib */; }; 23 | F0EE97421400D07100E20CD9 /* UDColoredViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F0EE97411400D07100E20CD9 /* UDColoredViewController.m */; }; 24 | F0EE97441400D16900E20CD9 /* UDColoredView.xib in Resources */ = {isa = PBXBuildFile; fileRef = F0EE97431400D16900E20CD9 /* UDColoredView.xib */; }; 25 | /* End PBXBuildFile section */ 26 | 27 | /* Begin PBXFileReference section */ 28 | F043F443140218A100412D4A /* README.md */ = {isa = PBXFileReference; lastKnownFileType = text; path = README.md; sourceTree = SOURCE_ROOT; }; 29 | F05B385C14016859004C2A46 /* ud7logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ud7logo.png; sourceTree = ""; }; 30 | F05B385F14016CC1004C2A46 /* triangle.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = triangle.png; sourceTree = ""; }; 31 | F05B3867140174A2004C2A46 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = ""; }; 32 | F05B3871140174FA004C2A46 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; 33 | F05B387514017A3B004C2A46 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 34 | F05B387D14018712004C2A46 /* UDStackNavigationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UDStackNavigationController.h; sourceTree = ""; }; 35 | F05B387E14018712004C2A46 /* UDStackNavigationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UDStackNavigationController.m; sourceTree = ""; }; 36 | F0C1118E1400C1B9001F5A6E /* UDStackView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = UDStackView.app; sourceTree = BUILT_PRODUCTS_DIR; }; 37 | F0C111921400C1B9001F5A6E /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 38 | F0C111941400C1B9001F5A6E /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 39 | F0C111BA1400C4BA001F5A6E /* UDAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UDAppDelegate.h; sourceTree = ""; }; 40 | F0C111BB1400C4BA001F5A6E /* UDAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UDAppDelegate.m; sourceTree = ""; }; 41 | F0C111BD1400C4BA001F5A6E /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = UDStackView/main.m; sourceTree = ""; }; 42 | F0C111C01400C4BA001F5A6E /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 43 | F0C111C31400C4BA001F5A6E /* Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Prefix.pch; path = UDStackView/Prefix.pch; sourceTree = ""; }; 44 | F0EE82641402593F003A1507 /* filler.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = filler.png; sourceTree = ""; }; 45 | F0EE97021400CD1100E20CD9 /* UDMainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UDMainViewController.h; sourceTree = ""; }; 46 | F0EE97031400CD1100E20CD9 /* UDMainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UDMainViewController.m; sourceTree = ""; }; 47 | F0EE97051400CD7F00E20CD9 /* UDMainView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = UDMainView.xib; sourceTree = ""; }; 48 | F0EE97401400D07100E20CD9 /* UDColoredViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UDColoredViewController.h; sourceTree = ""; }; 49 | F0EE97411400D07100E20CD9 /* UDColoredViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UDColoredViewController.m; sourceTree = ""; }; 50 | F0EE97431400D16900E20CD9 /* UDColoredView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = UDColoredView.xib; sourceTree = ""; }; 51 | /* End PBXFileReference section */ 52 | 53 | /* Begin PBXFrameworksBuildPhase section */ 54 | F0C1118B1400C1B9001F5A6E /* Frameworks */ = { 55 | isa = PBXFrameworksBuildPhase; 56 | buildActionMask = 2147483647; 57 | files = ( 58 | F05B387614017A3B004C2A46 /* CoreGraphics.framework in Frameworks */, 59 | F0C111931400C1B9001F5A6E /* UIKit.framework in Frameworks */, 60 | F0C111951400C1B9001F5A6E /* Foundation.framework in Frameworks */, 61 | ); 62 | runOnlyForDeploymentPostprocessing = 0; 63 | }; 64 | /* End PBXFrameworksBuildPhase section */ 65 | 66 | /* Begin PBXGroup section */ 67 | F05B387C14018712004C2A46 /* UDStackViewController */ = { 68 | isa = PBXGroup; 69 | children = ( 70 | F05B387D14018712004C2A46 /* UDStackNavigationController.h */, 71 | F05B387E14018712004C2A46 /* UDStackNavigationController.m */, 72 | ); 73 | path = UDStackViewController; 74 | sourceTree = ""; 75 | }; 76 | F0C111831400C1B9001F5A6E = { 77 | isa = PBXGroup; 78 | children = ( 79 | F0C111B91400C4BA001F5A6E /* Classes */, 80 | F0C111BE1400C4BA001F5A6E /* Resources */, 81 | F0C111B81400C4AB001F5A6E /* Other Sources */, 82 | F0C111BC1400C4BA001F5A6E /* Frameworks */, 83 | F0C1118F1400C1B9001F5A6E /* Products */, 84 | ); 85 | sourceTree = ""; 86 | }; 87 | F0C1118F1400C1B9001F5A6E /* Products */ = { 88 | isa = PBXGroup; 89 | children = ( 90 | F0C1118E1400C1B9001F5A6E /* UDStackView.app */, 91 | ); 92 | name = Products; 93 | sourceTree = ""; 94 | }; 95 | F0C111B81400C4AB001F5A6E /* Other Sources */ = { 96 | isa = PBXGroup; 97 | children = ( 98 | F0C111BD1400C4BA001F5A6E /* main.m */, 99 | F0C111C31400C4BA001F5A6E /* Prefix.pch */, 100 | ); 101 | name = "Other Sources"; 102 | sourceTree = ""; 103 | }; 104 | F0C111B91400C4BA001F5A6E /* Classes */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | F0EE973B1400CFE300E20CD9 /* Support */, 108 | F0EE97001400CCEB00E20CD9 /* Model */, 109 | F0EE97011400CCEB00E20CD9 /* View */, 110 | F0EE96FF1400CCEB00E20CD9 /* Controller */, 111 | F0C111BA1400C4BA001F5A6E /* UDAppDelegate.h */, 112 | F0C111BB1400C4BA001F5A6E /* UDAppDelegate.m */, 113 | ); 114 | name = Classes; 115 | path = UDStackView/Classes; 116 | sourceTree = ""; 117 | }; 118 | F0C111BC1400C4BA001F5A6E /* Frameworks */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | F0C111921400C1B9001F5A6E /* UIKit.framework */, 122 | F0C111941400C1B9001F5A6E /* Foundation.framework */, 123 | F05B387514017A3B004C2A46 /* CoreGraphics.framework */, 124 | ); 125 | name = Frameworks; 126 | path = UDStackView/Frameworks; 127 | sourceTree = ""; 128 | }; 129 | F0C111BE1400C4BA001F5A6E /* Resources */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | F0C111C11400C4BA001F5A6E /* View */, 133 | F0C111BF1400C4BA001F5A6E /* Image */, 134 | F0C111C01400C4BA001F5A6E /* Info.plist */, 135 | F043F443140218A100412D4A /* README.md */, 136 | ); 137 | name = Resources; 138 | path = UDStackView/Resources; 139 | sourceTree = ""; 140 | }; 141 | F0C111BF1400C4BA001F5A6E /* Image */ = { 142 | isa = PBXGroup; 143 | children = ( 144 | F05B3867140174A2004C2A46 /* Icon.png */, 145 | F05B3871140174FA004C2A46 /* Default.png */, 146 | F05B385C14016859004C2A46 /* ud7logo.png */, 147 | F05B385F14016CC1004C2A46 /* triangle.png */, 148 | F0EE82641402593F003A1507 /* filler.png */, 149 | ); 150 | path = Image; 151 | sourceTree = ""; 152 | }; 153 | F0C111C11400C4BA001F5A6E /* View */ = { 154 | isa = PBXGroup; 155 | children = ( 156 | F0EE97051400CD7F00E20CD9 /* UDMainView.xib */, 157 | F0EE97431400D16900E20CD9 /* UDColoredView.xib */, 158 | ); 159 | path = View; 160 | sourceTree = ""; 161 | }; 162 | F0EE96FF1400CCEB00E20CD9 /* Controller */ = { 163 | isa = PBXGroup; 164 | children = ( 165 | F0EE97021400CD1100E20CD9 /* UDMainViewController.h */, 166 | F0EE97031400CD1100E20CD9 /* UDMainViewController.m */, 167 | F0EE97401400D07100E20CD9 /* UDColoredViewController.h */, 168 | F0EE97411400D07100E20CD9 /* UDColoredViewController.m */, 169 | ); 170 | path = Controller; 171 | sourceTree = ""; 172 | }; 173 | F0EE97001400CCEB00E20CD9 /* Model */ = { 174 | isa = PBXGroup; 175 | children = ( 176 | ); 177 | path = Model; 178 | sourceTree = ""; 179 | }; 180 | F0EE97011400CCEB00E20CD9 /* View */ = { 181 | isa = PBXGroup; 182 | children = ( 183 | ); 184 | path = View; 185 | sourceTree = ""; 186 | }; 187 | F0EE973B1400CFE300E20CD9 /* Support */ = { 188 | isa = PBXGroup; 189 | children = ( 190 | F05B387C14018712004C2A46 /* UDStackViewController */, 191 | ); 192 | path = Support; 193 | sourceTree = ""; 194 | }; 195 | /* End PBXGroup section */ 196 | 197 | /* Begin PBXNativeTarget section */ 198 | F0C1118D1400C1B9001F5A6E /* UDStackView */ = { 199 | isa = PBXNativeTarget; 200 | buildConfigurationList = F0C111AA1400C1B9001F5A6E /* Build configuration list for PBXNativeTarget "UDStackView" */; 201 | buildPhases = ( 202 | F0C1118A1400C1B9001F5A6E /* Sources */, 203 | F0C1118B1400C1B9001F5A6E /* Frameworks */, 204 | F0C1118C1400C1B9001F5A6E /* Resources */, 205 | ); 206 | buildRules = ( 207 | ); 208 | dependencies = ( 209 | ); 210 | name = UDStackView; 211 | productName = UDStackView; 212 | productReference = F0C1118E1400C1B9001F5A6E /* UDStackView.app */; 213 | productType = "com.apple.product-type.application"; 214 | }; 215 | /* End PBXNativeTarget section */ 216 | 217 | /* Begin PBXProject section */ 218 | F0C111851400C1B9001F5A6E /* Project object */ = { 219 | isa = PBXProject; 220 | attributes = { 221 | LastUpgradeCheck = 0420; 222 | ORGANIZATIONNAME = UD7; 223 | }; 224 | buildConfigurationList = F0C111881400C1B9001F5A6E /* Build configuration list for PBXProject "UDStackView" */; 225 | compatibilityVersion = "Xcode 3.2"; 226 | developmentRegion = English; 227 | hasScannedForEncodings = 0; 228 | knownRegions = ( 229 | en, 230 | ); 231 | mainGroup = F0C111831400C1B9001F5A6E; 232 | productRefGroup = F0C1118F1400C1B9001F5A6E /* Products */; 233 | projectDirPath = ""; 234 | projectRoot = ""; 235 | targets = ( 236 | F0C1118D1400C1B9001F5A6E /* UDStackView */, 237 | ); 238 | }; 239 | /* End PBXProject section */ 240 | 241 | /* Begin PBXResourcesBuildPhase section */ 242 | F0C1118C1400C1B9001F5A6E /* Resources */ = { 243 | isa = PBXResourcesBuildPhase; 244 | buildActionMask = 2147483647; 245 | files = ( 246 | F0EE97061400CD7F00E20CD9 /* UDMainView.xib in Resources */, 247 | F0EE97441400D16900E20CD9 /* UDColoredView.xib in Resources */, 248 | F05B385D14016859004C2A46 /* ud7logo.png in Resources */, 249 | F05B386014016CC1004C2A46 /* triangle.png in Resources */, 250 | F05B3868140174A2004C2A46 /* Icon.png in Resources */, 251 | F05B3872140174FA004C2A46 /* Default.png in Resources */, 252 | F0EE82651402593F003A1507 /* filler.png in Resources */, 253 | ); 254 | runOnlyForDeploymentPostprocessing = 0; 255 | }; 256 | /* End PBXResourcesBuildPhase section */ 257 | 258 | /* Begin PBXSourcesBuildPhase section */ 259 | F0C1118A1400C1B9001F5A6E /* Sources */ = { 260 | isa = PBXSourcesBuildPhase; 261 | buildActionMask = 2147483647; 262 | files = ( 263 | F0C111C41400C4BA001F5A6E /* UDAppDelegate.m in Sources */, 264 | F0C111C51400C4BA001F5A6E /* main.m in Sources */, 265 | F0EE97041400CD1100E20CD9 /* UDMainViewController.m in Sources */, 266 | F0EE97421400D07100E20CD9 /* UDColoredViewController.m in Sources */, 267 | F05B388114018712004C2A46 /* UDStackNavigationController.m in Sources */, 268 | ); 269 | runOnlyForDeploymentPostprocessing = 0; 270 | }; 271 | /* End PBXSourcesBuildPhase section */ 272 | 273 | /* Begin XCBuildConfiguration section */ 274 | F0C111A81400C1B9001F5A6E /* Debug */ = { 275 | isa = XCBuildConfiguration; 276 | buildSettings = { 277 | ALWAYS_SEARCH_USER_PATHS = NO; 278 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 279 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 280 | COPY_PHASE_STRIP = NO; 281 | GCC_C_LANGUAGE_STANDARD = gnu99; 282 | GCC_DYNAMIC_NO_PIC = NO; 283 | GCC_OPTIMIZATION_LEVEL = 0; 284 | GCC_PREPROCESSOR_DEFINITIONS = ( 285 | "DEBUG=1", 286 | "$(inherited)", 287 | ); 288 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 289 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 290 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 291 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 292 | GCC_WARN_UNUSED_VARIABLE = YES; 293 | IPHONEOS_DEPLOYMENT_TARGET = 4.0; 294 | SDKROOT = iphoneos; 295 | }; 296 | name = Debug; 297 | }; 298 | F0C111A91400C1B9001F5A6E /* Release */ = { 299 | isa = XCBuildConfiguration; 300 | buildSettings = { 301 | ALWAYS_SEARCH_USER_PATHS = NO; 302 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 303 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 304 | COPY_PHASE_STRIP = YES; 305 | GCC_C_LANGUAGE_STANDARD = gnu99; 306 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 307 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 308 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 309 | GCC_WARN_UNUSED_VARIABLE = YES; 310 | IPHONEOS_DEPLOYMENT_TARGET = 4.0; 311 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 312 | SDKROOT = iphoneos; 313 | VALIDATE_PRODUCT = YES; 314 | }; 315 | name = Release; 316 | }; 317 | F0C111AB1400C1B9001F5A6E /* Debug */ = { 318 | isa = XCBuildConfiguration; 319 | buildSettings = { 320 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 321 | GCC_PREFIX_HEADER = UDStackView/Prefix.pch; 322 | INFOPLIST_FILE = UDStackView/Resources/Info.plist; 323 | PRODUCT_NAME = "$(TARGET_NAME)"; 324 | WRAPPER_EXTENSION = app; 325 | }; 326 | name = Debug; 327 | }; 328 | F0C111AC1400C1B9001F5A6E /* Release */ = { 329 | isa = XCBuildConfiguration; 330 | buildSettings = { 331 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 332 | GCC_PREFIX_HEADER = UDStackView/Prefix.pch; 333 | INFOPLIST_FILE = UDStackView/Resources/Info.plist; 334 | PRODUCT_NAME = "$(TARGET_NAME)"; 335 | WRAPPER_EXTENSION = app; 336 | }; 337 | name = Release; 338 | }; 339 | /* End XCBuildConfiguration section */ 340 | 341 | /* Begin XCConfigurationList section */ 342 | F0C111881400C1B9001F5A6E /* Build configuration list for PBXProject "UDStackView" */ = { 343 | isa = XCConfigurationList; 344 | buildConfigurations = ( 345 | F0C111A81400C1B9001F5A6E /* Debug */, 346 | F0C111A91400C1B9001F5A6E /* Release */, 347 | ); 348 | defaultConfigurationIsVisible = 0; 349 | defaultConfigurationName = Release; 350 | }; 351 | F0C111AA1400C1B9001F5A6E /* Build configuration list for PBXNativeTarget "UDStackView" */ = { 352 | isa = XCConfigurationList; 353 | buildConfigurations = ( 354 | F0C111AB1400C1B9001F5A6E /* Debug */, 355 | F0C111AC1400C1B9001F5A6E /* Release */, 356 | ); 357 | defaultConfigurationIsVisible = 0; 358 | defaultConfigurationName = Release; 359 | }; 360 | /* End XCConfigurationList section */ 361 | }; 362 | rootObject = F0C111851400C1B9001F5A6E /* Project object */; 363 | } 364 | -------------------------------------------------------------------------------- /UDStackView/Classes/Controller/UDColoredViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // UDColoredViewController.h 3 | // UDStackView 4 | // 5 | // Created by Rolandas Razma on 8/21/11. 6 | // Copyright (c) 2011 UD7. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface UDColoredViewController : UIViewController 13 | 14 | - (id)initWithColor:(UIColor *)color; 15 | - (IBAction)nextColor; 16 | - (IBAction)increaseCount; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /UDStackView/Classes/Controller/UDColoredViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // UDColoredViewController.m 3 | // UDStackView 4 | // 5 | // Created by Rolandas Razma on 8/21/11. 6 | // Copyright (c) 2011 UD7. All rights reserved. 7 | // 8 | 9 | #import "UDColoredViewController.h" 10 | 11 | 12 | @implementation UDColoredViewController { 13 | IBOutlet UIButton *_countingButton; 14 | UIColor *_color; 15 | NSInteger _count; 16 | } 17 | 18 | 19 | #pragma mark - 20 | #pragma mark NSObject 21 | 22 | 23 | - (void)dealloc { 24 | [_color release]; 25 | [_countingButton release]; 26 | [super dealloc]; 27 | } 28 | 29 | 30 | #pragma mark - 31 | #pragma mark UIViewController 32 | 33 | 34 | - (void)viewDidLoad { 35 | [super viewDidLoad]; 36 | 37 | // Generate random color if controller was initializet without color 38 | if( !_color ){ 39 | _color = [[UIColor colorWithRed: (CGFloat)random()/(CGFloat)RAND_MAX 40 | green: (CGFloat)random()/(CGFloat)RAND_MAX 41 | blue: (CGFloat)random()/(CGFloat)RAND_MAX 42 | alpha: 1.0f] retain]; 43 | } 44 | [self.view setBackgroundColor:_color]; 45 | 46 | // Setup view 47 | [self setTitle:[NSString stringWithFormat:@"%u", self.navigationController.viewControllers.count]]; 48 | [_countingButton setTitle:[NSString stringWithFormat:@"%u", _count] forState:UIControlStateNormal]; 49 | 50 | // This only for testing purposes only 51 | // Using this 'if' only because im using same viewController over and over again 52 | if( self.navigationController.viewControllers.count == 2 ){ 53 | UIImageView *logoView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"ud7logo.png"]] autorelease]; 54 | [logoView setContentMode:UIViewContentModeScaleAspectFit]; 55 | [logoView setAutoresizingMask:(UIViewAutoresizingFlexibleHeight)]; 56 | [self.navigationItem setTitleView:logoView]; 57 | 58 | UIImageView *triangleView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"triangle.png"]] autorelease]; 59 | [triangleView setAutoresizingMask:UIViewAutoresizingFlexibleTopMargin]; 60 | [triangleView setFrame:CGRectMake((logoView.frame.size.width -triangleView.frame.size.width) /2, 43, triangleView.frame.size.width, triangleView.frame.size.height)]; 61 | [logoView addSubview:triangleView]; 62 | 63 | // Some barButtons 64 | UIBarButtonItem *barButtonItemL = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemTrash target:nil action:nil]; 65 | [self.navigationItem setLeftBarButtonItem:barButtonItemL]; 66 | [barButtonItemL release]; 67 | 68 | UIBarButtonItem *barButtonItemR = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemBookmarks target:nil action:nil]; 69 | [self.navigationItem setRightBarButtonItem:barButtonItemR]; 70 | [barButtonItemR release]; 71 | }else{ 72 | // Some barButton 73 | UIBarButtonItem *barButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFastForward target:nil action:nil]; 74 | [self.navigationItem setRightBarButtonItem:barButtonItem]; 75 | [barButtonItem release]; 76 | } 77 | 78 | } 79 | 80 | 81 | - (void)viewDidUnload { 82 | [super viewDidUnload]; 83 | [_countingButton release], _countingButton = nil; 84 | } 85 | 86 | 87 | #pragma mark - 88 | #pragma mark UDColoredViewController 89 | 90 | 91 | - (id)initWithColor:(UIColor *)color { 92 | if( (self = [self init]) ){ 93 | _color = [color copy]; 94 | } 95 | return self; 96 | } 97 | 98 | 99 | - (IBAction)nextColor { 100 | UDColoredViewController *coloredViewController = [[UDColoredViewController alloc] init]; 101 | [self.navigationController pushViewController:coloredViewController animated:YES]; 102 | [coloredViewController release]; 103 | } 104 | 105 | 106 | - (IBAction)increaseCount { 107 | [_countingButton setTitle:[NSString stringWithFormat:@"%u", ++_count] forState:UIControlStateNormal]; 108 | } 109 | 110 | 111 | @end 112 | -------------------------------------------------------------------------------- /UDStackView/Classes/Controller/UDMainViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // UDMainViewController.h 3 | // UDStackView 4 | // 5 | // Created by Rolandas Razma on 8/21/11. 6 | // Copyright (c) 2011 UD7. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "UDStackNavigationController.h" 11 | 12 | 13 | @interface UDMainViewController : UIViewController 14 | 15 | - (IBAction)presentStackViewFromButton:(UIButton *)button; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /UDStackView/Classes/Controller/UDMainViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // UDMainViewController.m 3 | // UDStackView 4 | // 5 | // Created by Rolandas Razma on 8/21/11. 6 | // Copyright (c) 2011 UD7. All rights reserved. 7 | // 8 | 9 | #import "UDMainViewController.h" 10 | #import "UDColoredViewController.h" 11 | 12 | 13 | @implementation UDMainViewController { 14 | UIButton *_activeStackButton; 15 | } 16 | 17 | 18 | #pragma mark - 19 | #pragma mark UIViewController 20 | 21 | 22 | - (void)viewDidLoad { 23 | [super viewDidLoad]; 24 | 25 | UIImageView *logoView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"ud7logo.png"]] autorelease]; 26 | [logoView setContentMode:UIViewContentModeScaleAspectFit]; 27 | [logoView setAutoresizingMask:(UIViewAutoresizingFlexibleHeight)]; 28 | [self.navigationItem setTitleView:logoView]; 29 | 30 | UIImageView *triangleView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"triangle.png"]] autorelease]; 31 | [triangleView setAutoresizingMask:UIViewAutoresizingFlexibleTopMargin]; 32 | [triangleView setFrame:CGRectMake((logoView.frame.size.width -triangleView.frame.size.width) /2, 43, triangleView.frame.size.width, triangleView.frame.size.height)]; 33 | [logoView addSubview:triangleView]; 34 | 35 | [self.navigationController.navigationBar setBarStyle:UIBarStyleBlack]; 36 | } 37 | 38 | 39 | - (void)didReceiveMemoryWarning { 40 | // we dont want view to unload so don't call supper 41 | } 42 | 43 | 44 | #pragma mark - 45 | #pragma mark UDMainViewController 46 | 47 | 48 | - (IBAction)presentStackViewFromButton:(UIButton *)button { 49 | _activeStackButton = button; 50 | 51 | // Im using single button, so im generating reuseIdentifier for each button 52 | NSString *reusableIdentifier = [_activeStackButton description]; 53 | 54 | if( ![(UDStackNavigationController *)self.navigationController presentStackWithIdentifier:reusableIdentifier animated:YES fromRect:button.frame] ){ 55 | UDColoredViewController *coloredViewController = [[[UDColoredViewController alloc] initWithColor:[UIColor yellowColor]] autorelease]; 56 | [(UDStackNavigationController *)self.navigationController presentViewController: coloredViewController 57 | animated: YES 58 | fromRect: button.frame 59 | withStackIdentifier: reusableIdentifier]; 60 | } 61 | 62 | } 63 | 64 | 65 | #pragma mark - 66 | #pragma mark UDStackViewControllerDelegate 67 | 68 | 69 | - (void)stackNavigationController:(UDStackNavigationController *)stackNavigationController willDismissViewController:(UIViewController *)viewController animated:(BOOL)animated { 70 | if( _activeStackButton.subviews.count ){ 71 | [_activeStackButton.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)]; 72 | } 73 | 74 | CGFloat angle = 0.09f; 75 | NSUInteger stackCount = 0; 76 | 77 | NSArray *stackViewCache = [stackNavigationController viewCacheForStackWithIdentifier:[_activeStackButton description]]; 78 | 79 | for ( UIImage *image in stackViewCache ) { 80 | UIImageView *imageView = [[[UIImageView alloc] initWithImage:image] autorelease]; 81 | [imageView setFrame:_activeStackButton.bounds]; 82 | [imageView setContentMode:UIViewContentModeScaleAspectFit]; 83 | [_activeStackButton addSubview:imageView]; 84 | 85 | stackCount++; 86 | if( stackCount < stackViewCache.count ){ 87 | [imageView setTransform: CGAffineTransformRotate(CGAffineTransformIdentity, angle *(stackCount%2?-1:1))]; 88 | } 89 | } 90 | 91 | } 92 | 93 | 94 | - (UIImage *)stackNavigationController:(UDStackNavigationController *)stackNavigationController presentationImageForStackWithIdentifier:(NSString *)stackIdentifier { 95 | UIImage *presentationImage = [[stackNavigationController viewCacheForStackWithIdentifier:stackIdentifier] lastObject]; 96 | return (presentationImage?presentationImage:[_activeStackButton imageForState:UIControlStateNormal]); 97 | } 98 | 99 | 100 | @end 101 | -------------------------------------------------------------------------------- /UDStackView/Classes/Support/UDStackViewController/UDStackNavigationController.h: -------------------------------------------------------------------------------- 1 | // 2 | // UDStackNavigationController.h 3 | // 4 | // Created by Rolandas Razma on 8/21/11. 5 | // Copyright (c) 2011 UD7. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | 11 | @interface UDStackNavigationController : UINavigationController 12 | 13 | - (void)presentViewController:(UIViewController *)viewController animated:(BOOL)animated fromRect:(CGRect)fromRect withStackIdentifier:(NSString *)stackIdentifier; 14 | - (BOOL)presentStackWithIdentifier:(NSString *)stackIdentifier animated:(BOOL)animated fromRect:(CGRect)fromRect; 15 | - (NSArray *)viewCacheForStackWithIdentifier:(NSString *)stackIdentifier; 16 | 17 | @end 18 | 19 | 20 | @protocol UDStackNavigationControllerDelegate 21 | @optional 22 | 23 | - (UIImage *)stackNavigationController:(UDStackNavigationController *)stackNavigationController presentationImageForStackWithIdentifier:(NSString *)stackIdentifier; 24 | - (void)stackNavigationController:(UDStackNavigationController *)stackNavigationController willDismissViewController:(UIViewController *)viewController animated:(BOOL)animated; 25 | 26 | @end -------------------------------------------------------------------------------- /UDStackView/Classes/Support/UDStackViewController/UDStackNavigationController.m: -------------------------------------------------------------------------------- 1 | // 2 | // UDStackNavigationController.m 3 | // 4 | // Created by Rolandas Razma on 8/21/11. 5 | // Copyright (c) 2011 UD7. All rights reserved. 6 | // 7 | 8 | #import "UDStackNavigationController.h" 9 | #import 10 | 11 | 12 | @interface UDStackNavigationController (UDPrivate) 13 | 14 | - (void)changeStackState; 15 | - (NSMutableArray *)activeStackViewCache; 16 | - (void)updateActiveStackViewCache; 17 | 18 | @end 19 | 20 | 21 | @implementation UDStackNavigationController { 22 | NSMutableDictionary *_stacks; 23 | NSString *_activeStackIdentifyer; 24 | CGRect _activeStackPresentationRect; 25 | NSMutableDictionary *_stacksViewCache; 26 | } 27 | 28 | 29 | #pragma mark - 30 | #pragma mark NSObject 31 | 32 | 33 | - (void)dealloc { 34 | [_stacks release]; 35 | [_activeStackIdentifyer release]; 36 | [_stacksViewCache release]; 37 | [super dealloc]; 38 | } 39 | 40 | 41 | #pragma mark - 42 | #pragma mark UIViewController 43 | 44 | 45 | - (void)viewDidLoad { 46 | [super viewDidLoad]; 47 | 48 | // Create state switching button 49 | UIButton *stackStateChangingButton = [UIButton buttonWithType:UIButtonTypeCustom]; 50 | [stackStateChangingButton setAutoresizingMask:(UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleRightMargin)]; 51 | [stackStateChangingButton setFrame:CGRectMake((self.navigationBar.frame.size.width -88) /2, 0, 88, self.navigationBar.frame.size.height)]; 52 | [stackStateChangingButton addTarget:self action:@selector(changeStackState) forControlEvents:UIControlEventTouchUpInside]; 53 | [self.navigationBar addSubview:stackStateChangingButton]; 54 | } 55 | 56 | 57 | - (void)didReceiveMemoryWarning { 58 | [super didReceiveMemoryWarning]; 59 | 60 | // Leave only recent 3 61 | for ( NSMutableArray *stackViewCache in [_stacksViewCache allValues] ) { 62 | if( stackViewCache.count > 3 ){ 63 | [stackViewCache removeObjectsAtIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, stackViewCache.count -3)]]; 64 | } 65 | } 66 | } 67 | 68 | 69 | #pragma mark - 70 | #pragma mark UINavigationController 71 | 72 | 73 | - (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated { 74 | NSAssert(!(self.viewControllers.count == 1 && animated), @"dont use -[UDStackNavigationController pushViewController:animated:YES] on first controller in stack. Use -[UDStackNavigationController presentViewController:fromRect:withIdentifier:]"); 75 | 76 | if( !_stacksViewCache ) { 77 | _stacksViewCache = [[NSMutableDictionary alloc] initWithCapacity:3]; 78 | } 79 | 80 | // Grab look of old view 81 | [self updateActiveStackViewCache]; 82 | 83 | [super pushViewController:viewController animated:animated]; 84 | } 85 | 86 | 87 | - (UIViewController *)popViewControllerAnimated:(BOOL)animated { 88 | NSMutableArray *viewCache = [self activeStackViewCache]; 89 | if( viewCache.count ){ 90 | [viewCache removeLastObject]; 91 | } 92 | return [super popViewControllerAnimated:animated]; 93 | } 94 | 95 | 96 | - (NSArray *)popToRootViewControllerAnimated:(BOOL)animated { 97 | NSAssert(!(self.viewControllers.count == 1), @"Already at root"); 98 | 99 | [_stacks setObject:self.viewControllers forKey:_activeStackIdentifyer]; 100 | 101 | if( animated ){ 102 | [self updateActiveStackViewCache]; 103 | 104 | if( [self.delegate respondsToSelector:@selector(stackNavigationController:willDismissViewController:animated:)] ){ 105 | [(id)self.delegate stackNavigationController:self willDismissViewController:self.topViewController animated:YES]; 106 | } 107 | 108 | [self setViewControllers:[NSArray arrayWithObject:[self.viewControllers objectAtIndex:0]] animated:NO]; 109 | 110 | // Create move cache 111 | UIImageView *imageView = [[UIImageView alloc] initWithImage: [self.activeStackViewCache lastObject]]; 112 | [imageView setContentMode:UIViewContentModeScaleAspectFit]; 113 | [imageView setFrame:self.topViewController.view.bounds]; 114 | [self.topViewController.view addSubview:imageView]; 115 | [imageView release]; 116 | 117 | // Animate transition 118 | [UIView animateWithDuration: 0.33f 119 | animations: ^{ 120 | [[UIApplication sharedApplication] beginIgnoringInteractionEvents]; 121 | [imageView setFrame:_activeStackPresentationRect]; 122 | } 123 | completion: ^(BOOL finished){ 124 | // Remove Cache View 125 | [imageView removeFromSuperview]; 126 | 127 | [[UIApplication sharedApplication] endIgnoringInteractionEvents]; 128 | }]; 129 | 130 | }else{ 131 | [self setViewControllers:[NSArray arrayWithObject:[self.viewControllers objectAtIndex:0]] animated:NO]; 132 | 133 | if( [self.delegate respondsToSelector:@selector(stackNavigationController:willDismissViewController:animated:)] ){ 134 | [(id)self.delegate stackNavigationController:self willDismissViewController:self.topViewController animated:NO]; 135 | } 136 | } 137 | 138 | return self.viewControllers; 139 | } 140 | 141 | 142 | #pragma mark - 143 | #pragma mark UDStackNavigationController 144 | 145 | 146 | - (NSMutableArray *)activeStackViewCache { 147 | return [_stacksViewCache objectForKey:_activeStackIdentifyer]; 148 | } 149 | 150 | 151 | - (void)updateActiveStackViewCache { 152 | 153 | if( self.viewControllers.count > 1 ){ 154 | NSMutableArray *activeStackViewCache = self.activeStackViewCache; 155 | if( !activeStackViewCache ){ 156 | activeStackViewCache = [NSMutableArray arrayWithCapacity:4]; 157 | [_stacksViewCache setObject:activeStackViewCache forKey:_activeStackIdentifyer]; 158 | } 159 | 160 | UIGraphicsBeginImageContext(self.topViewController.view.frame.size); 161 | [self.topViewController.view.layer renderInContext:UIGraphicsGetCurrentContext()]; 162 | if( activeStackViewCache.count < self.viewControllers.count -1 ){ 163 | [activeStackViewCache addObject:UIGraphicsGetImageFromCurrentImageContext()]; 164 | }else{ 165 | [activeStackViewCache replaceObjectAtIndex:self.viewControllers.count -2 withObject:UIGraphicsGetImageFromCurrentImageContext()]; 166 | } 167 | UIGraphicsEndImageContext(); 168 | } 169 | 170 | } 171 | 172 | 173 | - (NSArray *)viewCacheForStackWithIdentifier:(NSString *)stackIdentifier { 174 | return [_stacksViewCache objectForKey:stackIdentifier]; 175 | } 176 | 177 | 178 | - (void)changeStackState { 179 | if( self.viewControllers.count == 1 ){ 180 | if( _activeStackIdentifyer ){ 181 | [self presentStackWithIdentifier: _activeStackIdentifyer 182 | animated: YES 183 | fromRect: _activeStackPresentationRect]; 184 | } 185 | }else{ 186 | // more than root 187 | [self popToRootViewControllerAnimated:YES]; 188 | } 189 | } 190 | 191 | 192 | - (void)presentViewController:(UIViewController *)viewController animated:(BOOL)animated fromRect:(CGRect)fromRect withStackIdentifier:(NSString *)stackIdentifier { 193 | [_activeStackIdentifyer release]; 194 | _activeStackIdentifyer = [stackIdentifier copy]; 195 | _activeStackPresentationRect = fromRect; 196 | 197 | if( !animated ) { 198 | [self pushViewController:viewController animated:NO]; 199 | return; 200 | } 201 | 202 | NSAssert(!(self.viewControllers.count > 1), @"-[UDStackNavigationController presentViewController:fromRect:withIdentifier:] can be used only from rootViewController. Use -[UDStackNavigationController pushViewController:animated:YES] instead"); 203 | 204 | if( !_stacks ) _stacks = [[NSMutableDictionary alloc] initWithCapacity:4]; 205 | 206 | // Create move cache 207 | UIImage *presentationImage = [[self activeStackViewCache] lastObject]; 208 | if( !presentationImage && [self.delegate respondsToSelector:@selector(stackNavigationController:presentationImageForStackWithIdentifier:)] ){ 209 | presentationImage = [(id)self.delegate stackNavigationController:self presentationImageForStackWithIdentifier:_activeStackIdentifyer]; 210 | } 211 | 212 | UIImageView *imageView = [[UIImageView alloc] initWithImage:presentationImage]; 213 | [imageView setContentMode:UIViewContentModeScaleAspectFit]; 214 | [imageView setFrame:_activeStackPresentationRect]; 215 | [self.topViewController.view addSubview:imageView]; 216 | [imageView release]; 217 | 218 | // Animate transition 219 | [UIView animateWithDuration: 0.33f 220 | animations: ^{ 221 | [[UIApplication sharedApplication] beginIgnoringInteractionEvents]; 222 | [imageView setFrame:self.topViewController.view.bounds]; 223 | } 224 | completion: ^(BOOL finished){ 225 | [self pushViewController:viewController animated:NO]; 226 | [_stacks setObject:self.viewControllers forKey:_activeStackIdentifyer]; 227 | 228 | // Remove Cache View 229 | [imageView removeFromSuperview]; 230 | 231 | [[UIApplication sharedApplication] endIgnoringInteractionEvents]; 232 | }]; 233 | 234 | } 235 | 236 | 237 | - (BOOL)presentStackWithIdentifier:(NSString *)stackIdentifier animated:(BOOL)animated fromRect:(CGRect)fromRect { 238 | NSArray *stack = [_stacks objectForKey:stackIdentifier]; 239 | 240 | if( !stack ) return NO; 241 | 242 | [_activeStackIdentifyer release]; 243 | _activeStackIdentifyer = [stackIdentifier copy]; 244 | _activeStackPresentationRect = fromRect; 245 | 246 | if( !animated ){ 247 | [self setViewControllers:stack animated:NO]; 248 | } 249 | 250 | // Create move cache 251 | UIImageView *imageView = [[UIImageView alloc] initWithImage: [[self activeStackViewCache] lastObject]]; 252 | [imageView setContentMode:UIViewContentModeScaleAspectFit]; 253 | [imageView setFrame:fromRect]; 254 | [self.topViewController.view addSubview:imageView]; 255 | [imageView release]; 256 | 257 | // Animate transition 258 | [UIView animateWithDuration: 0.33f 259 | animations: ^{ 260 | [[UIApplication sharedApplication] beginIgnoringInteractionEvents]; 261 | [imageView setFrame:self.topViewController.view.bounds]; 262 | } 263 | completion: ^(BOOL finished){ 264 | [self setViewControllers:stack animated:NO]; 265 | 266 | // Remove Cache View 267 | [imageView removeFromSuperview]; 268 | 269 | [[UIApplication sharedApplication] endIgnoringInteractionEvents]; 270 | }]; 271 | 272 | 273 | return YES; 274 | } 275 | 276 | 277 | @end 278 | -------------------------------------------------------------------------------- /UDStackView/Classes/UDAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // UDAppDelegate.h 3 | // UDStackView 4 | // 5 | // Created by Rolandas Razma on 8/21/11. 6 | // Copyright (c) 2011 UD7. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface UDAppDelegate : UIResponder 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /UDStackView/Classes/UDAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // UDAppDelegate.m 3 | // UDStackView 4 | // 5 | // Created by Rolandas Razma on 8/21/11. 6 | // Copyright (c) 2011 UD7. All rights reserved. 7 | // 8 | 9 | #import "UDAppDelegate.h" 10 | #import "UDMainViewController.h" 11 | #import "UDStackNavigationController.h" 12 | 13 | 14 | @implementation UDAppDelegate { 15 | UIWindow *_window; 16 | } 17 | 18 | 19 | - (void)dealloc { 20 | [_window release]; 21 | [super dealloc]; 22 | } 23 | 24 | 25 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 26 | UDMainViewController *mainViewController = [[[UDMainViewController alloc] init] autorelease]; 27 | UDStackNavigationController *stackNavigationController = [[[UDStackNavigationController alloc] initWithRootViewController:mainViewController] autorelease]; 28 | [stackNavigationController setDelegate:mainViewController]; 29 | 30 | _window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 31 | [_window setRootViewController:stackNavigationController]; 32 | [_window makeKeyAndVisible]; 33 | 34 | return YES; 35 | } 36 | 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /UDStackView/Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'UDStackView' target in the 'UDStackView' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_4_0 8 | #warning "This project uses features only available in iOS SDK 4.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /UDStackView/Resources/Image/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ud7/UDStackViewController/30bc50ca2dec7a47aa8a09aab901a16d88135f24/UDStackView/Resources/Image/Default.png -------------------------------------------------------------------------------- /UDStackView/Resources/Image/Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ud7/UDStackViewController/30bc50ca2dec7a47aa8a09aab901a16d88135f24/UDStackView/Resources/Image/Icon.png -------------------------------------------------------------------------------- /UDStackView/Resources/Image/filler.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ud7/UDStackViewController/30bc50ca2dec7a47aa8a09aab901a16d88135f24/UDStackView/Resources/Image/filler.png -------------------------------------------------------------------------------- /UDStackView/Resources/Image/triangle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ud7/UDStackViewController/30bc50ca2dec7a47aa8a09aab901a16d88135f24/UDStackView/Resources/Image/triangle.png -------------------------------------------------------------------------------- /UDStackView/Resources/Image/ud7logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ud7/UDStackViewController/30bc50ca2dec7a47aa8a09aab901a16d88135f24/UDStackView/Resources/Image/ud7logo.png -------------------------------------------------------------------------------- /UDStackView/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFiles 12 | 13 | Icon.png 14 | 15 | CFBundleIcons 16 | 17 | CFBundlePrimaryIcon 18 | 19 | CFBundleIconFiles 20 | 21 | Icon.png 22 | 23 | UIPrerenderedIcon 24 | 25 | 26 | UINewsstandIcon 27 | 28 | CFBundleIconFiles 29 | 30 | UINewsstandBindingEdge 31 | UINewsstandBindingEdgeLeft 32 | UINewsstandBindingType 33 | UINewsstandBindingTypeMagazine 34 | 35 | 36 | CFBundleIdentifier 37 | com.ud7.${PRODUCT_NAME:rfc1034identifier} 38 | CFBundleInfoDictionaryVersion 39 | 6.0 40 | CFBundleName 41 | ${PRODUCT_NAME} 42 | CFBundlePackageType 43 | APPL 44 | CFBundleShortVersionString 45 | 1.0 46 | CFBundleSignature 47 | ???? 48 | CFBundleVersion 49 | 1.0 50 | LSRequiresIPhoneOS 51 | 52 | UIRequiresPersistentWiFi 53 | 54 | UIStatusBarStyle 55 | UIStatusBarStyleBlackOpaque 56 | UISupportedInterfaceOrientations 57 | 58 | UIInterfaceOrientationPortrait 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /UDStackView/Resources/View/UDColoredView.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1280 5 | 11B26 6 | 1923 7 | 1138 8 | 566.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 919 12 | 13 | 14 | YES 15 | IBUIButton 16 | IBUIView 17 | IBUILabel 18 | IBProxyObject 19 | 20 | 21 | YES 22 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 23 | 24 | 25 | PluginDependencyRecalculationVersion 26 | 27 | 28 | 29 | YES 30 | 31 | IBFilesOwner 32 | IBCocoaTouchFramework 33 | 34 | 35 | IBFirstResponder 36 | IBCocoaTouchFramework 37 | 38 | 39 | 40 | 274 41 | 42 | YES 43 | 44 | 45 | 298 46 | {{0, 207}, {320, 1}} 47 | 48 | 49 | _NS:312 50 | 51 | 1 52 | MSAwIDAAA 53 | 54 | NO 55 | YES 56 | 7 57 | NO 58 | IBCocoaTouchFramework 59 | 60 | 61 | 1 62 | MCAwIDAAA 63 | 64 | 65 | 1 66 | 10 67 | 68 | 1 69 | 17 70 | 71 | 72 | Helvetica 73 | 17 74 | 16 75 | 76 | 77 | 78 | 79 | 277 80 | {{160, 0}, {1, 416}} 81 | 82 | 83 | _NS:312 84 | 85 | NO 86 | YES 87 | 7 88 | NO 89 | IBCocoaTouchFramework 90 | 91 | 92 | 93 | 1 94 | 10 95 | 96 | 97 | 98 | 99 | 100 | -2147483358 101 | {320, 1} 102 | 103 | 104 | _NS:312 105 | 106 | NO 107 | YES 108 | 7 109 | NO 110 | IBCocoaTouchFramework 111 | 112 | 113 | 114 | 1 115 | 10 116 | 117 | 118 | 119 | 120 | 121 | -2147483382 122 | {{0, 415}, {320, 1}} 123 | 124 | 125 | _NS:312 126 | 127 | NO 128 | YES 129 | 7 130 | NO 131 | IBCocoaTouchFramework 132 | 133 | 134 | 135 | 1 136 | 10 137 | 138 | 139 | 140 | 141 | 142 | 269 143 | {{124, 359}, {72, 37}} 144 | 145 | 146 | _NS:209 147 | NO 148 | IBCocoaTouchFramework 149 | 0 150 | 0 151 | 1 152 | Next 153 | 154 | 3 155 | MQA 156 | 157 | 158 | 1 159 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 160 | 161 | 162 | 3 163 | MC41AA 164 | 165 | 166 | 2 167 | 15 168 | 169 | 170 | Helvetica-Bold 171 | 15 172 | 16 173 | 174 | 175 | 176 | 177 | 293 178 | {{110, 81}, {100, 100}} 179 | 180 | 181 | _NS:209 182 | NO 183 | IBCocoaTouchFramework 184 | 0 185 | 0 186 | 1 187 | 0 188 | 189 | 190 | 1 191 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 192 | 193 | 194 | 195 | 2 196 | 40 197 | 198 | 199 | Helvetica-Bold 200 | 40 201 | 16 202 | 203 | 204 | 205 | {{0, 64}, {320, 416}} 206 | 207 | 208 | 209 | 2 210 | MC45MzcyNTQ5NjUzIDAuOTQ1MDk4MTAyMSAwLjg5MDE5NjE0NDYAA 211 | 212 | 213 | 2 214 | 215 | 216 | 1 217 | NO 218 | 219 | IBCocoaTouchFramework 220 | 221 | 222 | 223 | 224 | YES 225 | 226 | 227 | view 228 | 229 | 230 | 231 | 3 232 | 233 | 234 | 235 | _countingButton 236 | 237 | 238 | 239 | 10 240 | 241 | 242 | 243 | nextColor 244 | 245 | 246 | 7 247 | 248 | 5 249 | 250 | 251 | 252 | increaseCount 253 | 254 | 255 | 7 256 | 257 | 11 258 | 259 | 260 | 261 | 262 | YES 263 | 264 | 0 265 | 266 | YES 267 | 268 | 269 | 270 | 271 | 272 | 1 273 | 274 | 275 | YES 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | -1 287 | 288 | 289 | File's Owner 290 | 291 | 292 | -2 293 | 294 | 295 | 296 | 297 | 4 298 | 299 | 300 | 301 | 302 | 6 303 | 304 | 305 | 306 | 307 | 8 308 | 309 | 310 | 311 | 312 | 9 313 | 314 | 315 | 316 | 317 | 12 318 | 319 | 320 | 321 | 322 | 13 323 | 324 | 325 | 326 | 327 | 328 | 329 | YES 330 | 331 | YES 332 | -1.CustomClassName 333 | -1.IBPluginDependency 334 | -2.CustomClassName 335 | -2.IBPluginDependency 336 | 1.IBPluginDependency 337 | 12.IBPluginDependency 338 | 13.IBPluginDependency 339 | 4.IBPluginDependency 340 | 6.IBPluginDependency 341 | 8.IBPluginDependency 342 | 9.IBPluginDependency 343 | 344 | 345 | YES 346 | UDColoredViewController 347 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 348 | UIResponder 349 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 350 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 351 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 352 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 353 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 354 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 355 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 356 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 357 | 358 | 359 | 360 | YES 361 | 362 | 363 | 364 | 365 | 366 | YES 367 | 368 | 369 | 370 | 371 | 13 372 | 373 | 374 | 0 375 | IBCocoaTouchFramework 376 | 377 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 378 | 379 | 380 | YES 381 | 3 382 | 919 383 | 384 | 385 | -------------------------------------------------------------------------------- /UDStackView/Resources/View/UDMainView.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1280 5 | 11B26 6 | 1923 7 | 1138 8 | 566.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 919 12 | 13 | 14 | YES 15 | IBUIButton 16 | IBUIView 17 | IBUILabel 18 | IBProxyObject 19 | 20 | 21 | YES 22 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 23 | 24 | 25 | PluginDependencyRecalculationVersion 26 | 27 | 28 | 29 | YES 30 | 31 | IBFilesOwner 32 | IBCocoaTouchFramework 33 | 34 | 35 | IBFirstResponder 36 | IBCocoaTouchFramework 37 | 38 | 39 | 40 | 274 41 | 42 | YES 43 | 44 | 45 | 298 46 | {{0, 207}, {320, 1}} 47 | 48 | 49 | _NS:312 50 | 51 | 1 52 | MSAwIDAAA 53 | 54 | NO 55 | YES 56 | 7 57 | NO 58 | IBCocoaTouchFramework 59 | 60 | 61 | 1 62 | MCAwIDAAA 63 | 64 | 65 | 1 66 | 10 67 | 68 | 1 69 | 17 70 | 71 | 72 | Helvetica 73 | 17 74 | 16 75 | 76 | 77 | 78 | 79 | 277 80 | {{160, 0}, {1, 416}} 81 | 82 | 83 | _NS:312 84 | 85 | NO 86 | YES 87 | 7 88 | NO 89 | IBCocoaTouchFramework 90 | 91 | 92 | 93 | 1 94 | 10 95 | 96 | 97 | 98 | 99 | 100 | 290 101 | {320, 1} 102 | 103 | 104 | _NS:312 105 | 106 | NO 107 | YES 108 | 7 109 | NO 110 | IBCocoaTouchFramework 111 | 112 | 113 | 114 | 1 115 | 10 116 | 117 | 118 | 119 | 120 | 121 | 266 122 | {{0, 415}, {320, 1}} 123 | 124 | 125 | _NS:312 126 | 127 | NO 128 | YES 129 | 7 130 | NO 131 | IBCocoaTouchFramework 132 | 133 | 134 | 135 | 1 136 | 10 137 | 138 | 139 | 140 | 141 | 142 | 300 143 | {{28, 51}, {116, 150}} 144 | 145 | 146 | _NS:209 147 | NO 148 | 1 149 | IBCocoaTouchFramework 150 | 0 151 | 0 152 | 153 | 3 154 | MQA 155 | 156 | 157 | 1 158 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 159 | 160 | 161 | 3 162 | MC41AA 163 | 164 | 165 | NSImage 166 | filler.png 167 | 168 | 169 | 2 170 | 15 171 | 172 | 173 | Helvetica-Bold 174 | 15 175 | 16 176 | 177 | 178 | 179 | 180 | 297 181 | {{176, 51}, {116, 150}} 182 | 183 | _NS:209 184 | NO 185 | 1 186 | IBCocoaTouchFramework 187 | 0 188 | 0 189 | 190 | 191 | 1 192 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 300 202 | {{28, 216}, {116, 150}} 203 | 204 | _NS:209 205 | NO 206 | 1 207 | IBCocoaTouchFramework 208 | 0 209 | 0 210 | 211 | 212 | 1 213 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 297 223 | {{176, 216}, {116, 150}} 224 | 225 | _NS:209 226 | NO 227 | 1 228 | IBCocoaTouchFramework 229 | 0 230 | 0 231 | 232 | 233 | 1 234 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | {{0, 64}, {320, 416}} 243 | 244 | 245 | 246 | 2 247 | MC45MzcyNTQ5NjUzIDAuOTQ1MDk4MTAyMSAwLjg5MDE5NjE0NDYAA 248 | 249 | 250 | 2 251 | 252 | 253 | 1 254 | NO 255 | 256 | IBCocoaTouchFramework 257 | 258 | 259 | 260 | 261 | YES 262 | 263 | 264 | view 265 | 266 | 267 | 268 | 3 269 | 270 | 271 | 272 | presentStackViewFromButton: 273 | 274 | 275 | 7 276 | 277 | 6 278 | 279 | 280 | 281 | presentStackViewFromButton: 282 | 283 | 284 | 7 285 | 286 | 45 287 | 288 | 289 | 290 | presentStackViewFromButton: 291 | 292 | 293 | 7 294 | 295 | 47 296 | 297 | 298 | 299 | presentStackViewFromButton: 300 | 301 | 302 | 7 303 | 304 | 49 305 | 306 | 307 | 308 | 309 | YES 310 | 311 | 0 312 | 313 | YES 314 | 315 | 316 | 317 | 318 | 319 | 1 320 | 321 | 322 | YES 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | -1 336 | 337 | 338 | File's Owner 339 | 340 | 341 | -2 342 | 343 | 344 | 345 | 346 | 21 347 | 348 | 349 | 350 | 351 | 22 352 | 353 | 354 | 355 | 356 | 29 357 | 358 | 359 | 360 | 361 | 30 362 | 363 | 364 | 365 | 366 | 4 367 | 368 | 369 | 370 | 371 | 44 372 | 373 | 374 | 375 | 376 | 46 377 | 378 | 379 | 380 | 381 | 48 382 | 383 | 384 | 385 | 386 | 387 | 388 | YES 389 | 390 | YES 391 | -1.CustomClassName 392 | -1.IBPluginDependency 393 | -2.CustomClassName 394 | -2.IBPluginDependency 395 | 1.IBPluginDependency 396 | 21.IBPluginDependency 397 | 22.IBPluginDependency 398 | 29.IBPluginDependency 399 | 30.IBPluginDependency 400 | 4.IBPluginDependency 401 | 4.IBUIButtonInspectorSelectedEdgeInsetMetadataKey 402 | 44.IBPluginDependency 403 | 44.IBUIButtonInspectorSelectedEdgeInsetMetadataKey 404 | 46.IBPluginDependency 405 | 46.IBUIButtonInspectorSelectedEdgeInsetMetadataKey 406 | 48.IBPluginDependency 407 | 48.IBUIButtonInspectorSelectedEdgeInsetMetadataKey 408 | 409 | 410 | YES 411 | UDMainViewController 412 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 413 | UIResponder 414 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 415 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 416 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 417 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 418 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 419 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 420 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 421 | 422 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 423 | 424 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 425 | 426 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 427 | 428 | 429 | 430 | 431 | YES 432 | 433 | 434 | 435 | 436 | 437 | YES 438 | 439 | 440 | 441 | 442 | 49 443 | 444 | 445 | 0 446 | IBCocoaTouchFramework 447 | 448 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 449 | 450 | 451 | YES 452 | 3 453 | 454 | filler.png 455 | {320, 416} 456 | 457 | 919 458 | 459 | 460 | -------------------------------------------------------------------------------- /UDStackView/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // UDStackView 4 | // 5 | // Created by Rolandas Razma on 8/21/11. 6 | // Copyright (c) 2011 UD7. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "UDAppDelegate.h" 11 | 12 | 13 | int main(int argc, char *argv[]) { 14 | @autoreleasepool { 15 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([UDAppDelegate class])); 16 | } 17 | } 18 | --------------------------------------------------------------------------------