├── Examples └── NavigationExample │ ├── NavigationExample.xcodeproj │ └── project.pbxproj │ └── NavigationExample │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Default-568h@2x.png │ ├── Default.png │ ├── Default@2x.png │ ├── DetailViewController.h │ ├── DetailViewController.m │ ├── MasterViewController.h │ ├── MasterViewController.m │ ├── NavigationExample-Info.plist │ ├── NavigationExample-Prefix.pch │ ├── en.lproj │ ├── DetailViewController.xib │ ├── InfoPlist.strings │ └── MasterViewController.xib │ └── main.m ├── LICENSE.md ├── OSNavigationController ├── OSNavigationController.h ├── OSNavigationController.m └── OSNavigationController.xib ├── README.md └── RELEASE NOTES.md /Examples/NavigationExample/NavigationExample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 01245C0C17BBD04F003EC7B9 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 01245C0B17BBD04F003EC7B9 /* UIKit.framework */; }; 11 | 01245C0E17BBD04F003EC7B9 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 01245C0D17BBD04F003EC7B9 /* Foundation.framework */; }; 12 | 01245C1017BBD04F003EC7B9 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 01245C0F17BBD04F003EC7B9 /* CoreGraphics.framework */; }; 13 | 01245C1617BBD04F003EC7B9 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 01245C1417BBD04F003EC7B9 /* InfoPlist.strings */; }; 14 | 01245C1817BBD04F003EC7B9 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 01245C1717BBD04F003EC7B9 /* main.m */; }; 15 | 01245C1C17BBD04F003EC7B9 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 01245C1B17BBD04F003EC7B9 /* AppDelegate.m */; }; 16 | 01245C1E17BBD04F003EC7B9 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 01245C1D17BBD04F003EC7B9 /* Default.png */; }; 17 | 01245C2017BBD04F003EC7B9 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 01245C1F17BBD04F003EC7B9 /* Default@2x.png */; }; 18 | 01245C2217BBD04F003EC7B9 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 01245C2117BBD04F003EC7B9 /* Default-568h@2x.png */; }; 19 | 01245C2517BBD04F003EC7B9 /* MasterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 01245C2417BBD04F003EC7B9 /* MasterViewController.m */; }; 20 | 01245C2817BBD04F003EC7B9 /* DetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 01245C2717BBD04F003EC7B9 /* DetailViewController.m */; }; 21 | 01245C2B17BBD04F003EC7B9 /* MasterViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 01245C2917BBD04F003EC7B9 /* MasterViewController.xib */; }; 22 | 01245C2E17BBD04F003EC7B9 /* DetailViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 01245C2C17BBD04F003EC7B9 /* DetailViewController.xib */; }; 23 | 01245C3817BBD057003EC7B9 /* OSNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 01245C3617BBD057003EC7B9 /* OSNavigationController.m */; }; 24 | 01245C3B17BBD34A003EC7B9 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 01245C3A17BBD34A003EC7B9 /* QuartzCore.framework */; }; 25 | 0138EDD317C8FCC90062F2F1 /* OSNavigationController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0138EDD217C8FCC90062F2F1 /* OSNavigationController.xib */; }; 26 | /* End PBXBuildFile section */ 27 | 28 | /* Begin PBXFileReference section */ 29 | 01245C0817BBD04F003EC7B9 /* NavigationExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NavigationExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 30 | 01245C0B17BBD04F003EC7B9 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 31 | 01245C0D17BBD04F003EC7B9 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 32 | 01245C0F17BBD04F003EC7B9 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 33 | 01245C1317BBD04F003EC7B9 /* NavigationExample-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "NavigationExample-Info.plist"; sourceTree = ""; }; 34 | 01245C1517BBD04F003EC7B9 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 35 | 01245C1717BBD04F003EC7B9 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 36 | 01245C1917BBD04F003EC7B9 /* NavigationExample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NavigationExample-Prefix.pch"; sourceTree = ""; }; 37 | 01245C1A17BBD04F003EC7B9 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 38 | 01245C1B17BBD04F003EC7B9 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 39 | 01245C1D17BBD04F003EC7B9 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; 40 | 01245C1F17BBD04F003EC7B9 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = ""; }; 41 | 01245C2117BBD04F003EC7B9 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; 42 | 01245C2317BBD04F003EC7B9 /* MasterViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MasterViewController.h; sourceTree = ""; }; 43 | 01245C2417BBD04F003EC7B9 /* MasterViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MasterViewController.m; sourceTree = ""; }; 44 | 01245C2617BBD04F003EC7B9 /* DetailViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DetailViewController.h; sourceTree = ""; }; 45 | 01245C2717BBD04F003EC7B9 /* DetailViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DetailViewController.m; sourceTree = ""; }; 46 | 01245C2A17BBD04F003EC7B9 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MasterViewController.xib; sourceTree = ""; }; 47 | 01245C2D17BBD04F003EC7B9 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/DetailViewController.xib; sourceTree = ""; }; 48 | 01245C3517BBD057003EC7B9 /* OSNavigationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSNavigationController.h; sourceTree = ""; }; 49 | 01245C3617BBD057003EC7B9 /* OSNavigationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OSNavigationController.m; sourceTree = ""; }; 50 | 01245C3A17BBD34A003EC7B9 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 51 | 0138EDD217C8FCC90062F2F1 /* OSNavigationController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = OSNavigationController.xib; sourceTree = ""; }; 52 | /* End PBXFileReference section */ 53 | 54 | /* Begin PBXFrameworksBuildPhase section */ 55 | 01245C0517BBD04F003EC7B9 /* Frameworks */ = { 56 | isa = PBXFrameworksBuildPhase; 57 | buildActionMask = 2147483647; 58 | files = ( 59 | 01245C3B17BBD34A003EC7B9 /* QuartzCore.framework in Frameworks */, 60 | 01245C0C17BBD04F003EC7B9 /* UIKit.framework in Frameworks */, 61 | 01245C0E17BBD04F003EC7B9 /* Foundation.framework in Frameworks */, 62 | 01245C1017BBD04F003EC7B9 /* CoreGraphics.framework in Frameworks */, 63 | ); 64 | runOnlyForDeploymentPostprocessing = 0; 65 | }; 66 | /* End PBXFrameworksBuildPhase section */ 67 | 68 | /* Begin PBXGroup section */ 69 | 01245BFF17BBD04F003EC7B9 = { 70 | isa = PBXGroup; 71 | children = ( 72 | 01245C3417BBD057003EC7B9 /* OSNavigationController */, 73 | 01245C1117BBD04F003EC7B9 /* NavigationExample */, 74 | 01245C0A17BBD04F003EC7B9 /* Frameworks */, 75 | 01245C0917BBD04F003EC7B9 /* Products */, 76 | ); 77 | sourceTree = ""; 78 | }; 79 | 01245C0917BBD04F003EC7B9 /* Products */ = { 80 | isa = PBXGroup; 81 | children = ( 82 | 01245C0817BBD04F003EC7B9 /* NavigationExample.app */, 83 | ); 84 | name = Products; 85 | sourceTree = ""; 86 | }; 87 | 01245C0A17BBD04F003EC7B9 /* Frameworks */ = { 88 | isa = PBXGroup; 89 | children = ( 90 | 01245C3A17BBD34A003EC7B9 /* QuartzCore.framework */, 91 | 01245C0B17BBD04F003EC7B9 /* UIKit.framework */, 92 | 01245C0D17BBD04F003EC7B9 /* Foundation.framework */, 93 | 01245C0F17BBD04F003EC7B9 /* CoreGraphics.framework */, 94 | ); 95 | name = Frameworks; 96 | sourceTree = ""; 97 | }; 98 | 01245C1117BBD04F003EC7B9 /* NavigationExample */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | 01245C1A17BBD04F003EC7B9 /* AppDelegate.h */, 102 | 01245C1B17BBD04F003EC7B9 /* AppDelegate.m */, 103 | 01245C2317BBD04F003EC7B9 /* MasterViewController.h */, 104 | 01245C2417BBD04F003EC7B9 /* MasterViewController.m */, 105 | 01245C2617BBD04F003EC7B9 /* DetailViewController.h */, 106 | 01245C2717BBD04F003EC7B9 /* DetailViewController.m */, 107 | 01245C2917BBD04F003EC7B9 /* MasterViewController.xib */, 108 | 01245C2C17BBD04F003EC7B9 /* DetailViewController.xib */, 109 | 01245C1217BBD04F003EC7B9 /* Supporting Files */, 110 | ); 111 | path = NavigationExample; 112 | sourceTree = ""; 113 | }; 114 | 01245C1217BBD04F003EC7B9 /* Supporting Files */ = { 115 | isa = PBXGroup; 116 | children = ( 117 | 01245C1317BBD04F003EC7B9 /* NavigationExample-Info.plist */, 118 | 01245C1417BBD04F003EC7B9 /* InfoPlist.strings */, 119 | 01245C1717BBD04F003EC7B9 /* main.m */, 120 | 01245C1917BBD04F003EC7B9 /* NavigationExample-Prefix.pch */, 121 | 01245C1D17BBD04F003EC7B9 /* Default.png */, 122 | 01245C1F17BBD04F003EC7B9 /* Default@2x.png */, 123 | 01245C2117BBD04F003EC7B9 /* Default-568h@2x.png */, 124 | ); 125 | name = "Supporting Files"; 126 | sourceTree = ""; 127 | }; 128 | 01245C3417BBD057003EC7B9 /* OSNavigationController */ = { 129 | isa = PBXGroup; 130 | children = ( 131 | 01245C3517BBD057003EC7B9 /* OSNavigationController.h */, 132 | 01245C3617BBD057003EC7B9 /* OSNavigationController.m */, 133 | 0138EDD217C8FCC90062F2F1 /* OSNavigationController.xib */, 134 | ); 135 | name = OSNavigationController; 136 | path = ../../OSNavigationController; 137 | sourceTree = ""; 138 | }; 139 | /* End PBXGroup section */ 140 | 141 | /* Begin PBXNativeTarget section */ 142 | 01245C0717BBD04F003EC7B9 /* NavigationExample */ = { 143 | isa = PBXNativeTarget; 144 | buildConfigurationList = 01245C3117BBD04F003EC7B9 /* Build configuration list for PBXNativeTarget "NavigationExample" */; 145 | buildPhases = ( 146 | 01245C0417BBD04F003EC7B9 /* Sources */, 147 | 01245C0517BBD04F003EC7B9 /* Frameworks */, 148 | 01245C0617BBD04F003EC7B9 /* Resources */, 149 | ); 150 | buildRules = ( 151 | ); 152 | dependencies = ( 153 | ); 154 | name = NavigationExample; 155 | productName = NavigationExample; 156 | productReference = 01245C0817BBD04F003EC7B9 /* NavigationExample.app */; 157 | productType = "com.apple.product-type.application"; 158 | }; 159 | /* End PBXNativeTarget section */ 160 | 161 | /* Begin PBXProject section */ 162 | 01245C0017BBD04F003EC7B9 /* Project object */ = { 163 | isa = PBXProject; 164 | attributes = { 165 | LastUpgradeCheck = 0460; 166 | ORGANIZATIONNAME = "Charcoal Design"; 167 | }; 168 | buildConfigurationList = 01245C0317BBD04F003EC7B9 /* Build configuration list for PBXProject "NavigationExample" */; 169 | compatibilityVersion = "Xcode 3.2"; 170 | developmentRegion = English; 171 | hasScannedForEncodings = 0; 172 | knownRegions = ( 173 | en, 174 | ); 175 | mainGroup = 01245BFF17BBD04F003EC7B9; 176 | productRefGroup = 01245C0917BBD04F003EC7B9 /* Products */; 177 | projectDirPath = ""; 178 | projectRoot = ""; 179 | targets = ( 180 | 01245C0717BBD04F003EC7B9 /* NavigationExample */, 181 | ); 182 | }; 183 | /* End PBXProject section */ 184 | 185 | /* Begin PBXResourcesBuildPhase section */ 186 | 01245C0617BBD04F003EC7B9 /* Resources */ = { 187 | isa = PBXResourcesBuildPhase; 188 | buildActionMask = 2147483647; 189 | files = ( 190 | 01245C1617BBD04F003EC7B9 /* InfoPlist.strings in Resources */, 191 | 01245C1E17BBD04F003EC7B9 /* Default.png in Resources */, 192 | 01245C2017BBD04F003EC7B9 /* Default@2x.png in Resources */, 193 | 01245C2217BBD04F003EC7B9 /* Default-568h@2x.png in Resources */, 194 | 01245C2B17BBD04F003EC7B9 /* MasterViewController.xib in Resources */, 195 | 01245C2E17BBD04F003EC7B9 /* DetailViewController.xib in Resources */, 196 | 0138EDD317C8FCC90062F2F1 /* OSNavigationController.xib in Resources */, 197 | ); 198 | runOnlyForDeploymentPostprocessing = 0; 199 | }; 200 | /* End PBXResourcesBuildPhase section */ 201 | 202 | /* Begin PBXSourcesBuildPhase section */ 203 | 01245C0417BBD04F003EC7B9 /* Sources */ = { 204 | isa = PBXSourcesBuildPhase; 205 | buildActionMask = 2147483647; 206 | files = ( 207 | 01245C1817BBD04F003EC7B9 /* main.m in Sources */, 208 | 01245C1C17BBD04F003EC7B9 /* AppDelegate.m in Sources */, 209 | 01245C2517BBD04F003EC7B9 /* MasterViewController.m in Sources */, 210 | 01245C2817BBD04F003EC7B9 /* DetailViewController.m in Sources */, 211 | 01245C3817BBD057003EC7B9 /* OSNavigationController.m in Sources */, 212 | ); 213 | runOnlyForDeploymentPostprocessing = 0; 214 | }; 215 | /* End PBXSourcesBuildPhase section */ 216 | 217 | /* Begin PBXVariantGroup section */ 218 | 01245C1417BBD04F003EC7B9 /* InfoPlist.strings */ = { 219 | isa = PBXVariantGroup; 220 | children = ( 221 | 01245C1517BBD04F003EC7B9 /* en */, 222 | ); 223 | name = InfoPlist.strings; 224 | sourceTree = ""; 225 | }; 226 | 01245C2917BBD04F003EC7B9 /* MasterViewController.xib */ = { 227 | isa = PBXVariantGroup; 228 | children = ( 229 | 01245C2A17BBD04F003EC7B9 /* en */, 230 | ); 231 | name = MasterViewController.xib; 232 | sourceTree = ""; 233 | }; 234 | 01245C2C17BBD04F003EC7B9 /* DetailViewController.xib */ = { 235 | isa = PBXVariantGroup; 236 | children = ( 237 | 01245C2D17BBD04F003EC7B9 /* en */, 238 | ); 239 | name = DetailViewController.xib; 240 | sourceTree = ""; 241 | }; 242 | /* End PBXVariantGroup section */ 243 | 244 | /* Begin XCBuildConfiguration section */ 245 | 01245C2F17BBD04F003EC7B9 /* Debug */ = { 246 | isa = XCBuildConfiguration; 247 | buildSettings = { 248 | ALWAYS_SEARCH_USER_PATHS = NO; 249 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 250 | CLANG_CXX_LIBRARY = "libc++"; 251 | CLANG_ENABLE_OBJC_ARC = YES; 252 | CLANG_WARN_CONSTANT_CONVERSION = YES; 253 | CLANG_WARN_EMPTY_BODY = YES; 254 | CLANG_WARN_ENUM_CONVERSION = YES; 255 | CLANG_WARN_INT_CONVERSION = YES; 256 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 257 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 258 | COPY_PHASE_STRIP = NO; 259 | GCC_C_LANGUAGE_STANDARD = gnu99; 260 | GCC_DYNAMIC_NO_PIC = NO; 261 | GCC_OPTIMIZATION_LEVEL = 0; 262 | GCC_PREPROCESSOR_DEFINITIONS = ( 263 | "DEBUG=1", 264 | "$(inherited)", 265 | ); 266 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 267 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 268 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 269 | GCC_WARN_UNUSED_VARIABLE = YES; 270 | IPHONEOS_DEPLOYMENT_TARGET = 6.1; 271 | ONLY_ACTIVE_ARCH = YES; 272 | SDKROOT = iphoneos; 273 | }; 274 | name = Debug; 275 | }; 276 | 01245C3017BBD04F003EC7B9 /* Release */ = { 277 | isa = XCBuildConfiguration; 278 | buildSettings = { 279 | ALWAYS_SEARCH_USER_PATHS = NO; 280 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 281 | CLANG_CXX_LIBRARY = "libc++"; 282 | CLANG_ENABLE_OBJC_ARC = YES; 283 | CLANG_WARN_CONSTANT_CONVERSION = YES; 284 | CLANG_WARN_EMPTY_BODY = YES; 285 | CLANG_WARN_ENUM_CONVERSION = YES; 286 | CLANG_WARN_INT_CONVERSION = YES; 287 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 288 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 289 | COPY_PHASE_STRIP = YES; 290 | GCC_C_LANGUAGE_STANDARD = gnu99; 291 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 292 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 293 | GCC_WARN_UNUSED_VARIABLE = YES; 294 | IPHONEOS_DEPLOYMENT_TARGET = 6.1; 295 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 296 | SDKROOT = iphoneos; 297 | VALIDATE_PRODUCT = YES; 298 | }; 299 | name = Release; 300 | }; 301 | 01245C3217BBD04F003EC7B9 /* Debug */ = { 302 | isa = XCBuildConfiguration; 303 | buildSettings = { 304 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 305 | GCC_PREFIX_HEADER = "NavigationExample/NavigationExample-Prefix.pch"; 306 | INFOPLIST_FILE = "NavigationExample/NavigationExample-Info.plist"; 307 | PRODUCT_NAME = "$(TARGET_NAME)"; 308 | WRAPPER_EXTENSION = app; 309 | }; 310 | name = Debug; 311 | }; 312 | 01245C3317BBD04F003EC7B9 /* Release */ = { 313 | isa = XCBuildConfiguration; 314 | buildSettings = { 315 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 316 | GCC_PREFIX_HEADER = "NavigationExample/NavigationExample-Prefix.pch"; 317 | INFOPLIST_FILE = "NavigationExample/NavigationExample-Info.plist"; 318 | PRODUCT_NAME = "$(TARGET_NAME)"; 319 | WRAPPER_EXTENSION = app; 320 | }; 321 | name = Release; 322 | }; 323 | /* End XCBuildConfiguration section */ 324 | 325 | /* Begin XCConfigurationList section */ 326 | 01245C0317BBD04F003EC7B9 /* Build configuration list for PBXProject "NavigationExample" */ = { 327 | isa = XCConfigurationList; 328 | buildConfigurations = ( 329 | 01245C2F17BBD04F003EC7B9 /* Debug */, 330 | 01245C3017BBD04F003EC7B9 /* Release */, 331 | ); 332 | defaultConfigurationIsVisible = 0; 333 | defaultConfigurationName = Release; 334 | }; 335 | 01245C3117BBD04F003EC7B9 /* Build configuration list for PBXNativeTarget "NavigationExample" */ = { 336 | isa = XCConfigurationList; 337 | buildConfigurations = ( 338 | 01245C3217BBD04F003EC7B9 /* Debug */, 339 | 01245C3317BBD04F003EC7B9 /* Release */, 340 | ); 341 | defaultConfigurationIsVisible = 0; 342 | defaultConfigurationName = Release; 343 | }; 344 | /* End XCConfigurationList section */ 345 | }; 346 | rootObject = 01245C0017BBD04F003EC7B9 /* Project object */; 347 | } 348 | -------------------------------------------------------------------------------- /Examples/NavigationExample/NavigationExample/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // NavigationExample 4 | // 5 | // Created by Nick Lockwood on 14/08/2013. 6 | // Copyright (c) 2013 Charcoal Design. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface AppDelegate : UIResponder 13 | 14 | @property (strong, nonatomic) UIWindow *window; 15 | @property (strong, nonatomic) UIViewController *navigationController; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Examples/NavigationExample/NavigationExample/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // NavigationExample 4 | // 5 | // Created by Nick Lockwood on 14/08/2013. 6 | // Copyright (c) 2013 Charcoal Design. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "MasterViewController.h" 11 | #import "OSNavigationController.h" 12 | 13 | 14 | @implementation AppDelegate 15 | 16 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 17 | { 18 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 19 | // Override point for customization after application launch. 20 | 21 | MasterViewController *masterViewController = [[MasterViewController alloc] initWithNibName:@"MasterViewController" bundle:nil]; 22 | self.navigationController = [[OSNavigationController alloc] initWithRootViewController:masterViewController]; 23 | self.window.rootViewController = self.navigationController; 24 | [self.window makeKeyAndVisible]; 25 | return YES; 26 | } 27 | 28 | - (void)applicationWillResignActive:(UIApplication *)application 29 | { 30 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 31 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 32 | } 33 | 34 | - (void)applicationDidEnterBackground:(UIApplication *)application 35 | { 36 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 37 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 38 | } 39 | 40 | - (void)applicationWillEnterForeground:(UIApplication *)application 41 | { 42 | // 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. 43 | } 44 | 45 | - (void)applicationDidBecomeActive:(UIApplication *)application 46 | { 47 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 48 | } 49 | 50 | - (void)applicationWillTerminate:(UIApplication *)application 51 | { 52 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 53 | } 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /Examples/NavigationExample/NavigationExample/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/OSNavigationController/a00eee5e04b3537845dc8aa53c9fd6c770859050/Examples/NavigationExample/NavigationExample/Default-568h@2x.png -------------------------------------------------------------------------------- /Examples/NavigationExample/NavigationExample/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/OSNavigationController/a00eee5e04b3537845dc8aa53c9fd6c770859050/Examples/NavigationExample/NavigationExample/Default.png -------------------------------------------------------------------------------- /Examples/NavigationExample/NavigationExample/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicklockwood/OSNavigationController/a00eee5e04b3537845dc8aa53c9fd6c770859050/Examples/NavigationExample/NavigationExample/Default@2x.png -------------------------------------------------------------------------------- /Examples/NavigationExample/NavigationExample/DetailViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DetailViewController.h 3 | // NavigationExample 4 | // 5 | // Created by Nick Lockwood on 14/08/2013. 6 | // Copyright (c) 2013 Charcoal Design. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DetailViewController : UIViewController 12 | 13 | @property (strong, nonatomic) id detailItem; 14 | 15 | @property (weak, nonatomic) IBOutlet UILabel *detailDescriptionLabel; 16 | @end 17 | -------------------------------------------------------------------------------- /Examples/NavigationExample/NavigationExample/DetailViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // DetailViewController.m 3 | // NavigationExample 4 | // 5 | // Created by Nick Lockwood on 14/08/2013. 6 | // Copyright (c) 2013 Charcoal Design. All rights reserved. 7 | // 8 | 9 | #import "DetailViewController.h" 10 | 11 | @interface DetailViewController () 12 | - (void)configureView; 13 | @end 14 | 15 | @implementation DetailViewController 16 | 17 | #pragma mark - Managing the detail item 18 | 19 | - (void)setDetailItem:(id)newDetailItem 20 | { 21 | if (_detailItem != newDetailItem) { 22 | _detailItem = newDetailItem; 23 | 24 | // Update the view. 25 | [self configureView]; 26 | } 27 | } 28 | 29 | - (void)configureView 30 | { 31 | // Update the user interface for the detail item. 32 | 33 | if (self.detailItem) { 34 | self.detailDescriptionLabel.text = [self.detailItem description]; 35 | } 36 | } 37 | 38 | - (void)viewDidLoad 39 | { 40 | [super viewDidLoad]; 41 | // Do any additional setup after loading the view, typically from a nib. 42 | [self configureView]; 43 | } 44 | 45 | - (void)didReceiveMemoryWarning 46 | { 47 | [super didReceiveMemoryWarning]; 48 | // Dispose of any resources that can be recreated. 49 | } 50 | 51 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 52 | { 53 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 54 | if (self) { 55 | self.title = NSLocalizedString(@"Detail", @"Detail"); 56 | } 57 | return self; 58 | } 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /Examples/NavigationExample/NavigationExample/MasterViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MasterViewController.h 3 | // NavigationExample 4 | // 5 | // Created by Nick Lockwood on 14/08/2013. 6 | // Copyright (c) 2013 Charcoal Design. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class DetailViewController; 12 | 13 | @interface MasterViewController : UITableViewController 14 | 15 | @property (strong, nonatomic) DetailViewController *detailViewController; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Examples/NavigationExample/NavigationExample/MasterViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MasterViewController.m 3 | // NavigationExample 4 | // 5 | // Created by Nick Lockwood on 14/08/2013. 6 | // Copyright (c) 2013 Charcoal Design. All rights reserved. 7 | // 8 | 9 | #import "MasterViewController.h" 10 | 11 | #import "DetailViewController.h" 12 | 13 | @interface MasterViewController () { 14 | NSMutableArray *_objects; 15 | } 16 | @end 17 | 18 | @implementation MasterViewController 19 | 20 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 21 | { 22 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 23 | if (self) { 24 | self.title = NSLocalizedString(@"Master", @"Master"); 25 | } 26 | return self; 27 | } 28 | 29 | - (void)viewDidLoad 30 | { 31 | [super viewDidLoad]; 32 | // Do any additional setup after loading the view, typically from a nib. 33 | self.navigationItem.leftBarButtonItem = self.editButtonItem; 34 | 35 | UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(insertNewObject:)]; 36 | self.navigationItem.rightBarButtonItem = addButton; 37 | } 38 | 39 | - (void)didReceiveMemoryWarning 40 | { 41 | [super didReceiveMemoryWarning]; 42 | // Dispose of any resources that can be recreated. 43 | } 44 | 45 | - (void)insertNewObject:(id)sender 46 | { 47 | if (!_objects) { 48 | _objects = [[NSMutableArray alloc] init]; 49 | } 50 | [_objects insertObject:[NSDate date] atIndex:0]; 51 | NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0]; 52 | [self.tableView insertRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic]; 53 | } 54 | 55 | #pragma mark - Table View 56 | 57 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 58 | { 59 | return 1; 60 | } 61 | 62 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 63 | { 64 | return _objects.count; 65 | } 66 | 67 | // Customize the appearance of table view cells. 68 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 69 | { 70 | static NSString *CellIdentifier = @"Cell"; 71 | 72 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 73 | if (cell == nil) { 74 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; 75 | cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; 76 | } 77 | 78 | 79 | NSDate *object = _objects[indexPath.row]; 80 | cell.textLabel.text = [object description]; 81 | return cell; 82 | } 83 | 84 | - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath 85 | { 86 | // Return NO if you do not want the specified item to be editable. 87 | return YES; 88 | } 89 | 90 | - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath 91 | { 92 | if (editingStyle == UITableViewCellEditingStyleDelete) { 93 | [_objects removeObjectAtIndex:indexPath.row]; 94 | [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade]; 95 | } else if (editingStyle == UITableViewCellEditingStyleInsert) { 96 | // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view. 97 | } 98 | } 99 | 100 | /* 101 | // Override to support rearranging the table view. 102 | - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath 103 | { 104 | } 105 | */ 106 | 107 | /* 108 | // Override to support conditional rearranging of the table view. 109 | - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath 110 | { 111 | // Return NO if you do not want the item to be re-orderable. 112 | return YES; 113 | } 114 | */ 115 | 116 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 117 | { 118 | if (!self.detailViewController) { 119 | self.detailViewController = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:nil]; 120 | } 121 | NSDate *object = _objects[indexPath.row]; 122 | self.detailViewController.detailItem = object; 123 | [self.navigationController pushViewController:self.detailViewController animated:YES]; 124 | } 125 | 126 | @end 127 | -------------------------------------------------------------------------------- /Examples/NavigationExample/NavigationExample/NavigationExample-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.charcoaldesign.${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 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UIStatusBarTintParameters 32 | 33 | UINavigationBar 34 | 35 | Style 36 | UIBarStyleDefault 37 | Translucent 38 | 39 | 40 | 41 | UISupportedInterfaceOrientations 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationLandscapeLeft 45 | UIInterfaceOrientationLandscapeRight 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /Examples/NavigationExample/NavigationExample/NavigationExample-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'NavigationExample' target in the 'NavigationExample' 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 | -------------------------------------------------------------------------------- /Examples/NavigationExample/NavigationExample/en.lproj/DetailViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1536 5 | 12A269 6 | 2835 7 | 1187 8 | 624.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 1919 12 | 13 | 14 | IBNSLayoutConstraint 15 | IBProxyObject 16 | IBUILabel 17 | IBUIView 18 | 19 | 20 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 21 | 22 | 23 | PluginDependencyRecalculationVersion 24 | 25 | 26 | 27 | 28 | IBFilesOwner 29 | IBCocoaTouchFramework 30 | 31 | 32 | IBFirstResponder 33 | IBCocoaTouchFramework 34 | 35 | 36 | 37 | 274 38 | 39 | 40 | 41 | 298 42 | {{20, 265}, {280, 18}} 43 | 44 | 45 | 46 | 47 | 3 48 | MQA 49 | 50 | YES 51 | NO 52 | IBCocoaTouchFramework 53 | Detail view content goes here 54 | 55 | 1 56 | MCAwIDAAA 57 | darkTextColor 58 | 59 | 60 | 1 61 | 10 62 | 1 63 | 64 | 1 65 | 4 66 | 67 | 68 | Helvetica 69 | 14 70 | 16 71 | 72 | 73 | 74 | {{0, 20}, {320, 548}} 75 | 76 | 77 | 78 | 79 | 3 80 | MQA 81 | 82 | 2 83 | 84 | 85 | 86 | 87 | IBUIScreenMetrics 88 | 89 | YES 90 | 91 | 92 | 93 | 94 | 95 | {320, 568} 96 | {568, 320} 97 | 98 | 99 | IBCocoaTouchFramework 100 | Retina 4 Full Screen 101 | 2 102 | 103 | IBCocoaTouchFramework 104 | 105 | 106 | 107 | 108 | 109 | 110 | view 111 | 112 | 113 | 114 | 3 115 | 116 | 117 | 118 | detailDescriptionLabel 119 | 120 | 121 | 122 | 6 123 | 124 | 125 | 126 | 127 | 128 | 0 129 | 130 | 131 | 132 | 133 | 134 | 1 135 | 136 | 137 | 138 | 139 | 10 140 | 0 141 | 142 | 10 143 | 1 144 | 145 | 0.0 146 | 147 | 1000 148 | 149 | 5 150 | 22 151 | 2 152 | 153 | 154 | 155 | 6 156 | 0 157 | 158 | 6 159 | 1 160 | 161 | 20 162 | 163 | 1000 164 | 165 | 8 166 | 29 167 | 3 168 | 169 | 170 | 171 | 5 172 | 0 173 | 174 | 5 175 | 1 176 | 177 | 20 178 | 179 | 1000 180 | 181 | 8 182 | 29 183 | 3 184 | 185 | 186 | 187 | 188 | 189 | 190 | -1 191 | 192 | 193 | File's Owner 194 | 195 | 196 | -2 197 | 198 | 199 | 200 | 201 | 4 202 | 203 | 204 | 205 | 206 | 7 207 | 208 | 209 | 210 | 211 | 9 212 | 213 | 214 | 215 | 216 | 11 217 | 218 | 219 | 220 | 221 | 222 | 223 | DetailViewController 224 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 225 | UIResponder 226 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 227 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 228 | 229 | 230 | 231 | 232 | 233 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 234 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 235 | 236 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 237 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 238 | 239 | 240 | 241 | 242 | 243 | 11 244 | 245 | 246 | 0 247 | IBCocoaTouchFramework 248 | YES 249 | 3 250 | YES 251 | 1919 252 | 253 | 254 | -------------------------------------------------------------------------------- /Examples/NavigationExample/NavigationExample/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Examples/NavigationExample/NavigationExample/en.lproj/MasterViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1536 5 | 12A269 6 | 2835 7 | 1187 8 | 624.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 1919 12 | 13 | 14 | IBProxyObject 15 | IBUITableView 16 | 17 | 18 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 19 | 20 | 21 | PluginDependencyRecalculationVersion 22 | 23 | 24 | 25 | 26 | IBFilesOwner 27 | IBCocoaTouchFramework 28 | 29 | 30 | IBFirstResponder 31 | IBCocoaTouchFramework 32 | 33 | 34 | 35 | 274 36 | {{0, 20}, {320, 548}} 37 | 38 | 39 | 40 | 41 | 3 42 | MQA 43 | 44 | YES 45 | 46 | 47 | IBUIScreenMetrics 48 | 49 | YES 50 | 51 | 52 | 53 | 54 | 55 | {320, 568} 56 | {568, 320} 57 | 58 | 59 | IBCocoaTouchFramework 60 | Retina 4 Full Screen 61 | 2 62 | 63 | IBCocoaTouchFramework 64 | YES 65 | 1 66 | 0 67 | YES 68 | 44 69 | 22 70 | 22 71 | 72 | 73 | 74 | 75 | 76 | 77 | view 78 | 79 | 80 | 81 | 3 82 | 83 | 84 | 85 | dataSource 86 | 87 | 88 | 89 | 4 90 | 91 | 92 | 93 | delegate 94 | 95 | 96 | 97 | 5 98 | 99 | 100 | 101 | 102 | 103 | 0 104 | 105 | 106 | 107 | 108 | 109 | -1 110 | 111 | 112 | File's Owner 113 | 114 | 115 | -2 116 | 117 | 118 | 119 | 120 | 2 121 | 122 | 123 | 124 | 125 | 126 | 127 | MasterViewController 128 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 129 | UIResponder 130 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 131 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 132 | 133 | 134 | 135 | 136 | 137 | 5 138 | 139 | 140 | 0 141 | IBCocoaTouchFramework 142 | YES 143 | 3 144 | YES 145 | 1919 146 | 147 | 148 | -------------------------------------------------------------------------------- /Examples/NavigationExample/NavigationExample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // NavigationExample 4 | // 5 | // Created by Nick Lockwood on 14/08/2013. 6 | // Copyright (c) 2013 Charcoal Design. 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 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | OSNavigationController 2 | version 1.0.3, August 24th, 2013 3 | 4 | Copyright (C) 2013 Charcoal Design 5 | 6 | This software is provided 'as-is', without any express or implied 7 | warranty. In no event will the authors be held liable for any damages 8 | arising from the use of this software. 9 | 10 | Permission is granted to anyone to use this software for any purpose, 11 | including commercial applications, and to alter it and redistribute it 12 | freely, subject to the following restrictions: 13 | 14 | 1. The origin of this software must not be misrepresented; you must not 15 | claim that you wrote the original software. If you use this software 16 | in a product, an acknowledgment in the product documentation would be 17 | appreciated but is not required. 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 3. This notice may not be removed or altered from any source distribution. -------------------------------------------------------------------------------- /OSNavigationController/OSNavigationController.h: -------------------------------------------------------------------------------- 1 | // 2 | // OSNavigationController.h 3 | // 4 | // Version 1.0.3 5 | // 6 | // Created by Nick Lockwood on 01/06/2013. 7 | // Copyright (C) 2011 Charcoal Design 8 | // 9 | // Distributed under the permissive zlib License 10 | // Get the latest version from here: 11 | // 12 | // https://github.com/nicklockwood/OSNavigationController 13 | // 14 | // This software is provided 'as-is', without any express or implied 15 | // warranty. In no event will the authors be held liable for any damages 16 | // arising from the use of this software. 17 | // 18 | // Permission is granted to anyone to use this software for any purpose, 19 | // including commercial applications, and to alter it and redistribute it 20 | // freely, subject to the following restrictions: 21 | // 22 | // 1. The origin of this software must not be misrepresented; you must not 23 | // claim that you wrote the original software. If you use this software 24 | // in a product, an acknowledgment in the product documentation would be 25 | // appreciated but is not required. 26 | // 27 | // 2. Altered source versions must be plainly marked as such, and must not be 28 | // misrepresented as being the original software. 29 | // 30 | // 3. This notice may not be removed or altered from any source distribution. 31 | // 32 | 33 | #import 34 | #import 35 | 36 | 37 | @interface OSNavigationController : UIViewController 38 | 39 | @property (nonatomic, strong, readonly) UIViewController *topViewController; 40 | @property (nonatomic, strong) NSArray *viewControllers; 41 | @property (nonatomic, strong, readonly) UINavigationBar *navigationBar; 42 | @property (nonatomic, assign) BOOL navigationBarHidden; 43 | @property (nonatomic, weak) id delegate; 44 | 45 | - (instancetype)initWithRootViewController:(UIViewController *)viewController; 46 | - (void)setViewControllers:(NSArray *)viewControllers animated:(BOOL)animated; 47 | - (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated; 48 | - (UIViewController *)popViewControllerAnimated:(BOOL)animated; 49 | - (NSArray *)popToRootViewControllerAnimated:(BOOL)animated; 50 | - (NSArray *)popToViewController:(UIViewController *)viewController animated:(BOOL)animated; 51 | - (void)setNavigationBarHidden:(BOOL)hidden animated:(BOOL)animated; 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /OSNavigationController/OSNavigationController.m: -------------------------------------------------------------------------------- 1 | // 2 | // OSNavigationController.h 3 | // 4 | // Version 1.0.3 5 | // 6 | // Created by Nick Lockwood on 01/06/2013. 7 | // Copyright (C) 2011 Charcoal Design 8 | // 9 | // Distributed under the permissive zlib License 10 | // Get the latest version from here: 11 | // 12 | // https://github.com/nicklockwood/OSNavigationController 13 | // 14 | // This software is provided 'as-is', without any express or implied 15 | // warranty. In no event will the authors be held liable for any damages 16 | // arising from the use of this software. 17 | // 18 | // Permission is granted to anyone to use this software for any purpose, 19 | // including commercial applications, and to alter it and redistribute it 20 | // freely, subject to the following restrictions: 21 | // 22 | // 1. The origin of this software must not be misrepresented; you must not 23 | // claim that you wrote the original software. If you use this software 24 | // in a product, an acknowledgment in the product documentation would be 25 | // appreciated but is not required. 26 | // 27 | // 2. Altered source versions must be plainly marked as such, and must not be 28 | // misrepresented as being the original software. 29 | // 30 | // 3. This notice may not be removed or altered from any source distribution. 31 | // 32 | 33 | #import "OSNavigationController.h" 34 | 35 | 36 | #import 37 | #if !__has_feature(objc_arc) 38 | #error This class requires automatic reference counting 39 | #endif 40 | 41 | 42 | @implementation NSObject (OSNavigationController) 43 | 44 | - (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated {}; 45 | - (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated {}; 46 | 47 | @end 48 | 49 | 50 | @interface OSNavigationController () 51 | 52 | @property (nonatomic, strong) IBOutlet UINavigationBar *navigationBar; 53 | @property (nonatomic, weak) IBOutlet UIView *transitionView; 54 | @property (nonatomic, weak) IBOutlet UIView *contentView; 55 | 56 | @property (nonatomic, assign) CGFloat navigationBarHeight; 57 | 58 | @end 59 | 60 | 61 | @implementation OSNavigationController 62 | 63 | - (instancetype)initWithRootViewController:(UIViewController *)viewController 64 | { 65 | if ((self = [self initWithNibName:nil bundle:nil])) 66 | { 67 | self.viewControllers = @[viewController]; 68 | } 69 | return self; 70 | } 71 | 72 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 73 | { 74 | if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) 75 | { 76 | _viewControllers = @[]; 77 | } 78 | return self; 79 | } 80 | 81 | - (void)viewDidLoad 82 | { 83 | [super viewDidLoad]; 84 | self.navigationBarHidden = self.navigationBarHidden; 85 | self.viewControllers = self.viewControllers; 86 | } 87 | 88 | - (void)setNavigationBar:(UINavigationBar *)navigationBar 89 | { 90 | _navigationBar.delegate = nil; 91 | _navigationBar = navigationBar; 92 | _navigationBar.delegate = self; 93 | _navigationBarHeight = navigationBar.frame.size.height; 94 | } 95 | 96 | - (void)setViewControllers:(NSArray *)viewControllers animated:(BOOL)animated 97 | { 98 | //get popped controllers 99 | for (UIViewController *controller in self.viewControllers) 100 | { 101 | if (![viewControllers containsObject:controller]) 102 | { 103 | [controller removeFromParentViewController]; 104 | } 105 | } 106 | 107 | //get pushed controllers 108 | NSString *direction = kCATransitionFromLeft; 109 | for (UIViewController *controller in viewControllers) 110 | { 111 | if (![self.viewControllers containsObject:controller]) 112 | { 113 | direction = kCATransitionFromRight; 114 | [self addChildViewController:controller]; 115 | } 116 | } 117 | 118 | //update view 119 | UIViewController *oldViewController = self.topViewController; 120 | _viewControllers = [viewControllers copy]; 121 | UIViewController *controller = self.topViewController; 122 | if (_contentView && controller.view.superview != _contentView) 123 | { 124 | [_delegate navigationController:(UINavigationController *)self 125 | willShowViewController:controller 126 | animated:animated]; 127 | 128 | //update navigation bar 129 | NSArray *navigationItems = [viewControllers valueForKeyPath:@"navigationItem"]; 130 | [_navigationBar setItems:navigationItems animated:animated]; 131 | 132 | //update content 133 | if (animated) 134 | { 135 | CATransition *transition = [CATransition animation]; 136 | transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; 137 | transition.duration = 0.33; 138 | transition.type = kCATransitionPush; 139 | transition.subtype = direction; 140 | [self.transitionView.layer addAnimation:transition forKey:nil]; 141 | 142 | controller.view.frame = _contentView.bounds; 143 | [UIView transitionFromView:oldViewController.view toView:controller.view duration:0 options:UIViewAnimationOptionTransitionNone completion:NULL]; 144 | } 145 | else 146 | { 147 | controller.view.frame = _contentView.bounds; 148 | [oldViewController.view removeFromSuperview]; 149 | [_contentView addSubview:controller.view]; 150 | } 151 | 152 | [_delegate navigationController:(UINavigationController *)self 153 | didShowViewController:controller 154 | animated:animated]; 155 | } 156 | } 157 | 158 | - (void)setViewControllers:(NSArray *)viewControllers 159 | { 160 | [self setViewControllers:viewControllers animated:NO]; 161 | } 162 | 163 | - (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated 164 | { 165 | [self setViewControllers:[self.viewControllers arrayByAddingObject:viewController] animated:animated]; 166 | } 167 | 168 | - (UIViewController *)popViewControllerAnimated:(BOOL)animated 169 | { 170 | if ([_viewControllers count] > 1) 171 | { 172 | return [[self popToViewController:_viewControllers[[_viewControllers count] - 2] 173 | animated:animated] lastObject]; 174 | } 175 | return nil; 176 | } 177 | 178 | - (NSArray *)popToRootViewControllerAnimated:(BOOL)animated 179 | { 180 | return [self popToViewController:self.viewControllers[0] animated:animated]; 181 | } 182 | 183 | - (NSArray *)popToViewController:(UIViewController *)viewController animated:(BOOL)animated 184 | { 185 | //pop to specified controller 186 | NSMutableArray *poppedControllers = [NSMutableArray array]; 187 | NSMutableArray *controllers = [NSMutableArray arrayWithArray:_viewControllers]; 188 | while ([controllers lastObject] && [controllers lastObject] != viewController) 189 | { 190 | [poppedControllers addObject:[controllers lastObject]]; 191 | [[controllers lastObject] removeFromParentViewController]; 192 | [controllers removeLastObject]; 193 | } 194 | 195 | [self setViewControllers:controllers animated:animated]; 196 | 197 | return poppedControllers; 198 | } 199 | 200 | - (UIViewController *)topViewController 201 | { 202 | return [_viewControllers lastObject]; 203 | } 204 | 205 | - (void)setNavigationBarHidden:(BOOL)hidden 206 | { 207 | _navigationBarHidden = hidden; 208 | [self.view layoutIfNeeded]; 209 | } 210 | 211 | - (void)viewWillLayoutSubviews 212 | { 213 | CGRect frame = _navigationBar.frame; 214 | if (self.view.window.rootViewController == self && [[UIDevice currentDevice].systemVersion floatValue] >= 7) 215 | { 216 | CGSize statusFrame = [UIApplication sharedApplication].statusBarFrame.size; 217 | frame.size.height = _navigationBarHeight + MIN(statusFrame.height, statusFrame.width); 218 | } 219 | frame.origin.y = _navigationBarHidden? -frame.size.height: 0; 220 | _navigationBar.frame = frame; 221 | frame = _contentView.frame; 222 | frame.origin.y = _navigationBarHidden? 0: _navigationBar.frame.size.height; 223 | frame.size.height = self.view.bounds.size.height - frame.origin.y; 224 | _contentView.frame = frame; 225 | } 226 | 227 | - (void)setNavigationBarHidden:(BOOL)hidden animated:(BOOL)animated 228 | { 229 | if (!animated) 230 | { 231 | self.navigationBarHidden = hidden; 232 | } 233 | else if (hidden != self.navigationBarHidden) 234 | { 235 | [UIView animateWithDuration:0.33 animations:^{ 236 | self.navigationBarHidden = hidden; 237 | }]; 238 | } 239 | } 240 | 241 | - (BOOL)navigationBar:(UINavigationBar *)navigationBar shouldPopItem:(UINavigationItem *)item 242 | { 243 | [self popViewControllerAnimated:YES]; 244 | return NO; 245 | } 246 | 247 | - (BOOL)isKindOfClass:(Class)aClass 248 | { 249 | //pretend that we're a UINavigationController if anyone asks 250 | if (aClass == [UINavigationController class]) 251 | { 252 | return YES; 253 | } 254 | return [super isKindOfClass:aClass]; 255 | } 256 | 257 | - (NSMethodSignature *)methodSignatureForSelector:(SEL)selector 258 | { 259 | //protect against calls to unimplemented UINavigationController methods 260 | NSMethodSignature *signature = [super methodSignatureForSelector:selector]; 261 | if (!signature) 262 | { 263 | signature = [UINavigationController instanceMethodSignatureForSelector:selector]; 264 | } 265 | return signature; 266 | } 267 | 268 | - (void)forwardInvocation:(NSInvocation *)invocation 269 | { 270 | [invocation invokeWithTarget:nil]; 271 | } 272 | 273 | @end 274 | -------------------------------------------------------------------------------- /OSNavigationController/OSNavigationController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1552 5 | 12E55 6 | 3084 7 | 1187.39 8 | 626.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 2083 12 | 13 | 14 | IBProxyObject 15 | IBUINavigationBar 16 | IBUINavigationItem 17 | IBUIView 18 | 19 | 20 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 21 | 22 | 23 | PluginDependencyRecalculationVersion 24 | 25 | 26 | 27 | 28 | IBFilesOwner 29 | IBCocoaTouchFramework 30 | 31 | 32 | IBFirstResponder 33 | IBCocoaTouchFramework 34 | 35 | 36 | 37 | 274 38 | 39 | 40 | 41 | 274 42 | 43 | 44 | 45 | 274 46 | {{0, 44}, {320, 504}} 47 | 48 | 49 | 50 | _NS:9 51 | 52 | 3 53 | MCAwAA 54 | 55 | IBCocoaTouchFramework 56 | 57 | 58 | {320, 548} 59 | 60 | 61 | 62 | _NS:9 63 | 64 | IBCocoaTouchFramework 65 | 66 | 67 | 68 | 290 69 | {320, 44} 70 | 71 | 72 | 73 | _NS:9 74 | IBCocoaTouchFramework 75 | 76 | 77 | 78 | 79 | IBCocoaTouchFramework 80 | 81 | 82 | 83 | 84 | {{0, 20}, {320, 548}} 85 | 86 | 87 | 88 | 89 | 3 90 | MQA 91 | 92 | 93 | 94 | IBUIScreenMetrics 95 | 96 | YES 97 | 98 | 99 | 100 | 101 | 102 | {320, 568} 103 | {568, 320} 104 | 105 | 106 | IBCocoaTouchFramework 107 | Retina 4 Full Screen 108 | 2 109 | 110 | IBCocoaTouchFramework 111 | 112 | 113 | 114 | 115 | 116 | 117 | view 118 | 119 | 120 | 121 | 3 122 | 123 | 124 | 125 | transitionView 126 | 127 | 128 | 129 | 9 130 | 131 | 132 | 133 | contentView 134 | 135 | 136 | 137 | 11 138 | 139 | 140 | 141 | navigationBar 142 | 143 | 144 | 145 | 14 146 | 147 | 148 | 149 | 150 | 151 | 0 152 | 153 | 154 | 155 | 156 | 157 | 1 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | -1 167 | 168 | 169 | File's Owner 170 | 171 | 172 | -2 173 | 174 | 175 | 176 | 177 | 4 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 10 186 | 187 | 188 | 189 | 190 | 12 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 13 199 | 200 | 201 | 202 | 203 | 204 | 205 | OSNavigationController 206 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 207 | UIResponder 208 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 209 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 210 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 211 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 212 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 213 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 214 | 215 | 216 | 217 | 218 | 219 | 14 220 | 221 | 222 | 223 | 224 | OSNavigationController 225 | UIViewController 226 | 227 | UIView 228 | UINavigationBar 229 | UIView 230 | 231 | 232 | 233 | contentView 234 | UIView 235 | 236 | 237 | navigationBar 238 | UINavigationBar 239 | 240 | 241 | transitionView 242 | UIView 243 | 244 | 245 | 246 | IBProjectSource 247 | ./Classes/OSNavigationController.h 248 | 249 | 250 | 251 | 252 | 0 253 | IBCocoaTouchFramework 254 | YES 255 | 3 256 | 2083 257 | 258 | 259 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | *************** 2 | WARNING: THIS PROJECT IS DEPRECATED 3 | ==================================== 4 | It will not receive any future updates or bug fixes. If you are using it, please migrate to another solution. 5 | *************** 6 | 7 | 8 | Purpose 9 | -------------- 10 | 11 | OSNavigationController is a open source re-implementation of UINavigationController. It currently features only a subset of the functionality of UINavigationController, but the long-term aim is to replicate 100% of the features. 12 | 13 | OSNavigationController is not really intended to be used as-is. The idea is that you can fork it and then easily customize its appearance and behaviour to suit any special requirements that your app may have. Customizing OSNavigationController is much simpler than trying to customize UINavigationController due to the fact that the code is open and you don't need to worry about private methods, undocumented behavior, or implementation changes between versions. 14 | 15 | 16 | Supported OS & SDK Versions 17 | ----------------------------- 18 | 19 | * Supported build target - iOS 6.1 (Xcode 4.6, Apple LLVM compiler 4.2) 20 | * Earliest supported deployment target - iOS 5.0 21 | * Earliest compatible deployment target - iOS 5.0 22 | 23 | NOTE: 'Supported' means that the library has been tested with this version. 'Compatible' means that the library should work on this OS version (i.e. it doesn't rely on any unavailable SDK features) but is no longer being tested for compatibility and may require tweaking or bug fixes to run correctly. 24 | 25 | 26 | ARC Compatibility 27 | ------------------ 28 | 29 | OSNavigationController requires ARC. If you wish to use OSNavigationController in a non-ARC project, just add the -fobjc-arc compiler flag to the OSNavigationController.m class. To do this, go to the Build Phases tab in your target settings, open the Compile Sources group, double-click OSNavigationController.m in the list and type -fobjc-arc into the popover. 30 | 31 | If you wish to convert your whole project to ARC, comment out the #error line in OSNavigationController.m, then run the Edit > Refactor > Convert to Objective-C ARC... tool in Xcode and make sure all files that you wish to use ARC for (including OSNavigationController.m) are checked. 32 | 33 | 34 | Installation 35 | -------------- 36 | 37 | To install OSNavigationController into your app, drag the OSNavigationController.h, .m and .xib files into your project and add the QuartzCore framework. Create and use the OSNavigationController exactly as you would a normal UINavigationController. 38 | -------------------------------------------------------------------------------- /RELEASE NOTES.md: -------------------------------------------------------------------------------- 1 | Version 1.0.3 2 | 3 | - Added transition view to improve animation when showing/hiding navbar between screens 4 | - Fixed crash on iOS 7 by proxying unsupported UINavigationController methods 5 | - Now resizes navigation bar correctly on iOS 7 6 | 7 | Version 1.0.2 8 | 9 | - Order of events is more similar to regular UINavigationController 10 | - Simplified code and reduced duplication 11 | - Several bug fixes 12 | 13 | Version 1.0.1 14 | 15 | - viewWill/Did[Dis]Appear: events now work correctly 16 | - Hiding navigation bar now expands content area to fill empty space 17 | 18 | Version 1.0 19 | 20 | - Initial release. --------------------------------------------------------------------------------