├── .gitattributes ├── .gitignore ├── Container View.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcuserdata │ │ └── aaqibhussain.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── aaqibhussain.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── Container View.xcscheme │ └── xcschememanagement.plist ├── Container View ├── ._AppDelegate.swift ├── ._ContainerViewController.swift ├── ._Empty.swift ├── ._FirstViewController.swift ├── ._SecondViewController.swift ├── ._ViewController.swift ├── AppDelegate.swift ├── Base.lproj │ ├── .DS_Store │ ├── ._.DS_Store │ ├── ._LaunchScreen.xib │ ├── LaunchScreen.xib │ └── Main.storyboard ├── ContainerViewController.swift ├── EmptySegue.swift ├── FirstViewController.swift ├── Images.xcassets │ └── AppIcon.appiconset │ │ ├── ._Contents.json │ │ └── Contents.json ├── Info.plist ├── SecondViewController.swift ├── Secondary.storyboard └── ViewController.swift ├── Container ViewTests ├── ._Container_ViewTests.swift ├── Container_ViewTests.swift └── Info.plist ├── LICENSE └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows image file caches 2 | Thumbs.db 3 | ehthumbs.db 4 | 5 | # Folder config file 6 | Desktop.ini 7 | 8 | # Recycle Bin used on file shares 9 | $RECYCLE.BIN/ 10 | 11 | # Windows Installer files 12 | *.cab 13 | *.msi 14 | *.msm 15 | *.msp 16 | 17 | # Windows shortcuts 18 | *.lnk 19 | 20 | # ========================= 21 | # Operating System Files 22 | # ========================= 23 | 24 | # OSX 25 | # ========================= 26 | 27 | .DS_Store 28 | .AppleDouble 29 | .LSOverride 30 | 31 | # Thumbnails 32 | ._* 33 | 34 | # Files that might appear on external disk 35 | .Spotlight-V100 36 | .Trashes 37 | 38 | # Directories potentially created on remote AFP share 39 | .AppleDB 40 | .AppleDesktop 41 | Network Trash Folder 42 | Temporary Items 43 | .apdisk 44 | -------------------------------------------------------------------------------- /Container View.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 7B47A7491FA4A07A00E396FE /* Secondary.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7B47A7481FA4A07A00E396FE /* Secondary.storyboard */; }; 11 | 7B5F33221B70DD0300EDE94B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B5F33211B70DD0300EDE94B /* AppDelegate.swift */; }; 12 | 7B5F33271B70DD0300EDE94B /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B5F33261B70DD0300EDE94B /* ViewController.swift */; }; 13 | 7B5F332A1B70DD0300EDE94B /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7B5F33281B70DD0300EDE94B /* Main.storyboard */; }; 14 | 7B5F332C1B70DD0300EDE94B /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7B5F332B1B70DD0300EDE94B /* Images.xcassets */; }; 15 | 7B5F332F1B70DD0300EDE94B /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7B5F332D1B70DD0300EDE94B /* LaunchScreen.xib */; }; 16 | 7B5F333B1B70DD0300EDE94B /* Container_ViewTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B5F333A1B70DD0300EDE94B /* Container_ViewTests.swift */; }; 17 | 7B5F33481B70DD8D00EDE94B /* ContainerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B5F33441B70DD8D00EDE94B /* ContainerViewController.swift */; }; 18 | 7B5F33491B70DD8D00EDE94B /* EmptySegue.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B5F33451B70DD8D00EDE94B /* EmptySegue.swift */; }; 19 | 7B5F334A1B70DD8D00EDE94B /* FirstViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B5F33461B70DD8D00EDE94B /* FirstViewController.swift */; }; 20 | 7B5F334B1B70DD8D00EDE94B /* SecondViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B5F33471B70DD8D00EDE94B /* SecondViewController.swift */; }; 21 | /* End PBXBuildFile section */ 22 | 23 | /* Begin PBXContainerItemProxy section */ 24 | 7B5F33351B70DD0300EDE94B /* PBXContainerItemProxy */ = { 25 | isa = PBXContainerItemProxy; 26 | containerPortal = 7B5F33141B70DD0300EDE94B /* Project object */; 27 | proxyType = 1; 28 | remoteGlobalIDString = 7B5F331B1B70DD0300EDE94B; 29 | remoteInfo = "Container View"; 30 | }; 31 | /* End PBXContainerItemProxy section */ 32 | 33 | /* Begin PBXFileReference section */ 34 | 7B47A7481FA4A07A00E396FE /* Secondary.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Secondary.storyboard; sourceTree = ""; }; 35 | 7B5F331C1B70DD0300EDE94B /* Container View.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Container View.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 36 | 7B5F33201B70DD0300EDE94B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 37 | 7B5F33211B70DD0300EDE94B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 38 | 7B5F33261B70DD0300EDE94B /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 39 | 7B5F33291B70DD0300EDE94B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 40 | 7B5F332B1B70DD0300EDE94B /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 41 | 7B5F332E1B70DD0300EDE94B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 42 | 7B5F33341B70DD0300EDE94B /* Container ViewTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Container ViewTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | 7B5F33391B70DD0300EDE94B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 44 | 7B5F333A1B70DD0300EDE94B /* Container_ViewTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Container_ViewTests.swift; sourceTree = ""; }; 45 | 7B5F33441B70DD8D00EDE94B /* ContainerViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContainerViewController.swift; sourceTree = ""; }; 46 | 7B5F33451B70DD8D00EDE94B /* EmptySegue.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EmptySegue.swift; sourceTree = ""; }; 47 | 7B5F33461B70DD8D00EDE94B /* FirstViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FirstViewController.swift; sourceTree = ""; }; 48 | 7B5F33471B70DD8D00EDE94B /* SecondViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SecondViewController.swift; sourceTree = ""; }; 49 | /* End PBXFileReference section */ 50 | 51 | /* Begin PBXFrameworksBuildPhase section */ 52 | 7B5F33191B70DD0300EDE94B /* Frameworks */ = { 53 | isa = PBXFrameworksBuildPhase; 54 | buildActionMask = 2147483647; 55 | files = ( 56 | ); 57 | runOnlyForDeploymentPostprocessing = 0; 58 | }; 59 | 7B5F33311B70DD0300EDE94B /* Frameworks */ = { 60 | isa = PBXFrameworksBuildPhase; 61 | buildActionMask = 2147483647; 62 | files = ( 63 | ); 64 | runOnlyForDeploymentPostprocessing = 0; 65 | }; 66 | /* End PBXFrameworksBuildPhase section */ 67 | 68 | /* Begin PBXGroup section */ 69 | 7B5F33131B70DD0300EDE94B = { 70 | isa = PBXGroup; 71 | children = ( 72 | 7B5F331E1B70DD0300EDE94B /* Container View */, 73 | 7B5F33371B70DD0300EDE94B /* Container ViewTests */, 74 | 7B5F331D1B70DD0300EDE94B /* Products */, 75 | ); 76 | sourceTree = ""; 77 | }; 78 | 7B5F331D1B70DD0300EDE94B /* Products */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 7B5F331C1B70DD0300EDE94B /* Container View.app */, 82 | 7B5F33341B70DD0300EDE94B /* Container ViewTests.xctest */, 83 | ); 84 | name = Products; 85 | sourceTree = ""; 86 | }; 87 | 7B5F331E1B70DD0300EDE94B /* Container View */ = { 88 | isa = PBXGroup; 89 | children = ( 90 | 7B66D2D11DAE344300C88F7C /* ContainerView */, 91 | 7B5F33461B70DD8D00EDE94B /* FirstViewController.swift */, 92 | 7B5F33471B70DD8D00EDE94B /* SecondViewController.swift */, 93 | 7B5F33211B70DD0300EDE94B /* AppDelegate.swift */, 94 | 7B5F33261B70DD0300EDE94B /* ViewController.swift */, 95 | 7B5F33281B70DD0300EDE94B /* Main.storyboard */, 96 | 7B47A7481FA4A07A00E396FE /* Secondary.storyboard */, 97 | 7B5F332B1B70DD0300EDE94B /* Images.xcassets */, 98 | 7B5F332D1B70DD0300EDE94B /* LaunchScreen.xib */, 99 | 7B5F331F1B70DD0300EDE94B /* Supporting Files */, 100 | ); 101 | path = "Container View"; 102 | sourceTree = ""; 103 | }; 104 | 7B5F331F1B70DD0300EDE94B /* Supporting Files */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | 7B5F33201B70DD0300EDE94B /* Info.plist */, 108 | ); 109 | name = "Supporting Files"; 110 | sourceTree = ""; 111 | }; 112 | 7B5F33371B70DD0300EDE94B /* Container ViewTests */ = { 113 | isa = PBXGroup; 114 | children = ( 115 | 7B5F333A1B70DD0300EDE94B /* Container_ViewTests.swift */, 116 | 7B5F33381B70DD0300EDE94B /* Supporting Files */, 117 | ); 118 | path = "Container ViewTests"; 119 | sourceTree = ""; 120 | }; 121 | 7B5F33381B70DD0300EDE94B /* Supporting Files */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | 7B5F33391B70DD0300EDE94B /* Info.plist */, 125 | ); 126 | name = "Supporting Files"; 127 | sourceTree = ""; 128 | }; 129 | 7B66D2D11DAE344300C88F7C /* ContainerView */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | 7B5F33451B70DD8D00EDE94B /* EmptySegue.swift */, 133 | 7B5F33441B70DD8D00EDE94B /* ContainerViewController.swift */, 134 | ); 135 | name = ContainerView; 136 | sourceTree = ""; 137 | }; 138 | /* End PBXGroup section */ 139 | 140 | /* Begin PBXNativeTarget section */ 141 | 7B5F331B1B70DD0300EDE94B /* Container View */ = { 142 | isa = PBXNativeTarget; 143 | buildConfigurationList = 7B5F333E1B70DD0300EDE94B /* Build configuration list for PBXNativeTarget "Container View" */; 144 | buildPhases = ( 145 | 7B5F33181B70DD0300EDE94B /* Sources */, 146 | 7B5F33191B70DD0300EDE94B /* Frameworks */, 147 | 7B5F331A1B70DD0300EDE94B /* Resources */, 148 | ); 149 | buildRules = ( 150 | ); 151 | dependencies = ( 152 | ); 153 | name = "Container View"; 154 | productName = "Container View"; 155 | productReference = 7B5F331C1B70DD0300EDE94B /* Container View.app */; 156 | productType = "com.apple.product-type.application"; 157 | }; 158 | 7B5F33331B70DD0300EDE94B /* Container ViewTests */ = { 159 | isa = PBXNativeTarget; 160 | buildConfigurationList = 7B5F33411B70DD0300EDE94B /* Build configuration list for PBXNativeTarget "Container ViewTests" */; 161 | buildPhases = ( 162 | 7B5F33301B70DD0300EDE94B /* Sources */, 163 | 7B5F33311B70DD0300EDE94B /* Frameworks */, 164 | 7B5F33321B70DD0300EDE94B /* Resources */, 165 | ); 166 | buildRules = ( 167 | ); 168 | dependencies = ( 169 | 7B5F33361B70DD0300EDE94B /* PBXTargetDependency */, 170 | ); 171 | name = "Container ViewTests"; 172 | productName = "Container ViewTests"; 173 | productReference = 7B5F33341B70DD0300EDE94B /* Container ViewTests.xctest */; 174 | productType = "com.apple.product-type.bundle.unit-test"; 175 | }; 176 | /* End PBXNativeTarget section */ 177 | 178 | /* Begin PBXProject section */ 179 | 7B5F33141B70DD0300EDE94B /* Project object */ = { 180 | isa = PBXProject; 181 | attributes = { 182 | LastSwiftMigration = 0730; 183 | LastSwiftUpdateCheck = 0730; 184 | LastUpgradeCheck = 0630; 185 | ORGANIZATIONNAME = "Kode Snippets"; 186 | TargetAttributes = { 187 | 7B5F331B1B70DD0300EDE94B = { 188 | CreatedOnToolsVersion = 6.3.1; 189 | LastSwiftMigration = 0940; 190 | }; 191 | 7B5F33331B70DD0300EDE94B = { 192 | CreatedOnToolsVersion = 6.3.1; 193 | LastSwiftMigration = 0940; 194 | TestTargetID = 7B5F331B1B70DD0300EDE94B; 195 | }; 196 | }; 197 | }; 198 | buildConfigurationList = 7B5F33171B70DD0300EDE94B /* Build configuration list for PBXProject "Container View" */; 199 | compatibilityVersion = "Xcode 3.2"; 200 | developmentRegion = English; 201 | hasScannedForEncodings = 0; 202 | knownRegions = ( 203 | en, 204 | Base, 205 | ); 206 | mainGroup = 7B5F33131B70DD0300EDE94B; 207 | productRefGroup = 7B5F331D1B70DD0300EDE94B /* Products */; 208 | projectDirPath = ""; 209 | projectRoot = ""; 210 | targets = ( 211 | 7B5F331B1B70DD0300EDE94B /* Container View */, 212 | 7B5F33331B70DD0300EDE94B /* Container ViewTests */, 213 | ); 214 | }; 215 | /* End PBXProject section */ 216 | 217 | /* Begin PBXResourcesBuildPhase section */ 218 | 7B5F331A1B70DD0300EDE94B /* Resources */ = { 219 | isa = PBXResourcesBuildPhase; 220 | buildActionMask = 2147483647; 221 | files = ( 222 | 7B5F332A1B70DD0300EDE94B /* Main.storyboard in Resources */, 223 | 7B5F332F1B70DD0300EDE94B /* LaunchScreen.xib in Resources */, 224 | 7B5F332C1B70DD0300EDE94B /* Images.xcassets in Resources */, 225 | 7B47A7491FA4A07A00E396FE /* Secondary.storyboard in Resources */, 226 | ); 227 | runOnlyForDeploymentPostprocessing = 0; 228 | }; 229 | 7B5F33321B70DD0300EDE94B /* Resources */ = { 230 | isa = PBXResourcesBuildPhase; 231 | buildActionMask = 2147483647; 232 | files = ( 233 | ); 234 | runOnlyForDeploymentPostprocessing = 0; 235 | }; 236 | /* End PBXResourcesBuildPhase section */ 237 | 238 | /* Begin PBXSourcesBuildPhase section */ 239 | 7B5F33181B70DD0300EDE94B /* Sources */ = { 240 | isa = PBXSourcesBuildPhase; 241 | buildActionMask = 2147483647; 242 | files = ( 243 | 7B5F334B1B70DD8D00EDE94B /* SecondViewController.swift in Sources */, 244 | 7B5F334A1B70DD8D00EDE94B /* FirstViewController.swift in Sources */, 245 | 7B5F33271B70DD0300EDE94B /* ViewController.swift in Sources */, 246 | 7B5F33491B70DD8D00EDE94B /* EmptySegue.swift in Sources */, 247 | 7B5F33481B70DD8D00EDE94B /* ContainerViewController.swift in Sources */, 248 | 7B5F33221B70DD0300EDE94B /* AppDelegate.swift in Sources */, 249 | ); 250 | runOnlyForDeploymentPostprocessing = 0; 251 | }; 252 | 7B5F33301B70DD0300EDE94B /* Sources */ = { 253 | isa = PBXSourcesBuildPhase; 254 | buildActionMask = 2147483647; 255 | files = ( 256 | 7B5F333B1B70DD0300EDE94B /* Container_ViewTests.swift in Sources */, 257 | ); 258 | runOnlyForDeploymentPostprocessing = 0; 259 | }; 260 | /* End PBXSourcesBuildPhase section */ 261 | 262 | /* Begin PBXTargetDependency section */ 263 | 7B5F33361B70DD0300EDE94B /* PBXTargetDependency */ = { 264 | isa = PBXTargetDependency; 265 | target = 7B5F331B1B70DD0300EDE94B /* Container View */; 266 | targetProxy = 7B5F33351B70DD0300EDE94B /* PBXContainerItemProxy */; 267 | }; 268 | /* End PBXTargetDependency section */ 269 | 270 | /* Begin PBXVariantGroup section */ 271 | 7B5F33281B70DD0300EDE94B /* Main.storyboard */ = { 272 | isa = PBXVariantGroup; 273 | children = ( 274 | 7B5F33291B70DD0300EDE94B /* Base */, 275 | ); 276 | name = Main.storyboard; 277 | sourceTree = ""; 278 | }; 279 | 7B5F332D1B70DD0300EDE94B /* LaunchScreen.xib */ = { 280 | isa = PBXVariantGroup; 281 | children = ( 282 | 7B5F332E1B70DD0300EDE94B /* Base */, 283 | ); 284 | name = LaunchScreen.xib; 285 | sourceTree = ""; 286 | }; 287 | /* End PBXVariantGroup section */ 288 | 289 | /* Begin XCBuildConfiguration section */ 290 | 7B5F333C1B70DD0300EDE94B /* Debug */ = { 291 | isa = XCBuildConfiguration; 292 | buildSettings = { 293 | ALWAYS_SEARCH_USER_PATHS = NO; 294 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 295 | CLANG_CXX_LIBRARY = "libc++"; 296 | CLANG_ENABLE_MODULES = YES; 297 | CLANG_ENABLE_OBJC_ARC = YES; 298 | CLANG_WARN_BOOL_CONVERSION = YES; 299 | CLANG_WARN_CONSTANT_CONVERSION = YES; 300 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 301 | CLANG_WARN_EMPTY_BODY = YES; 302 | CLANG_WARN_ENUM_CONVERSION = YES; 303 | CLANG_WARN_INT_CONVERSION = YES; 304 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 305 | CLANG_WARN_UNREACHABLE_CODE = YES; 306 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 307 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 308 | COPY_PHASE_STRIP = NO; 309 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 310 | ENABLE_STRICT_OBJC_MSGSEND = YES; 311 | GCC_C_LANGUAGE_STANDARD = gnu99; 312 | GCC_DYNAMIC_NO_PIC = NO; 313 | GCC_NO_COMMON_BLOCKS = YES; 314 | GCC_OPTIMIZATION_LEVEL = 0; 315 | GCC_PREPROCESSOR_DEFINITIONS = ( 316 | "DEBUG=1", 317 | "$(inherited)", 318 | ); 319 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 320 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 321 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 322 | GCC_WARN_UNDECLARED_SELECTOR = YES; 323 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 324 | GCC_WARN_UNUSED_FUNCTION = YES; 325 | GCC_WARN_UNUSED_VARIABLE = YES; 326 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 327 | MTL_ENABLE_DEBUG_INFO = YES; 328 | ONLY_ACTIVE_ARCH = YES; 329 | SDKROOT = iphoneos; 330 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 331 | SWIFT_VERSION = 2.3; 332 | }; 333 | name = Debug; 334 | }; 335 | 7B5F333D1B70DD0300EDE94B /* Release */ = { 336 | isa = XCBuildConfiguration; 337 | buildSettings = { 338 | ALWAYS_SEARCH_USER_PATHS = NO; 339 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 340 | CLANG_CXX_LIBRARY = "libc++"; 341 | CLANG_ENABLE_MODULES = YES; 342 | CLANG_ENABLE_OBJC_ARC = YES; 343 | CLANG_WARN_BOOL_CONVERSION = YES; 344 | CLANG_WARN_CONSTANT_CONVERSION = YES; 345 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 346 | CLANG_WARN_EMPTY_BODY = YES; 347 | CLANG_WARN_ENUM_CONVERSION = YES; 348 | CLANG_WARN_INT_CONVERSION = YES; 349 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 350 | CLANG_WARN_UNREACHABLE_CODE = YES; 351 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 352 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 353 | COPY_PHASE_STRIP = NO; 354 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 355 | ENABLE_NS_ASSERTIONS = NO; 356 | ENABLE_STRICT_OBJC_MSGSEND = YES; 357 | GCC_C_LANGUAGE_STANDARD = gnu99; 358 | GCC_NO_COMMON_BLOCKS = YES; 359 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 360 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 361 | GCC_WARN_UNDECLARED_SELECTOR = YES; 362 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 363 | GCC_WARN_UNUSED_FUNCTION = YES; 364 | GCC_WARN_UNUSED_VARIABLE = YES; 365 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 366 | MTL_ENABLE_DEBUG_INFO = NO; 367 | SDKROOT = iphoneos; 368 | SWIFT_VERSION = 2.3; 369 | VALIDATE_PRODUCT = YES; 370 | }; 371 | name = Release; 372 | }; 373 | 7B5F333F1B70DD0300EDE94B /* Debug */ = { 374 | isa = XCBuildConfiguration; 375 | buildSettings = { 376 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 377 | INFOPLIST_FILE = "Container View/Info.plist"; 378 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 379 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 380 | PRODUCT_NAME = "$(TARGET_NAME)"; 381 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 382 | SWIFT_VERSION = 4.0; 383 | }; 384 | name = Debug; 385 | }; 386 | 7B5F33401B70DD0300EDE94B /* Release */ = { 387 | isa = XCBuildConfiguration; 388 | buildSettings = { 389 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 390 | INFOPLIST_FILE = "Container View/Info.plist"; 391 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 392 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 393 | PRODUCT_NAME = "$(TARGET_NAME)"; 394 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 395 | SWIFT_VERSION = 4.0; 396 | }; 397 | name = Release; 398 | }; 399 | 7B5F33421B70DD0300EDE94B /* Debug */ = { 400 | isa = XCBuildConfiguration; 401 | buildSettings = { 402 | BUNDLE_LOADER = "$(TEST_HOST)"; 403 | FRAMEWORK_SEARCH_PATHS = ( 404 | "$(SDKROOT)/Developer/Library/Frameworks", 405 | "$(inherited)", 406 | ); 407 | GCC_PREPROCESSOR_DEFINITIONS = ( 408 | "DEBUG=1", 409 | "$(inherited)", 410 | ); 411 | INFOPLIST_FILE = "Container ViewTests/Info.plist"; 412 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 413 | PRODUCT_NAME = "$(TARGET_NAME)"; 414 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 415 | SWIFT_VERSION = 4.0; 416 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Container View.app/Container View"; 417 | }; 418 | name = Debug; 419 | }; 420 | 7B5F33431B70DD0300EDE94B /* Release */ = { 421 | isa = XCBuildConfiguration; 422 | buildSettings = { 423 | BUNDLE_LOADER = "$(TEST_HOST)"; 424 | FRAMEWORK_SEARCH_PATHS = ( 425 | "$(SDKROOT)/Developer/Library/Frameworks", 426 | "$(inherited)", 427 | ); 428 | INFOPLIST_FILE = "Container ViewTests/Info.plist"; 429 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 430 | PRODUCT_NAME = "$(TARGET_NAME)"; 431 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 432 | SWIFT_VERSION = 4.0; 433 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Container View.app/Container View"; 434 | }; 435 | name = Release; 436 | }; 437 | /* End XCBuildConfiguration section */ 438 | 439 | /* Begin XCConfigurationList section */ 440 | 7B5F33171B70DD0300EDE94B /* Build configuration list for PBXProject "Container View" */ = { 441 | isa = XCConfigurationList; 442 | buildConfigurations = ( 443 | 7B5F333C1B70DD0300EDE94B /* Debug */, 444 | 7B5F333D1B70DD0300EDE94B /* Release */, 445 | ); 446 | defaultConfigurationIsVisible = 0; 447 | defaultConfigurationName = Release; 448 | }; 449 | 7B5F333E1B70DD0300EDE94B /* Build configuration list for PBXNativeTarget "Container View" */ = { 450 | isa = XCConfigurationList; 451 | buildConfigurations = ( 452 | 7B5F333F1B70DD0300EDE94B /* Debug */, 453 | 7B5F33401B70DD0300EDE94B /* Release */, 454 | ); 455 | defaultConfigurationIsVisible = 0; 456 | defaultConfigurationName = Release; 457 | }; 458 | 7B5F33411B70DD0300EDE94B /* Build configuration list for PBXNativeTarget "Container ViewTests" */ = { 459 | isa = XCConfigurationList; 460 | buildConfigurations = ( 461 | 7B5F33421B70DD0300EDE94B /* Debug */, 462 | 7B5F33431B70DD0300EDE94B /* Release */, 463 | ); 464 | defaultConfigurationIsVisible = 0; 465 | defaultConfigurationName = Release; 466 | }; 467 | /* End XCConfigurationList section */ 468 | }; 469 | rootObject = 7B5F33141B70DD0300EDE94B /* Project object */; 470 | } 471 | -------------------------------------------------------------------------------- /Container View.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Container View.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Container View.xcodeproj/project.xcworkspace/xcuserdata/aaqibhussain.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iaaqibhussain/ContainerView/a690cb26bfa42ccb86a382b04d9dc20dd03fe0f5/Container View.xcodeproj/project.xcworkspace/xcuserdata/aaqibhussain.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Container View.xcodeproj/xcuserdata/aaqibhussain.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Container View.xcodeproj/xcuserdata/aaqibhussain.xcuserdatad/xcschemes/Container View.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 77 | 83 | 84 | 85 | 86 | 87 | 88 | 94 | 96 | 102 | 103 | 104 | 105 | 107 | 108 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /Container View.xcodeproj/xcuserdata/aaqibhussain.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Container View.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 7B5F331B1B70DD0300EDE94B 16 | 17 | primary 18 | 19 | 20 | 7B5F33331B70DD0300EDE94B 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Container View/._AppDelegate.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iaaqibhussain/ContainerView/a690cb26bfa42ccb86a382b04d9dc20dd03fe0f5/Container View/._AppDelegate.swift -------------------------------------------------------------------------------- /Container View/._ContainerViewController.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iaaqibhussain/ContainerView/a690cb26bfa42ccb86a382b04d9dc20dd03fe0f5/Container View/._ContainerViewController.swift -------------------------------------------------------------------------------- /Container View/._Empty.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iaaqibhussain/ContainerView/a690cb26bfa42ccb86a382b04d9dc20dd03fe0f5/Container View/._Empty.swift -------------------------------------------------------------------------------- /Container View/._FirstViewController.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iaaqibhussain/ContainerView/a690cb26bfa42ccb86a382b04d9dc20dd03fe0f5/Container View/._FirstViewController.swift -------------------------------------------------------------------------------- /Container View/._SecondViewController.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iaaqibhussain/ContainerView/a690cb26bfa42ccb86a382b04d9dc20dd03fe0f5/Container View/._SecondViewController.swift -------------------------------------------------------------------------------- /Container View/._ViewController.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iaaqibhussain/ContainerView/a690cb26bfa42ccb86a382b04d9dc20dd03fe0f5/Container View/._ViewController.swift -------------------------------------------------------------------------------- /Container View/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // 4 | // 5 | // Created by Aaqib Hussain on 04/08/2015. 6 | // Copyright (c) 2015 Kode Snippets. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import CoreData 11 | 12 | @UIApplicationMain 13 | class AppDelegate: UIResponder, UIApplicationDelegate { 14 | 15 | var window: UIWindow? 16 | 17 | 18 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 19 | // Override point for customization after application launch. 20 | return true 21 | } 22 | 23 | func applicationWillResignActive(_ application: UIApplication) { 24 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 26 | } 27 | 28 | func applicationDidEnterBackground(_ application: UIApplication) { 29 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | func applicationWillEnterForeground(_ application: UIApplication) { 34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 35 | } 36 | 37 | func applicationDidBecomeActive(_ application: UIApplication) { 38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 39 | } 40 | 41 | func applicationWillTerminate(_ application: UIApplication) { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | // Saves changes in the application's managed object context before the application terminates. 44 | self.saveContext() 45 | } 46 | 47 | // MARK: - Core Data stack 48 | 49 | lazy var applicationDocumentsDirectory: URL = { 50 | // The directory the application uses to store the Core Data store file. This code uses a directory named "com.KodeSnippets.Container_View" in the application's documents Application Support directory. 51 | let urls = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask) 52 | return urls[urls.count-1] 53 | }() 54 | 55 | lazy var managedObjectModel: NSManagedObjectModel = { 56 | // The managed object model for the application. This property is not optional. It is a fatal error for the application not to be able to find and load its model. 57 | let modelURL = Bundle.main.url(forResource: "Container_View", withExtension: "momd")! 58 | return NSManagedObjectModel(contentsOf: modelURL)! 59 | }() 60 | 61 | lazy var persistentStoreCoordinator: NSPersistentStoreCoordinator? = { 62 | // The persistent store coordinator for the application. This implementation creates and return a coordinator, having added the store for the application to it. This property is optional since there are legitimate error conditions that could cause the creation of the store to fail. 63 | // Create the coordinator and store 64 | var coordinator: NSPersistentStoreCoordinator? = NSPersistentStoreCoordinator(managedObjectModel: self.managedObjectModel) 65 | let url = self.applicationDocumentsDirectory.appendingPathComponent("Container_View.sqlite") 66 | var error: NSError? = nil 67 | var failureReason = "There was an error creating or loading the application's saved data." 68 | do { 69 | try coordinator!.addPersistentStore(ofType: NSSQLiteStoreType, configurationName: nil, at: url, options: nil) 70 | } catch var error1 as NSError { 71 | error = error1 72 | coordinator = nil 73 | // Report any error we got. 74 | var dict = [String: AnyObject]() 75 | dict[NSLocalizedDescriptionKey] = "Failed to initialize the application's saved data" as AnyObject? 76 | dict[NSLocalizedFailureReasonErrorKey] = failureReason as AnyObject? 77 | dict[NSUnderlyingErrorKey] = error 78 | error = NSError(domain: "YOUR_ERROR_DOMAIN", code: 9999, userInfo: dict) 79 | // Replace this with code to handle the error appropriately. 80 | // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. 81 | NSLog("Unresolved error \(String(describing: error)), \(error!.userInfo)") 82 | abort() 83 | } catch { 84 | fatalError() 85 | } 86 | 87 | return coordinator 88 | }() 89 | 90 | lazy var managedObjectContext: NSManagedObjectContext? = { 91 | // Returns the managed object context for the application (which is already bound to the persistent store coordinator for the application.) This property is optional since there are legitimate error conditions that could cause the creation of the context to fail. 92 | let coordinator = self.persistentStoreCoordinator 93 | if coordinator == nil { 94 | return nil 95 | } 96 | var managedObjectContext = NSManagedObjectContext() 97 | managedObjectContext.persistentStoreCoordinator = coordinator 98 | return managedObjectContext 99 | }() 100 | 101 | // MARK: - Core Data Saving support 102 | 103 | func saveContext () { 104 | if let moc = self.managedObjectContext { 105 | var error: NSError? = nil 106 | if moc.hasChanges { 107 | do { 108 | try moc.save() 109 | } catch let error1 as NSError { 110 | error = error1 111 | // Replace this implementation with code to handle the error appropriately. 112 | // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. 113 | NSLog("Unresolved error \(String(describing: error)), \(error!.userInfo)") 114 | abort() 115 | } 116 | } 117 | } 118 | } 119 | 120 | } 121 | 122 | -------------------------------------------------------------------------------- /Container View/Base.lproj/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iaaqibhussain/ContainerView/a690cb26bfa42ccb86a382b04d9dc20dd03fe0f5/Container View/Base.lproj/.DS_Store -------------------------------------------------------------------------------- /Container View/Base.lproj/._.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iaaqibhussain/ContainerView/a690cb26bfa42ccb86a382b04d9dc20dd03fe0f5/Container View/Base.lproj/._.DS_Store -------------------------------------------------------------------------------- /Container View/Base.lproj/._LaunchScreen.xib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iaaqibhussain/ContainerView/a690cb26bfa42ccb86a382b04d9dc20dd03fe0f5/Container View/Base.lproj/._LaunchScreen.xib -------------------------------------------------------------------------------- /Container View/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Container View/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 44 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 171 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | -------------------------------------------------------------------------------- /Container View/ContainerViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContainerViewController.swift 3 | // 4 | // 5 | // Created by Aaqib Hussain on 03/08/2015. 6 | // Copyright (c) 2015 Kode Snippets. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | open class ContainerViewController: UIViewController { 12 | //Manipulating container views 13 | fileprivate weak var viewController : UIViewController! 14 | //Keeping track of containerViews 15 | fileprivate var containerViewObjects = Dictionary() 16 | /** Pass in a tuple of required TimeInterval with UIViewAnimationOptions */ 17 | var animationDurationWithOptions:(TimeInterval, UIViewAnimationOptions) = (0,[]) 18 | 19 | /** Specifies which ever container view is on the front */ 20 | open var currentViewController : UIViewController{ 21 | get { 22 | return self.viewController 23 | 24 | } 25 | } 26 | /** Returns all the embedded controllers **/ 27 | open var viewControllers: [UIViewController] { 28 | return Array(containerViewObjects.values) 29 | } 30 | 31 | fileprivate var segueIdentifier : String! 32 | 33 | /*Identifier For First Container SubView*/ 34 | @IBInspectable internal var firstLinkedSubView : String! 35 | 36 | 37 | override open func viewDidLoad() { 38 | super.viewDidLoad() 39 | 40 | } 41 | open override func viewDidAppear(_ animated: Bool) { 42 | if let identifier = firstLinkedSubView{ 43 | segueIdentifierReceivedFromParent(identifier) 44 | } 45 | } 46 | override open func didReceiveMemoryWarning() { 47 | super.didReceiveMemoryWarning() 48 | // Dispose of any resources that can be recreated. 49 | } 50 | 51 | func segueIdentifierReceivedFromParent(_ identifier: String){ 52 | 53 | self.segueIdentifier = identifier 54 | self.performSegue(withIdentifier: self.segueIdentifier, sender: nil) 55 | 56 | } 57 | 58 | 59 | 60 | 61 | override open func prepare(for segue: UIStoryboardSegue, sender: Any?) { 62 | if segue.identifier == segueIdentifier{ 63 | //Remove Container View 64 | if viewController != nil{ 65 | viewController.view.removeFromSuperview() 66 | viewController = nil 67 | 68 | } 69 | //Add to dictionary if isn't already there 70 | if ((self.containerViewObjects[self.segueIdentifier] == nil)){ 71 | viewController = segue.destination 72 | self.containerViewObjects[self.segueIdentifier] = viewController 73 | 74 | }else{ 75 | for (key, value) in self.containerViewObjects{ 76 | 77 | if key == self.segueIdentifier{ 78 | viewController = value 79 | } 80 | } 81 | 82 | } 83 | UIView.transition(with: self.view, duration: animationDurationWithOptions.0, options: animationDurationWithOptions.1, animations: { 84 | self.addChildViewController(self.viewController) 85 | self.viewController.view.frame = CGRect(x: 0,y: 0, width: self.view.frame.width,height: self.view.frame.height) 86 | self.view.addSubview(self.viewController.view) 87 | }, completion: { (complete) in 88 | self.viewController.didMove(toParentViewController: self) 89 | }) 90 | 91 | 92 | 93 | } 94 | 95 | } 96 | 97 | 98 | } 99 | -------------------------------------------------------------------------------- /Container View/EmptySegue.swift: -------------------------------------------------------------------------------- 1 | // 2 | // EmptySegue.swift 3 | // 4 | // 5 | // Created by Aaqib Hussain on 03/08/2015. 6 | // Copyright (c) 2015 Kode Snippets. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class EmptySegue: UIStoryboardSegue{ 12 | 13 | override func perform() { 14 | 15 | } 16 | 17 | /* 18 | // MARK: - Navigation 19 | 20 | // In a storyboard-based application, you will often want to do a little preparation before navigation 21 | override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { 22 | // Get the new view controller using segue.destinationViewController. 23 | // Pass the selected object to the new view controller. 24 | } 25 | */ 26 | 27 | } 28 | -------------------------------------------------------------------------------- /Container View/FirstViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FirstViewController.swift 3 | // 4 | // 5 | // Created by Aaqib Hussain on 03/08/2015. 6 | // Copyright (c) 2015 Kode Snippets. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class FirstViewController: UIViewController { 12 | @IBOutlet var firstVCTextfield: UITextField! 13 | 14 | @IBOutlet var firstVCLabel: UILabel! 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | override func viewDidLoad() { 24 | super.viewDidLoad() 25 | 26 | } 27 | 28 | override func didReceiveMemoryWarning() { 29 | super.didReceiveMemoryWarning() 30 | 31 | } 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Container View/Images.xcassets/AppIcon.appiconset/._Contents.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iaaqibhussain/ContainerView/a690cb26bfa42ccb86a382b04d9dc20dd03fe0f5/Container View/Images.xcassets/AppIcon.appiconset/._Contents.json -------------------------------------------------------------------------------- /Container View/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /Container View/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.KodeSnippets.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Container View/SecondViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SecondViewController.swift 3 | // 4 | // 5 | // Created by Aaqib Hussain on 03/08/2015. 6 | // Copyright (c) 2015 Kode Snippets. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | protocol SecondViewDelegate: class { 11 | func sendToThirdViewController() 12 | } 13 | class SecondViewController: UIViewController { 14 | 15 | weak var delegate: SecondViewDelegate? = nil 16 | 17 | @IBOutlet weak var secondVCLabel: UILabel! 18 | override func viewDidLoad() { 19 | super.viewDidLoad() 20 | 21 | // Do any additional setup after loading the view. 22 | } 23 | 24 | override func didReceiveMemoryWarning() { 25 | super.didReceiveMemoryWarning() 26 | // Dispose of any resources that can be recreated. 27 | } 28 | 29 | @IBAction func goToThirdViewController(_ sender: UIButton) { 30 | delegate?.sendToThirdViewController() 31 | } 32 | 33 | /* 34 | // MARK: - Navigation 35 | 36 | // In a storyboard-based application, you will often want to do a little preparation before navigation 37 | override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { 38 | // Get the new view controller using segue.destinationViewController. 39 | // Pass the selected object to the new view controller. 40 | } 41 | */ 42 | 43 | } 44 | -------------------------------------------------------------------------------- /Container View/Secondary.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 50 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 212 | 218 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | -------------------------------------------------------------------------------- /Container View/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // 4 | // 5 | // Created by Aaqib Hussain on 03/08/2015. 6 | // Copyright (c) 2015 Kode Snippets. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController { 12 | 13 | 14 | 15 | var container: ContainerViewController! 16 | 17 | @IBOutlet var sendTextField: UITextField! 18 | 19 | 20 | 21 | override func viewDidLoad() { 22 | super.viewDidLoad() 23 | // Do any additional setup after loading the view, typically from a nib. 24 | 25 | } 26 | 27 | override func didReceiveMemoryWarning() { 28 | super.didReceiveMemoryWarning() 29 | // Dispose of any resources that can be recreated. 30 | } 31 | 32 | @IBAction func segmentControl(_ sender: UISegmentedControl) { 33 | 34 | 35 | if sender.selectedSegmentIndex == 0{ 36 | 37 | 38 | container!.segueIdentifierReceivedFromParent("first") 39 | 40 | }else{ 41 | 42 | container!.segueIdentifierReceivedFromParent("second") 43 | let controller = container.currentViewController as? SecondViewController 44 | controller?.delegate = self 45 | 46 | 47 | } 48 | 49 | } 50 | 51 | @IBAction func getText(_ sender: UIButton) { 52 | 53 | 54 | if let getFirstVCObject = self.container.currentViewController as? FirstViewController{ 55 | let getText = getFirstVCObject.firstVCTextfield.text! 56 | print(getText) 57 | } 58 | 59 | } 60 | 61 | 62 | 63 | @IBAction func sendAction(_ sender: AnyObject) { 64 | 65 | 66 | if container.currentViewController.isKind(of: FirstViewController.self){ 67 | 68 | if let getFirstVCObject = self.container.currentViewController as? FirstViewController 69 | { 70 | let getText = self.sendTextField.text 71 | getFirstVCObject.firstVCLabel.text = getText! 72 | 73 | 74 | } 75 | } 76 | else if container.currentViewController.isKind(of: SecondViewController.self){ 77 | 78 | if let getSecondVCObject = self.container.currentViewController as? SecondViewController 79 | { 80 | let getText = self.sendTextField.text 81 | getSecondVCObject.secondVCLabel.text = getText! 82 | 83 | 84 | } 85 | 86 | 87 | 88 | 89 | } 90 | 91 | } 92 | 93 | 94 | override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 95 | if segue.identifier == "container"{ 96 | container = segue.destination as! ContainerViewController 97 | //For adding animation to the transition of containerviews you can use container's object property 98 | // animationDurationWithOptions and pass in the time duration and transition animation option as a tuple 99 | // Animations that can be used 100 | // .transitionFlipFromLeft, .transitionFlipFromRight, .transitionCurlUp 101 | // .transitionCurlDown, .transitionCrossDissolve, .transitionFlipFromTop 102 | container.animationDurationWithOptions = (0.5, .transitionCrossDissolve) 103 | } 104 | } 105 | 106 | 107 | 108 | } 109 | extension ViewController: SecondViewDelegate{ 110 | 111 | func sendToThirdViewController() { 112 | container.segueIdentifierReceivedFromParent("third") 113 | } 114 | 115 | 116 | } 117 | -------------------------------------------------------------------------------- /Container ViewTests/._Container_ViewTests.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iaaqibhussain/ContainerView/a690cb26bfa42ccb86a382b04d9dc20dd03fe0f5/Container ViewTests/._Container_ViewTests.swift -------------------------------------------------------------------------------- /Container ViewTests/Container_ViewTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Container_ViewTests.swift 3 | // Container ViewTests 4 | // 5 | // Created by Aaqib Hussain on 04/08/2015. 6 | // Copyright (c) 2015 Kode Snippets. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import XCTest 11 | 12 | class Container_ViewTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | XCTAssert(true, "Pass") 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measure() { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /Container ViewTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.KodeSnippets.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Aaqib Hussain 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Container-View 2 | Using Container View in iOS with Swift 3 | 4 | Read tutorial: http://kodesnippets.com/container-view-in-ios/ 5 | 6 | In Objective-C 7 | https://github.com/iaaqibhussain/Container-View-Controller- 8 | 9 | Install Via Pod: 10 | https://github.com/iaaqibhussain/AHContainerViewController 11 | --------------------------------------------------------------------------------