├── .gitignore ├── .ruby-version ├── .travis.yml ├── Gemfile ├── Gemfile.lock ├── LICENSE ├── README.md ├── ViewControllerInCell-Example.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── xcshareddata │ └── xcschemes │ └── ViewControllerInCell-Example.xcscheme ├── ViewControllerInCell-Example ├── Application │ ├── AppDelegate.swift │ └── Info.plist ├── Extensions │ ├── CGFloat │ │ └── CGFloat+Random.swift │ └── UIColor │ │ └── UIColor+Random.swift ├── Resources │ └── Assets.xcassets │ │ └── AppIcon.appiconset │ │ └── Contents.json ├── Storyboards │ └── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard └── ViewControllers │ ├── Color │ └── ColorViewController.swift │ └── Colors │ ├── CollectionView │ ├── HostedViewCollectionViewCell.swift │ └── HostedViewCollectionViewViewController.swift │ └── TableView │ ├── HostedViewTableViewCell.swift │ └── HostedViewTableViewViewController.swift ├── ViewControllerInCell-ExampleTests ├── Info.plist └── ViewControllerInCell_ExampleTests.swift ├── ViewControllerInCell-ExampleUITests ├── Info.plist └── ViewControllerInCell_ExampleUITests.swift └── fastlane ├── Appfile ├── Fastfile └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xccheckout 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | ## Playgrounds 32 | timeline.xctimeline 33 | playground.xcworkspace 34 | 35 | # Swift Package Manager 36 | # 37 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 38 | # Packages/ 39 | # Package.pins 40 | .build/ 41 | 42 | # CocoaPods 43 | # 44 | # We recommend against adding the Pods directory to your .gitignore. However 45 | # you should judge for yourself, the pros and cons are mentioned at: 46 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 47 | # 48 | # Pods/ 49 | 50 | # Carthage 51 | # 52 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 53 | # Carthage/Checkouts 54 | 55 | Carthage/Build 56 | 57 | # fastlane 58 | # 59 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 60 | # screenshots whenever they are needed. 61 | # For more information about the recommended setup visit: 62 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 63 | 64 | fastlane/report.xml 65 | fastlane/Preview.html 66 | fastlane/screenshots 67 | fastlane/test_output 68 | -------------------------------------------------------------------------------- /.ruby-version: -------------------------------------------------------------------------------- 1 | 2.5.1 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | 3 | cache: 4 | - bundler 5 | 6 | osx_image: xcode11.3 7 | 8 | before_install: 9 | - bundle install 10 | 11 | script: 12 | - bundle exec fastlane run_unit_tests --verbose 13 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gem "fastlane", "2.146.1" 4 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | CFPropertyList (3.0.2) 5 | addressable (2.7.0) 6 | public_suffix (>= 2.0.2, < 5.0) 7 | atomos (0.1.3) 8 | aws-eventstream (1.1.0) 9 | aws-partitions (1.303.0) 10 | aws-sdk-core (3.94.0) 11 | aws-eventstream (~> 1, >= 1.0.2) 12 | aws-partitions (~> 1, >= 1.239.0) 13 | aws-sigv4 (~> 1.1) 14 | jmespath (~> 1.0) 15 | aws-sdk-kms (1.30.0) 16 | aws-sdk-core (~> 3, >= 3.71.0) 17 | aws-sigv4 (~> 1.1) 18 | aws-sdk-s3 (1.63.0) 19 | aws-sdk-core (~> 3, >= 3.83.0) 20 | aws-sdk-kms (~> 1) 21 | aws-sigv4 (~> 1.1) 22 | aws-sigv4 (1.1.2) 23 | aws-eventstream (~> 1.0, >= 1.0.2) 24 | babosa (1.0.3) 25 | claide (1.0.3) 26 | colored (1.2) 27 | colored2 (3.1.2) 28 | commander-fastlane (4.4.6) 29 | highline (~> 1.7.2) 30 | declarative (0.0.10) 31 | declarative-option (0.1.0) 32 | digest-crc (0.5.1) 33 | domain_name (0.5.20190701) 34 | unf (>= 0.0.5, < 1.0.0) 35 | dotenv (2.7.5) 36 | emoji_regex (1.0.1) 37 | excon (0.73.0) 38 | faraday (0.17.3) 39 | multipart-post (>= 1.2, < 3) 40 | faraday-cookie_jar (0.0.6) 41 | faraday (>= 0.7.4) 42 | http-cookie (~> 1.0.0) 43 | faraday_middleware (0.13.1) 44 | faraday (>= 0.7.4, < 1.0) 45 | fastimage (2.1.7) 46 | fastlane (2.146.1) 47 | CFPropertyList (>= 2.3, < 4.0.0) 48 | addressable (>= 2.3, < 3.0.0) 49 | aws-sdk-s3 (~> 1.0) 50 | babosa (>= 1.0.2, < 2.0.0) 51 | bundler (>= 1.12.0, < 3.0.0) 52 | colored 53 | commander-fastlane (>= 4.4.6, < 5.0.0) 54 | dotenv (>= 2.1.1, < 3.0.0) 55 | emoji_regex (>= 0.1, < 2.0) 56 | excon (>= 0.71.0, < 1.0.0) 57 | faraday (~> 0.17) 58 | faraday-cookie_jar (~> 0.0.6) 59 | faraday_middleware (~> 0.13.1) 60 | fastimage (>= 2.1.0, < 3.0.0) 61 | gh_inspector (>= 1.1.2, < 2.0.0) 62 | google-api-client (>= 0.29.2, < 0.37.0) 63 | google-cloud-storage (>= 1.15.0, < 2.0.0) 64 | highline (>= 1.7.2, < 2.0.0) 65 | json (< 3.0.0) 66 | jwt (~> 2.1.0) 67 | mini_magick (>= 4.9.4, < 5.0.0) 68 | multi_xml (~> 0.5) 69 | multipart-post (~> 2.0.0) 70 | plist (>= 3.1.0, < 4.0.0) 71 | public_suffix (~> 2.0.0) 72 | rubyzip (>= 1.3.0, < 2.0.0) 73 | security (= 0.1.3) 74 | simctl (~> 1.6.3) 75 | slack-notifier (>= 2.0.0, < 3.0.0) 76 | terminal-notifier (>= 2.0.0, < 3.0.0) 77 | terminal-table (>= 1.4.5, < 2.0.0) 78 | tty-screen (>= 0.6.3, < 1.0.0) 79 | tty-spinner (>= 0.8.0, < 1.0.0) 80 | word_wrap (~> 1.0.0) 81 | xcodeproj (>= 1.13.0, < 2.0.0) 82 | xcpretty (~> 0.3.0) 83 | xcpretty-travis-formatter (>= 0.0.3) 84 | gh_inspector (1.1.3) 85 | google-api-client (0.36.4) 86 | addressable (~> 2.5, >= 2.5.1) 87 | googleauth (~> 0.9) 88 | httpclient (>= 2.8.1, < 3.0) 89 | mini_mime (~> 1.0) 90 | representable (~> 3.0) 91 | retriable (>= 2.0, < 4.0) 92 | signet (~> 0.12) 93 | google-cloud-core (1.5.0) 94 | google-cloud-env (~> 1.0) 95 | google-cloud-errors (~> 1.0) 96 | google-cloud-env (1.3.1) 97 | faraday (>= 0.17.3, < 2.0) 98 | google-cloud-errors (1.0.0) 99 | google-cloud-storage (1.26.0) 100 | addressable (~> 2.5) 101 | digest-crc (~> 0.4) 102 | google-api-client (~> 0.33) 103 | google-cloud-core (~> 1.2) 104 | googleauth (~> 0.9) 105 | mini_mime (~> 1.0) 106 | googleauth (0.12.0) 107 | faraday (>= 0.17.3, < 2.0) 108 | jwt (>= 1.4, < 3.0) 109 | memoist (~> 0.16) 110 | multi_json (~> 1.11) 111 | os (>= 0.9, < 2.0) 112 | signet (~> 0.14) 113 | highline (1.7.10) 114 | http-cookie (1.0.3) 115 | domain_name (~> 0.5) 116 | httpclient (2.8.3) 117 | jmespath (1.4.0) 118 | json (2.3.0) 119 | jwt (2.1.0) 120 | memoist (0.16.2) 121 | mini_magick (4.10.1) 122 | mini_mime (1.0.2) 123 | multi_json (1.14.1) 124 | multi_xml (0.6.0) 125 | multipart-post (2.0.0) 126 | nanaimo (0.2.6) 127 | naturally (2.2.0) 128 | os (1.1.0) 129 | plist (3.5.0) 130 | public_suffix (2.0.5) 131 | representable (3.0.4) 132 | declarative (< 0.1.0) 133 | declarative-option (< 0.2.0) 134 | uber (< 0.2.0) 135 | retriable (3.1.2) 136 | rouge (2.0.7) 137 | rubyzip (1.3.0) 138 | security (0.1.3) 139 | signet (0.14.0) 140 | addressable (~> 2.3) 141 | faraday (>= 0.17.3, < 2.0) 142 | jwt (>= 1.5, < 3.0) 143 | multi_json (~> 1.10) 144 | simctl (1.6.8) 145 | CFPropertyList 146 | naturally 147 | slack-notifier (2.3.2) 148 | terminal-notifier (2.0.0) 149 | terminal-table (1.8.0) 150 | unicode-display_width (~> 1.1, >= 1.1.1) 151 | tty-cursor (0.7.1) 152 | tty-screen (0.7.1) 153 | tty-spinner (0.9.3) 154 | tty-cursor (~> 0.7) 155 | uber (0.1.0) 156 | unf (0.1.4) 157 | unf_ext 158 | unf_ext (0.0.7.7) 159 | unicode-display_width (1.7.0) 160 | word_wrap (1.0.0) 161 | xcodeproj (1.16.0) 162 | CFPropertyList (>= 2.3.3, < 4.0) 163 | atomos (~> 0.1.3) 164 | claide (>= 1.0.2, < 2.0) 165 | colored2 (~> 3.1) 166 | nanaimo (~> 0.2.6) 167 | xcpretty (0.3.0) 168 | rouge (~> 2.0.7) 169 | xcpretty-travis-formatter (1.0.0) 170 | xcpretty (~> 0.2, >= 0.0.7) 171 | 172 | PLATFORMS 173 | ruby 174 | 175 | DEPENDENCIES 176 | fastlane (= 2.146.1) 177 | 178 | BUNDLED WITH 179 | 1.16.4 180 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 William Boles 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 | [![Build Status](https://travis-ci.org/wibosco/TestingWithCoreData-Example.svg)](https://travis-ci.org/wibosco/ViewControllerInCell-Example) 2 | Swift 3 | Twitter: @wibosco 4 | 5 | # ViewControllerInCell-Example 6 | An example project looking at how to add a view controller's view as a subview in a cell, https://williamboles.com/hosting-viewcontrollers-in-cells/ 7 | -------------------------------------------------------------------------------- /ViewControllerInCell-Example.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 48; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 3D09B93D24573A060071B3A3 /* ColorViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D09B93424573A060071B3A3 /* ColorViewController.swift */; }; 11 | 3D09B93E24573A060071B3A3 /* HostedViewTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D09B93724573A060071B3A3 /* HostedViewTableViewCell.swift */; }; 12 | 3D09B93F24573A060071B3A3 /* HostedViewTableViewViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D09B93824573A060071B3A3 /* HostedViewTableViewViewController.swift */; }; 13 | 3D09B94024573A060071B3A3 /* HostedViewCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D09B93A24573A060071B3A3 /* HostedViewCollectionViewCell.swift */; }; 14 | 3D09B94124573A060071B3A3 /* HostedViewCollectionViewViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D09B93B24573A060071B3A3 /* HostedViewCollectionViewViewController.swift */; }; 15 | C28C8B5120738D1C0073DCAA /* ViewControllerInCell_ExampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C28C8B5020738D1C0073DCAA /* ViewControllerInCell_ExampleTests.swift */; }; 16 | C28C8B5C20738D1C0073DCAA /* ViewControllerInCell_ExampleUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C28C8B5B20738D1C0073DCAA /* ViewControllerInCell_ExampleUITests.swift */; }; 17 | C28C8B7720738D740073DCAA /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C28C8B6A20738D730073DCAA /* Assets.xcassets */; }; 18 | C28C8B7820738D740073DCAA /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C28C8B6C20738D730073DCAA /* LaunchScreen.storyboard */; }; 19 | C28C8B7920738D740073DCAA /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C28C8B6E20738D730073DCAA /* Main.storyboard */; }; 20 | C28C8B7A20738D740073DCAA /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C28C8B7120738D730073DCAA /* AppDelegate.swift */; }; 21 | C28C8B8320738E2F0073DCAA /* CGFloat+Random.swift in Sources */ = {isa = PBXBuildFile; fileRef = C28C8B7F20738E2F0073DCAA /* CGFloat+Random.swift */; }; 22 | C28C8B8520738E2F0073DCAA /* UIColor+Random.swift in Sources */ = {isa = PBXBuildFile; fileRef = C28C8B8220738E2F0073DCAA /* UIColor+Random.swift */; }; 23 | /* End PBXBuildFile section */ 24 | 25 | /* Begin PBXContainerItemProxy section */ 26 | C28C8B4D20738D1C0073DCAA /* PBXContainerItemProxy */ = { 27 | isa = PBXContainerItemProxy; 28 | containerPortal = C28C8B2E20738D1B0073DCAA /* Project object */; 29 | proxyType = 1; 30 | remoteGlobalIDString = C28C8B3520738D1B0073DCAA; 31 | remoteInfo = "ViewControllerInCell-Example"; 32 | }; 33 | C28C8B5820738D1C0073DCAA /* PBXContainerItemProxy */ = { 34 | isa = PBXContainerItemProxy; 35 | containerPortal = C28C8B2E20738D1B0073DCAA /* Project object */; 36 | proxyType = 1; 37 | remoteGlobalIDString = C28C8B3520738D1B0073DCAA; 38 | remoteInfo = "ViewControllerInCell-Example"; 39 | }; 40 | /* End PBXContainerItemProxy section */ 41 | 42 | /* Begin PBXFileReference section */ 43 | 3D09B93424573A060071B3A3 /* ColorViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ColorViewController.swift; sourceTree = ""; }; 44 | 3D09B93724573A060071B3A3 /* HostedViewTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HostedViewTableViewCell.swift; sourceTree = ""; }; 45 | 3D09B93824573A060071B3A3 /* HostedViewTableViewViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HostedViewTableViewViewController.swift; sourceTree = ""; }; 46 | 3D09B93A24573A060071B3A3 /* HostedViewCollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HostedViewCollectionViewCell.swift; sourceTree = ""; }; 47 | 3D09B93B24573A060071B3A3 /* HostedViewCollectionViewViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HostedViewCollectionViewViewController.swift; sourceTree = ""; }; 48 | C28C8B3620738D1B0073DCAA /* ViewControllerInCell-Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ViewControllerInCell-Example.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 49 | C28C8B4C20738D1C0073DCAA /* ViewControllerInCell-ExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "ViewControllerInCell-ExampleTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 50 | C28C8B5020738D1C0073DCAA /* ViewControllerInCell_ExampleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewControllerInCell_ExampleTests.swift; sourceTree = ""; }; 51 | C28C8B5220738D1C0073DCAA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 52 | C28C8B5720738D1C0073DCAA /* ViewControllerInCell-ExampleUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "ViewControllerInCell-ExampleUITests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 53 | C28C8B5B20738D1C0073DCAA /* ViewControllerInCell_ExampleUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewControllerInCell_ExampleUITests.swift; sourceTree = ""; }; 54 | C28C8B5D20738D1C0073DCAA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 55 | C28C8B6A20738D730073DCAA /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 56 | C28C8B6D20738D730073DCAA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 57 | C28C8B6F20738D730073DCAA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 58 | C28C8B7120738D730073DCAA /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 59 | C28C8B7220738D730073DCAA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 60 | C28C8B7F20738E2F0073DCAA /* CGFloat+Random.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "CGFloat+Random.swift"; sourceTree = ""; }; 61 | C28C8B8220738E2F0073DCAA /* UIColor+Random.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIColor+Random.swift"; sourceTree = ""; }; 62 | /* End PBXFileReference section */ 63 | 64 | /* Begin PBXFrameworksBuildPhase section */ 65 | C28C8B3320738D1B0073DCAA /* Frameworks */ = { 66 | isa = PBXFrameworksBuildPhase; 67 | buildActionMask = 2147483647; 68 | files = ( 69 | ); 70 | runOnlyForDeploymentPostprocessing = 0; 71 | }; 72 | C28C8B4920738D1C0073DCAA /* Frameworks */ = { 73 | isa = PBXFrameworksBuildPhase; 74 | buildActionMask = 2147483647; 75 | files = ( 76 | ); 77 | runOnlyForDeploymentPostprocessing = 0; 78 | }; 79 | C28C8B5420738D1C0073DCAA /* Frameworks */ = { 80 | isa = PBXFrameworksBuildPhase; 81 | buildActionMask = 2147483647; 82 | files = ( 83 | ); 84 | runOnlyForDeploymentPostprocessing = 0; 85 | }; 86 | /* End PBXFrameworksBuildPhase section */ 87 | 88 | /* Begin PBXGroup section */ 89 | 3D09B93324573A060071B3A3 /* Color */ = { 90 | isa = PBXGroup; 91 | children = ( 92 | 3D09B93424573A060071B3A3 /* ColorViewController.swift */, 93 | ); 94 | path = Color; 95 | sourceTree = ""; 96 | }; 97 | 3D09B93524573A060071B3A3 /* Colors */ = { 98 | isa = PBXGroup; 99 | children = ( 100 | 3D09B93624573A060071B3A3 /* TableView */, 101 | 3D09B93924573A060071B3A3 /* CollectionView */, 102 | ); 103 | path = Colors; 104 | sourceTree = ""; 105 | }; 106 | 3D09B93624573A060071B3A3 /* TableView */ = { 107 | isa = PBXGroup; 108 | children = ( 109 | 3D09B93724573A060071B3A3 /* HostedViewTableViewCell.swift */, 110 | 3D09B93824573A060071B3A3 /* HostedViewTableViewViewController.swift */, 111 | ); 112 | path = TableView; 113 | sourceTree = ""; 114 | }; 115 | 3D09B93924573A060071B3A3 /* CollectionView */ = { 116 | isa = PBXGroup; 117 | children = ( 118 | 3D09B93A24573A060071B3A3 /* HostedViewCollectionViewCell.swift */, 119 | 3D09B93B24573A060071B3A3 /* HostedViewCollectionViewViewController.swift */, 120 | ); 121 | path = CollectionView; 122 | sourceTree = ""; 123 | }; 124 | C28C8B2D20738D1B0073DCAA = { 125 | isa = PBXGroup; 126 | children = ( 127 | C28C8B3820738D1B0073DCAA /* ViewControllerInCell-Example */, 128 | C28C8B4F20738D1C0073DCAA /* ViewControllerInCell-ExampleTests */, 129 | C28C8B5A20738D1C0073DCAA /* ViewControllerInCell-ExampleUITests */, 130 | C28C8B3720738D1B0073DCAA /* Products */, 131 | ); 132 | sourceTree = ""; 133 | }; 134 | C28C8B3720738D1B0073DCAA /* Products */ = { 135 | isa = PBXGroup; 136 | children = ( 137 | C28C8B3620738D1B0073DCAA /* ViewControllerInCell-Example.app */, 138 | C28C8B4C20738D1C0073DCAA /* ViewControllerInCell-ExampleTests.xctest */, 139 | C28C8B5720738D1C0073DCAA /* ViewControllerInCell-ExampleUITests.xctest */, 140 | ); 141 | name = Products; 142 | sourceTree = ""; 143 | }; 144 | C28C8B3820738D1B0073DCAA /* ViewControllerInCell-Example */ = { 145 | isa = PBXGroup; 146 | children = ( 147 | C28C8B7020738D730073DCAA /* Application */, 148 | C28C8B7320738D740073DCAA /* Extensions */, 149 | C28C8B6920738D730073DCAA /* Resources */, 150 | C28C8B6B20738D730073DCAA /* Storyboards */, 151 | C28C8B7420738D740073DCAA /* ViewControllers */, 152 | ); 153 | path = "ViewControllerInCell-Example"; 154 | sourceTree = ""; 155 | }; 156 | C28C8B4F20738D1C0073DCAA /* ViewControllerInCell-ExampleTests */ = { 157 | isa = PBXGroup; 158 | children = ( 159 | C28C8B5020738D1C0073DCAA /* ViewControllerInCell_ExampleTests.swift */, 160 | C28C8B5220738D1C0073DCAA /* Info.plist */, 161 | ); 162 | path = "ViewControllerInCell-ExampleTests"; 163 | sourceTree = ""; 164 | }; 165 | C28C8B5A20738D1C0073DCAA /* ViewControllerInCell-ExampleUITests */ = { 166 | isa = PBXGroup; 167 | children = ( 168 | C28C8B5B20738D1C0073DCAA /* ViewControllerInCell_ExampleUITests.swift */, 169 | C28C8B5D20738D1C0073DCAA /* Info.plist */, 170 | ); 171 | path = "ViewControllerInCell-ExampleUITests"; 172 | sourceTree = ""; 173 | }; 174 | C28C8B6920738D730073DCAA /* Resources */ = { 175 | isa = PBXGroup; 176 | children = ( 177 | C28C8B6A20738D730073DCAA /* Assets.xcassets */, 178 | ); 179 | path = Resources; 180 | sourceTree = ""; 181 | }; 182 | C28C8B6B20738D730073DCAA /* Storyboards */ = { 183 | isa = PBXGroup; 184 | children = ( 185 | C28C8B6C20738D730073DCAA /* LaunchScreen.storyboard */, 186 | C28C8B6E20738D730073DCAA /* Main.storyboard */, 187 | ); 188 | path = Storyboards; 189 | sourceTree = ""; 190 | }; 191 | C28C8B7020738D730073DCAA /* Application */ = { 192 | isa = PBXGroup; 193 | children = ( 194 | C28C8B7120738D730073DCAA /* AppDelegate.swift */, 195 | C28C8B7220738D730073DCAA /* Info.plist */, 196 | ); 197 | path = Application; 198 | sourceTree = ""; 199 | }; 200 | C28C8B7320738D740073DCAA /* Extensions */ = { 201 | isa = PBXGroup; 202 | children = ( 203 | C28C8B7E20738E2F0073DCAA /* CGFloat */, 204 | C28C8B8020738E2F0073DCAA /* UIColor */, 205 | ); 206 | path = Extensions; 207 | sourceTree = ""; 208 | }; 209 | C28C8B7420738D740073DCAA /* ViewControllers */ = { 210 | isa = PBXGroup; 211 | children = ( 212 | 3D09B93324573A060071B3A3 /* Color */, 213 | 3D09B93524573A060071B3A3 /* Colors */, 214 | ); 215 | path = ViewControllers; 216 | sourceTree = ""; 217 | }; 218 | C28C8B7E20738E2F0073DCAA /* CGFloat */ = { 219 | isa = PBXGroup; 220 | children = ( 221 | C28C8B7F20738E2F0073DCAA /* CGFloat+Random.swift */, 222 | ); 223 | path = CGFloat; 224 | sourceTree = ""; 225 | }; 226 | C28C8B8020738E2F0073DCAA /* UIColor */ = { 227 | isa = PBXGroup; 228 | children = ( 229 | C28C8B8220738E2F0073DCAA /* UIColor+Random.swift */, 230 | ); 231 | path = UIColor; 232 | sourceTree = ""; 233 | }; 234 | /* End PBXGroup section */ 235 | 236 | /* Begin PBXNativeTarget section */ 237 | C28C8B3520738D1B0073DCAA /* ViewControllerInCell-Example */ = { 238 | isa = PBXNativeTarget; 239 | buildConfigurationList = C28C8B6020738D1C0073DCAA /* Build configuration list for PBXNativeTarget "ViewControllerInCell-Example" */; 240 | buildPhases = ( 241 | C28C8B3220738D1B0073DCAA /* Sources */, 242 | C28C8B3320738D1B0073DCAA /* Frameworks */, 243 | C28C8B3420738D1B0073DCAA /* Resources */, 244 | ); 245 | buildRules = ( 246 | ); 247 | dependencies = ( 248 | ); 249 | name = "ViewControllerInCell-Example"; 250 | productName = "ViewControllerInCell-Example"; 251 | productReference = C28C8B3620738D1B0073DCAA /* ViewControllerInCell-Example.app */; 252 | productType = "com.apple.product-type.application"; 253 | }; 254 | C28C8B4B20738D1C0073DCAA /* ViewControllerInCell-ExampleTests */ = { 255 | isa = PBXNativeTarget; 256 | buildConfigurationList = C28C8B6320738D1C0073DCAA /* Build configuration list for PBXNativeTarget "ViewControllerInCell-ExampleTests" */; 257 | buildPhases = ( 258 | C28C8B4820738D1C0073DCAA /* Sources */, 259 | C28C8B4920738D1C0073DCAA /* Frameworks */, 260 | C28C8B4A20738D1C0073DCAA /* Resources */, 261 | ); 262 | buildRules = ( 263 | ); 264 | dependencies = ( 265 | C28C8B4E20738D1C0073DCAA /* PBXTargetDependency */, 266 | ); 267 | name = "ViewControllerInCell-ExampleTests"; 268 | productName = "ViewControllerInCell-ExampleTests"; 269 | productReference = C28C8B4C20738D1C0073DCAA /* ViewControllerInCell-ExampleTests.xctest */; 270 | productType = "com.apple.product-type.bundle.unit-test"; 271 | }; 272 | C28C8B5620738D1C0073DCAA /* ViewControllerInCell-ExampleUITests */ = { 273 | isa = PBXNativeTarget; 274 | buildConfigurationList = C28C8B6620738D1C0073DCAA /* Build configuration list for PBXNativeTarget "ViewControllerInCell-ExampleUITests" */; 275 | buildPhases = ( 276 | C28C8B5320738D1C0073DCAA /* Sources */, 277 | C28C8B5420738D1C0073DCAA /* Frameworks */, 278 | C28C8B5520738D1C0073DCAA /* Resources */, 279 | ); 280 | buildRules = ( 281 | ); 282 | dependencies = ( 283 | C28C8B5920738D1C0073DCAA /* PBXTargetDependency */, 284 | ); 285 | name = "ViewControllerInCell-ExampleUITests"; 286 | productName = "ViewControllerInCell-ExampleUITests"; 287 | productReference = C28C8B5720738D1C0073DCAA /* ViewControllerInCell-ExampleUITests.xctest */; 288 | productType = "com.apple.product-type.bundle.ui-testing"; 289 | }; 290 | /* End PBXNativeTarget section */ 291 | 292 | /* Begin PBXProject section */ 293 | C28C8B2E20738D1B0073DCAA /* Project object */ = { 294 | isa = PBXProject; 295 | attributes = { 296 | LastSwiftUpdateCheck = 0920; 297 | LastUpgradeCheck = 1140; 298 | ORGANIZATIONNAME = "William Boles"; 299 | TargetAttributes = { 300 | C28C8B3520738D1B0073DCAA = { 301 | CreatedOnToolsVersion = 9.2; 302 | ProvisioningStyle = Automatic; 303 | }; 304 | C28C8B4B20738D1C0073DCAA = { 305 | CreatedOnToolsVersion = 9.2; 306 | ProvisioningStyle = Automatic; 307 | TestTargetID = C28C8B3520738D1B0073DCAA; 308 | }; 309 | C28C8B5620738D1C0073DCAA = { 310 | CreatedOnToolsVersion = 9.2; 311 | ProvisioningStyle = Automatic; 312 | TestTargetID = C28C8B3520738D1B0073DCAA; 313 | }; 314 | }; 315 | }; 316 | buildConfigurationList = C28C8B3120738D1B0073DCAA /* Build configuration list for PBXProject "ViewControllerInCell-Example" */; 317 | compatibilityVersion = "Xcode 8.0"; 318 | developmentRegion = en; 319 | hasScannedForEncodings = 0; 320 | knownRegions = ( 321 | en, 322 | Base, 323 | ); 324 | mainGroup = C28C8B2D20738D1B0073DCAA; 325 | productRefGroup = C28C8B3720738D1B0073DCAA /* Products */; 326 | projectDirPath = ""; 327 | projectRoot = ""; 328 | targets = ( 329 | C28C8B3520738D1B0073DCAA /* ViewControllerInCell-Example */, 330 | C28C8B4B20738D1C0073DCAA /* ViewControllerInCell-ExampleTests */, 331 | C28C8B5620738D1C0073DCAA /* ViewControllerInCell-ExampleUITests */, 332 | ); 333 | }; 334 | /* End PBXProject section */ 335 | 336 | /* Begin PBXResourcesBuildPhase section */ 337 | C28C8B3420738D1B0073DCAA /* Resources */ = { 338 | isa = PBXResourcesBuildPhase; 339 | buildActionMask = 2147483647; 340 | files = ( 341 | C28C8B7920738D740073DCAA /* Main.storyboard in Resources */, 342 | C28C8B7720738D740073DCAA /* Assets.xcassets in Resources */, 343 | C28C8B7820738D740073DCAA /* LaunchScreen.storyboard in Resources */, 344 | ); 345 | runOnlyForDeploymentPostprocessing = 0; 346 | }; 347 | C28C8B4A20738D1C0073DCAA /* Resources */ = { 348 | isa = PBXResourcesBuildPhase; 349 | buildActionMask = 2147483647; 350 | files = ( 351 | ); 352 | runOnlyForDeploymentPostprocessing = 0; 353 | }; 354 | C28C8B5520738D1C0073DCAA /* Resources */ = { 355 | isa = PBXResourcesBuildPhase; 356 | buildActionMask = 2147483647; 357 | files = ( 358 | ); 359 | runOnlyForDeploymentPostprocessing = 0; 360 | }; 361 | /* End PBXResourcesBuildPhase section */ 362 | 363 | /* Begin PBXSourcesBuildPhase section */ 364 | C28C8B3220738D1B0073DCAA /* Sources */ = { 365 | isa = PBXSourcesBuildPhase; 366 | buildActionMask = 2147483647; 367 | files = ( 368 | 3D09B93E24573A060071B3A3 /* HostedViewTableViewCell.swift in Sources */, 369 | C28C8B7A20738D740073DCAA /* AppDelegate.swift in Sources */, 370 | C28C8B8320738E2F0073DCAA /* CGFloat+Random.swift in Sources */, 371 | 3D09B94124573A060071B3A3 /* HostedViewCollectionViewViewController.swift in Sources */, 372 | 3D09B93D24573A060071B3A3 /* ColorViewController.swift in Sources */, 373 | 3D09B93F24573A060071B3A3 /* HostedViewTableViewViewController.swift in Sources */, 374 | C28C8B8520738E2F0073DCAA /* UIColor+Random.swift in Sources */, 375 | 3D09B94024573A060071B3A3 /* HostedViewCollectionViewCell.swift in Sources */, 376 | ); 377 | runOnlyForDeploymentPostprocessing = 0; 378 | }; 379 | C28C8B4820738D1C0073DCAA /* Sources */ = { 380 | isa = PBXSourcesBuildPhase; 381 | buildActionMask = 2147483647; 382 | files = ( 383 | C28C8B5120738D1C0073DCAA /* ViewControllerInCell_ExampleTests.swift in Sources */, 384 | ); 385 | runOnlyForDeploymentPostprocessing = 0; 386 | }; 387 | C28C8B5320738D1C0073DCAA /* Sources */ = { 388 | isa = PBXSourcesBuildPhase; 389 | buildActionMask = 2147483647; 390 | files = ( 391 | C28C8B5C20738D1C0073DCAA /* ViewControllerInCell_ExampleUITests.swift in Sources */, 392 | ); 393 | runOnlyForDeploymentPostprocessing = 0; 394 | }; 395 | /* End PBXSourcesBuildPhase section */ 396 | 397 | /* Begin PBXTargetDependency section */ 398 | C28C8B4E20738D1C0073DCAA /* PBXTargetDependency */ = { 399 | isa = PBXTargetDependency; 400 | target = C28C8B3520738D1B0073DCAA /* ViewControllerInCell-Example */; 401 | targetProxy = C28C8B4D20738D1C0073DCAA /* PBXContainerItemProxy */; 402 | }; 403 | C28C8B5920738D1C0073DCAA /* PBXTargetDependency */ = { 404 | isa = PBXTargetDependency; 405 | target = C28C8B3520738D1B0073DCAA /* ViewControllerInCell-Example */; 406 | targetProxy = C28C8B5820738D1C0073DCAA /* PBXContainerItemProxy */; 407 | }; 408 | /* End PBXTargetDependency section */ 409 | 410 | /* Begin PBXVariantGroup section */ 411 | C28C8B6C20738D730073DCAA /* LaunchScreen.storyboard */ = { 412 | isa = PBXVariantGroup; 413 | children = ( 414 | C28C8B6D20738D730073DCAA /* Base */, 415 | ); 416 | name = LaunchScreen.storyboard; 417 | sourceTree = ""; 418 | }; 419 | C28C8B6E20738D730073DCAA /* Main.storyboard */ = { 420 | isa = PBXVariantGroup; 421 | children = ( 422 | C28C8B6F20738D730073DCAA /* Base */, 423 | ); 424 | name = Main.storyboard; 425 | sourceTree = ""; 426 | }; 427 | /* End PBXVariantGroup section */ 428 | 429 | /* Begin XCBuildConfiguration section */ 430 | C28C8B5E20738D1C0073DCAA /* Debug */ = { 431 | isa = XCBuildConfiguration; 432 | buildSettings = { 433 | ALWAYS_SEARCH_USER_PATHS = NO; 434 | CLANG_ANALYZER_NONNULL = YES; 435 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 436 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 437 | CLANG_CXX_LIBRARY = "libc++"; 438 | CLANG_ENABLE_MODULES = YES; 439 | CLANG_ENABLE_OBJC_ARC = YES; 440 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 441 | CLANG_WARN_BOOL_CONVERSION = YES; 442 | CLANG_WARN_COMMA = YES; 443 | CLANG_WARN_CONSTANT_CONVERSION = YES; 444 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 445 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 446 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 447 | CLANG_WARN_EMPTY_BODY = YES; 448 | CLANG_WARN_ENUM_CONVERSION = YES; 449 | CLANG_WARN_INFINITE_RECURSION = YES; 450 | CLANG_WARN_INT_CONVERSION = YES; 451 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 452 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 453 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 454 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 455 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 456 | CLANG_WARN_STRICT_PROTOTYPES = YES; 457 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 458 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 459 | CLANG_WARN_UNREACHABLE_CODE = YES; 460 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 461 | CODE_SIGN_IDENTITY = "iPhone Developer"; 462 | COPY_PHASE_STRIP = NO; 463 | DEBUG_INFORMATION_FORMAT = dwarf; 464 | ENABLE_STRICT_OBJC_MSGSEND = YES; 465 | ENABLE_TESTABILITY = YES; 466 | GCC_C_LANGUAGE_STANDARD = gnu11; 467 | GCC_DYNAMIC_NO_PIC = NO; 468 | GCC_NO_COMMON_BLOCKS = YES; 469 | GCC_OPTIMIZATION_LEVEL = 0; 470 | GCC_PREPROCESSOR_DEFINITIONS = ( 471 | "DEBUG=1", 472 | "$(inherited)", 473 | ); 474 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 475 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 476 | GCC_WARN_UNDECLARED_SELECTOR = YES; 477 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 478 | GCC_WARN_UNUSED_FUNCTION = YES; 479 | GCC_WARN_UNUSED_VARIABLE = YES; 480 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 481 | MTL_ENABLE_DEBUG_INFO = YES; 482 | ONLY_ACTIVE_ARCH = YES; 483 | SDKROOT = iphoneos; 484 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 485 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 486 | SWIFT_VERSION = 5.0; 487 | }; 488 | name = Debug; 489 | }; 490 | C28C8B5F20738D1C0073DCAA /* Release */ = { 491 | isa = XCBuildConfiguration; 492 | buildSettings = { 493 | ALWAYS_SEARCH_USER_PATHS = NO; 494 | CLANG_ANALYZER_NONNULL = YES; 495 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 496 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 497 | CLANG_CXX_LIBRARY = "libc++"; 498 | CLANG_ENABLE_MODULES = YES; 499 | CLANG_ENABLE_OBJC_ARC = YES; 500 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 501 | CLANG_WARN_BOOL_CONVERSION = YES; 502 | CLANG_WARN_COMMA = YES; 503 | CLANG_WARN_CONSTANT_CONVERSION = YES; 504 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 505 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 506 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 507 | CLANG_WARN_EMPTY_BODY = YES; 508 | CLANG_WARN_ENUM_CONVERSION = YES; 509 | CLANG_WARN_INFINITE_RECURSION = YES; 510 | CLANG_WARN_INT_CONVERSION = YES; 511 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 512 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 513 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 514 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 515 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 516 | CLANG_WARN_STRICT_PROTOTYPES = YES; 517 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 518 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 519 | CLANG_WARN_UNREACHABLE_CODE = YES; 520 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 521 | CODE_SIGN_IDENTITY = "iPhone Developer"; 522 | COPY_PHASE_STRIP = NO; 523 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 524 | ENABLE_NS_ASSERTIONS = NO; 525 | ENABLE_STRICT_OBJC_MSGSEND = YES; 526 | GCC_C_LANGUAGE_STANDARD = gnu11; 527 | GCC_NO_COMMON_BLOCKS = YES; 528 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 529 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 530 | GCC_WARN_UNDECLARED_SELECTOR = YES; 531 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 532 | GCC_WARN_UNUSED_FUNCTION = YES; 533 | GCC_WARN_UNUSED_VARIABLE = YES; 534 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 535 | MTL_ENABLE_DEBUG_INFO = NO; 536 | SDKROOT = iphoneos; 537 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 538 | SWIFT_VERSION = 5.0; 539 | VALIDATE_PRODUCT = YES; 540 | }; 541 | name = Release; 542 | }; 543 | C28C8B6120738D1C0073DCAA /* Debug */ = { 544 | isa = XCBuildConfiguration; 545 | buildSettings = { 546 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 547 | CODE_SIGN_STYLE = Automatic; 548 | INFOPLIST_FILE = "ViewControllerInCell-Example/Application/Info.plist"; 549 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 550 | PRODUCT_BUNDLE_IDENTIFIER = "com.williamboles.ViewControllerInCell-Example"; 551 | PRODUCT_NAME = "$(TARGET_NAME)"; 552 | TARGETED_DEVICE_FAMILY = "1,2"; 553 | }; 554 | name = Debug; 555 | }; 556 | C28C8B6220738D1C0073DCAA /* Release */ = { 557 | isa = XCBuildConfiguration; 558 | buildSettings = { 559 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 560 | CODE_SIGN_STYLE = Automatic; 561 | INFOPLIST_FILE = "ViewControllerInCell-Example/Application/Info.plist"; 562 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 563 | PRODUCT_BUNDLE_IDENTIFIER = "com.williamboles.ViewControllerInCell-Example"; 564 | PRODUCT_NAME = "$(TARGET_NAME)"; 565 | TARGETED_DEVICE_FAMILY = "1,2"; 566 | }; 567 | name = Release; 568 | }; 569 | C28C8B6420738D1C0073DCAA /* Debug */ = { 570 | isa = XCBuildConfiguration; 571 | buildSettings = { 572 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 573 | BUNDLE_LOADER = "$(TEST_HOST)"; 574 | CODE_SIGN_STYLE = Automatic; 575 | INFOPLIST_FILE = "ViewControllerInCell-ExampleTests/Info.plist"; 576 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 577 | PRODUCT_BUNDLE_IDENTIFIER = "com.williamboles.ViewControllerInCell-ExampleTests"; 578 | PRODUCT_NAME = "$(TARGET_NAME)"; 579 | TARGETED_DEVICE_FAMILY = "1,2"; 580 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ViewControllerInCell-Example.app/ViewControllerInCell-Example"; 581 | }; 582 | name = Debug; 583 | }; 584 | C28C8B6520738D1C0073DCAA /* Release */ = { 585 | isa = XCBuildConfiguration; 586 | buildSettings = { 587 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 588 | BUNDLE_LOADER = "$(TEST_HOST)"; 589 | CODE_SIGN_STYLE = Automatic; 590 | INFOPLIST_FILE = "ViewControllerInCell-ExampleTests/Info.plist"; 591 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 592 | PRODUCT_BUNDLE_IDENTIFIER = "com.williamboles.ViewControllerInCell-ExampleTests"; 593 | PRODUCT_NAME = "$(TARGET_NAME)"; 594 | TARGETED_DEVICE_FAMILY = "1,2"; 595 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ViewControllerInCell-Example.app/ViewControllerInCell-Example"; 596 | }; 597 | name = Release; 598 | }; 599 | C28C8B6720738D1C0073DCAA /* Debug */ = { 600 | isa = XCBuildConfiguration; 601 | buildSettings = { 602 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 603 | CODE_SIGN_STYLE = Automatic; 604 | INFOPLIST_FILE = "ViewControllerInCell-ExampleUITests/Info.plist"; 605 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 606 | PRODUCT_BUNDLE_IDENTIFIER = "com.williamboles.ViewControllerInCell-ExampleUITests"; 607 | PRODUCT_NAME = "$(TARGET_NAME)"; 608 | TARGETED_DEVICE_FAMILY = "1,2"; 609 | TEST_TARGET_NAME = "ViewControllerInCell-Example"; 610 | }; 611 | name = Debug; 612 | }; 613 | C28C8B6820738D1C0073DCAA /* Release */ = { 614 | isa = XCBuildConfiguration; 615 | buildSettings = { 616 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 617 | CODE_SIGN_STYLE = Automatic; 618 | INFOPLIST_FILE = "ViewControllerInCell-ExampleUITests/Info.plist"; 619 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 620 | PRODUCT_BUNDLE_IDENTIFIER = "com.williamboles.ViewControllerInCell-ExampleUITests"; 621 | PRODUCT_NAME = "$(TARGET_NAME)"; 622 | TARGETED_DEVICE_FAMILY = "1,2"; 623 | TEST_TARGET_NAME = "ViewControllerInCell-Example"; 624 | }; 625 | name = Release; 626 | }; 627 | /* End XCBuildConfiguration section */ 628 | 629 | /* Begin XCConfigurationList section */ 630 | C28C8B3120738D1B0073DCAA /* Build configuration list for PBXProject "ViewControllerInCell-Example" */ = { 631 | isa = XCConfigurationList; 632 | buildConfigurations = ( 633 | C28C8B5E20738D1C0073DCAA /* Debug */, 634 | C28C8B5F20738D1C0073DCAA /* Release */, 635 | ); 636 | defaultConfigurationIsVisible = 0; 637 | defaultConfigurationName = Release; 638 | }; 639 | C28C8B6020738D1C0073DCAA /* Build configuration list for PBXNativeTarget "ViewControllerInCell-Example" */ = { 640 | isa = XCConfigurationList; 641 | buildConfigurations = ( 642 | C28C8B6120738D1C0073DCAA /* Debug */, 643 | C28C8B6220738D1C0073DCAA /* Release */, 644 | ); 645 | defaultConfigurationIsVisible = 0; 646 | defaultConfigurationName = Release; 647 | }; 648 | C28C8B6320738D1C0073DCAA /* Build configuration list for PBXNativeTarget "ViewControllerInCell-ExampleTests" */ = { 649 | isa = XCConfigurationList; 650 | buildConfigurations = ( 651 | C28C8B6420738D1C0073DCAA /* Debug */, 652 | C28C8B6520738D1C0073DCAA /* Release */, 653 | ); 654 | defaultConfigurationIsVisible = 0; 655 | defaultConfigurationName = Release; 656 | }; 657 | C28C8B6620738D1C0073DCAA /* Build configuration list for PBXNativeTarget "ViewControllerInCell-ExampleUITests" */ = { 658 | isa = XCConfigurationList; 659 | buildConfigurations = ( 660 | C28C8B6720738D1C0073DCAA /* Debug */, 661 | C28C8B6820738D1C0073DCAA /* Release */, 662 | ); 663 | defaultConfigurationIsVisible = 0; 664 | defaultConfigurationName = Release; 665 | }; 666 | /* End XCConfigurationList section */ 667 | }; 668 | rootObject = C28C8B2E20738D1B0073DCAA /* Project object */; 669 | } 670 | -------------------------------------------------------------------------------- /ViewControllerInCell-Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ViewControllerInCell-Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ViewControllerInCell-Example.xcodeproj/xcshareddata/xcschemes/ViewControllerInCell-Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 42 | 48 | 49 | 50 | 52 | 58 | 59 | 60 | 61 | 62 | 72 | 74 | 80 | 81 | 82 | 83 | 89 | 91 | 97 | 98 | 99 | 100 | 102 | 103 | 106 | 107 | 108 | -------------------------------------------------------------------------------- /ViewControllerInCell-Example/Application/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // ViewControllerInCell-Example 4 | // 5 | // Created by William Boles on 03/04/2018. 6 | // Copyright © 2018 William Boles. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 18 | 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // 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. 24 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // 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. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 33 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // 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. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /ViewControllerInCell-Example/Application/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 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 | UISupportedInterfaceOrientations~ipad 48 | 49 | UIInterfaceOrientationPortrait 50 | UIInterfaceOrientationPortraitUpsideDown 51 | UIInterfaceOrientationLandscapeLeft 52 | UIInterfaceOrientationLandscapeRight 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /ViewControllerInCell-Example/Extensions/CGFloat/CGFloat+Random.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CGFloat+Random.swift 3 | // ViewControllerInCell-Example 4 | // 5 | // Created by William Boles on 03/04/2018. 6 | // Copyright © 2018 William Boles. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | 12 | extension CGFloat { 13 | 14 | // MARK: - Random 15 | 16 | static func random() -> CGFloat { 17 | return CGFloat(arc4random()) / CGFloat(UInt32.max) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /ViewControllerInCell-Example/Extensions/UIColor/UIColor+Random.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+Random.swift 3 | // ViewControllerInCell-Example 4 | // 5 | // Created by William Boles on 03/04/2018. 6 | // Copyright © 2018 William Boles. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | extension UIColor { 12 | 13 | // MARK: - Random 14 | 15 | static var random: UIColor { 16 | return UIColor(red: .random(), green: .random(), blue: .random(), alpha: 1.0) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ViewControllerInCell-Example/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | } 88 | ], 89 | "info" : { 90 | "version" : 1, 91 | "author" : "xcode" 92 | } 93 | } -------------------------------------------------------------------------------- /ViewControllerInCell-Example/Storyboards/Base.lproj/LaunchScreen.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 | -------------------------------------------------------------------------------- /ViewControllerInCell-Example/Storyboards/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 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 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 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 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 | 176 | 177 | 178 | 179 | -------------------------------------------------------------------------------- /ViewControllerInCell-Example/ViewControllers/Color/ColorViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ColorViewController.swift 3 | // ViewControllerInCell-Example 4 | // 5 | // Created by William Boles on 03/04/2018. 6 | // Copyright © 2018 William Boles. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ColorViewController: UIViewController { 12 | 13 | static let storyboardIdentifier = "ColorViewControllerIdentifier" 14 | 15 | @IBOutlet weak var colorInfoLabel: UILabel! 16 | 17 | // MARK: - ViewLifecycle 18 | 19 | override func viewDidLoad() { 20 | super.viewDidLoad() 21 | 22 | let color = UIColor.random 23 | view.backgroundColor = color 24 | 25 | let ciColor = CIColor(color: color) 26 | let red = String(format: "%.3f", ciColor.red) 27 | let green = String(format: "%.3f", ciColor.green) 28 | let blue = String(format: "%.3f", ciColor.blue) 29 | colorInfoLabel.text = "RGB: (\(red), \(green), \(blue))" 30 | } 31 | 32 | // Storyboard 33 | 34 | static func createFromStoryboard() -> ColorViewController { 35 | 36 | let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: ColorViewController.self)) 37 | guard let viewController = storyboard.instantiateViewController(withIdentifier: ColorViewController.storyboardIdentifier) as? ColorViewController else { 38 | fatalError("ColorViewController should be present in storyboard") 39 | } 40 | 41 | return viewController 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /ViewControllerInCell-Example/ViewControllers/Colors/CollectionView/HostedViewCollectionViewCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HostedViewCollectionViewCell.swift 3 | // ViewControllerInCell-Example 4 | // 5 | // Created by William Boles on 27/04/2020. 6 | // Copyright © 2020 William Boles. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import os 11 | 12 | class HostedViewCollectionViewCell: UICollectionViewCell { 13 | 14 | static let reuseIdentifier = "HostedViewCollectionViewCell" 15 | 16 | // MARK: - HostedView 17 | 18 | private weak var _hostedView: UIView? { 19 | didSet { 20 | if let oldValue = oldValue { 21 | if oldValue.isDescendant(of: self) { //Make sure that hostedView hasn't been added as a subview to a different cell 22 | oldValue.removeFromSuperview() 23 | } else { 24 | os_log(.info, "hostedView is no longer attached to this collectionview cell") 25 | } 26 | } 27 | 28 | if let _hostedView = _hostedView { 29 | _hostedView.frame = contentView.bounds 30 | contentView.addSubview(_hostedView) 31 | } 32 | } 33 | } 34 | 35 | weak var hostedView: UIView? { 36 | get { 37 | guard _hostedView?.isDescendant(of: self) ?? false else { 38 | _hostedView = nil 39 | return nil 40 | } 41 | 42 | return _hostedView 43 | } 44 | set { 45 | _hostedView = newValue 46 | } 47 | } 48 | 49 | // MARK: - Reuse 50 | 51 | override func prepareForReuse() { 52 | super.prepareForReuse() 53 | 54 | hostedView = nil 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /ViewControllerInCell-Example/ViewControllers/Colors/CollectionView/HostedViewCollectionViewViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HostedViewCollectionViewViewController.swift 3 | // ViewControllerInCell-Example 4 | // 5 | // Created by William Boles on 27/04/2020. 6 | // Copyright © 2020 William Boles. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class HostedViewCollectionViewViewController: UIViewController { 12 | 13 | @IBOutlet weak var collectionView: UICollectionView! 14 | 15 | private lazy var colorViewControllers: [ColorViewController] = { 16 | var colorViewControllers = [ColorViewController]() 17 | 18 | for _ in 0...100 { 19 | let colorViewController = ColorViewController.createFromStoryboard() 20 | 21 | addChildContentViewController(colorViewController) 22 | colorViewControllers.append(colorViewController) 23 | } 24 | 25 | return colorViewControllers 26 | }() 27 | 28 | // MARK: - ChildViewControllers 29 | 30 | private func addChildContentViewController(_ childViewController: UIViewController) { 31 | addChild(childViewController) 32 | childViewController.didMove(toParent: self) 33 | } 34 | } 35 | 36 | extension HostedViewCollectionViewViewController: UICollectionViewDelegateFlowLayout { 37 | 38 | func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { 39 | return CGSize(width: collectionView.frame.size.width, height: 88.0) 40 | } 41 | 42 | func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets { 43 | return UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0) 44 | } 45 | 46 | func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat { 47 | return 0.0 48 | } 49 | 50 | func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat { 51 | return 0.0 52 | } 53 | } 54 | 55 | extension HostedViewCollectionViewViewController: UICollectionViewDataSource { 56 | 57 | func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { 58 | return colorViewControllers.count 59 | } 60 | 61 | func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { 62 | let colorViewController = colorViewControllers[indexPath.row] 63 | 64 | guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: HostedViewCollectionViewCell.reuseIdentifier, for: indexPath) as? HostedViewCollectionViewCell else { 65 | fatalError("Expected cell with reuse identifier: \(HostedViewCollectionViewCell.reuseIdentifier)") 66 | } 67 | 68 | cell.hostedView = colorViewController.view 69 | 70 | return cell 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /ViewControllerInCell-Example/ViewControllers/Colors/TableView/HostedViewTableViewCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HostedViewTableViewCell.swift 3 | // ViewControllerInCell-Example 4 | // 5 | // Created by William Boles on 03/04/2018. 6 | // Copyright © 2018 William Boles. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import os 11 | 12 | class HostedViewTableViewCell: UITableViewCell { 13 | 14 | static let reuseIdentifier = "HostedViewTableViewCell" 15 | 16 | // MARK: - HostedView 17 | 18 | private weak var _hostedView: UIView? { 19 | didSet { 20 | if let oldValue = oldValue { 21 | if oldValue.isDescendant(of: self) { //Make sure that hostedView hasn't been added as a subview to a different cell 22 | oldValue.removeFromSuperview() 23 | } else { 24 | os_log(.info, "hostedView is no longer attached to this tableview cell") 25 | } 26 | } 27 | 28 | if let _hostedView = _hostedView { 29 | _hostedView.frame = contentView.bounds 30 | contentView.addSubview(_hostedView) 31 | } 32 | } 33 | } 34 | 35 | weak var hostedView: UIView? { 36 | get { 37 | guard _hostedView?.isDescendant(of: self) ?? false else { 38 | _hostedView = nil 39 | return nil 40 | } 41 | 42 | return _hostedView 43 | } 44 | set { 45 | _hostedView = newValue 46 | } 47 | } 48 | 49 | // MARK: - Reuse 50 | 51 | override func prepareForReuse() { 52 | super.prepareForReuse() 53 | 54 | hostedView = nil 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /ViewControllerInCell-Example/ViewControllers/Colors/TableView/HostedViewTableViewViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HostedViewTableViewViewController.swift 3 | // ViewControllerInCell-Example 4 | // 5 | // Created by William Boles on 03/04/2018. 6 | // Copyright © 2018 William Boles. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class HostedViewTableViewViewController: UIViewController { 12 | 13 | @IBOutlet weak var tableView: UITableView! 14 | 15 | private lazy var colorViewControllers: [ColorViewController] = { 16 | var colorViewControllers = [ColorViewController]() 17 | 18 | for _ in 0...100 { 19 | let colorViewController = ColorViewController.createFromStoryboard() 20 | 21 | addChildContentViewController(colorViewController) 22 | colorViewControllers.append(colorViewController) 23 | } 24 | 25 | return colorViewControllers 26 | }() 27 | 28 | // MARK: - ViewLifecycle 29 | 30 | override func viewDidLoad() { 31 | super.viewDidLoad() 32 | 33 | tableView.rowHeight = 88 34 | } 35 | 36 | // MARK: - ChildViewControllers 37 | 38 | private func addChildContentViewController(_ childViewController: UIViewController) { 39 | addChild(childViewController) 40 | childViewController.didMove(toParent: self) 41 | } 42 | } 43 | 44 | extension HostedViewTableViewViewController: UITableViewDataSource { 45 | 46 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 47 | return colorViewControllers.count 48 | } 49 | 50 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 51 | let colorViewController = colorViewControllers[indexPath.row] 52 | 53 | guard let cell = tableView.dequeueReusableCell(withIdentifier: HostedViewTableViewCell.reuseIdentifier, for: indexPath) as? HostedViewTableViewCell else { 54 | fatalError("Expected cell with reuse identifier: \(HostedViewTableViewCell.reuseIdentifier)") 55 | } 56 | 57 | cell.hostedView = colorViewController.view 58 | 59 | return cell 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /ViewControllerInCell-ExampleTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /ViewControllerInCell-ExampleTests/ViewControllerInCell_ExampleTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewControllerInCell_ExampleTests.swift 3 | // ViewControllerInCell-ExampleTests 4 | // 5 | // Created by William Boles on 03/04/2018. 6 | // Copyright © 2018 William Boles. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import ViewControllerInCell_Example 11 | 12 | class ViewControllerInCell_ExampleTests: 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 | // Use XCTAssert and related functions to verify your tests produce the correct results. 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 | -------------------------------------------------------------------------------- /ViewControllerInCell-ExampleUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /ViewControllerInCell-ExampleUITests/ViewControllerInCell_ExampleUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewControllerInCell_ExampleUITests.swift 3 | // ViewControllerInCell-ExampleUITests 4 | // 5 | // Created by William Boles on 03/04/2018. 6 | // Copyright © 2018 William Boles. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class ViewControllerInCell_ExampleUITests: XCTestCase { 12 | 13 | override func setUp() { 14 | super.setUp() 15 | 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | 18 | // In UI tests it is usually best to stop immediately when a failure occurs. 19 | continueAfterFailure = false 20 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 21 | XCUIApplication().launch() 22 | 23 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 24 | } 25 | 26 | override func tearDown() { 27 | // Put teardown code here. This method is called after the invocation of each test method in the class. 28 | super.tearDown() 29 | } 30 | 31 | func testExample() { 32 | // Use recording to get started writing UI tests. 33 | // Use XCTAssert and related functions to verify your tests produce the correct results. 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /fastlane/Appfile: -------------------------------------------------------------------------------- 1 | # app_identifier("[[APP_IDENTIFIER]]") # The bundle identifier of your app 2 | # apple_id("[[APPLE_ID]]") # Your Apple email address 3 | 4 | 5 | # For more information about the Appfile, see: 6 | # https://docs.fastlane.tools/advanced/#appfile 7 | -------------------------------------------------------------------------------- /fastlane/Fastfile: -------------------------------------------------------------------------------- 1 | # This file contains the fastlane.tools configuration 2 | # You can find the documentation at https://docs.fastlane.tools 3 | # 4 | # For a list of all available actions, check out 5 | # 6 | # https://docs.fastlane.tools/actions 7 | # 8 | 9 | # Uncomment the line if you want fastlane to automatically update itself 10 | # update_fastlane 11 | 12 | default_platform(:ios) 13 | 14 | platform :ios do 15 | lane :run_unit_tests do 16 | scan( 17 | scheme: 'ViewControllerInCell-Example', 18 | skip_build: true 19 | ) 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /fastlane/README.md: -------------------------------------------------------------------------------- 1 | fastlane documentation 2 | ================ 3 | # Installation 4 | 5 | Make sure you have the latest version of the Xcode command line tools installed: 6 | 7 | ``` 8 | xcode-select --install 9 | ``` 10 | 11 | Install _fastlane_ using 12 | ``` 13 | [sudo] gem install fastlane -NV 14 | ``` 15 | or alternatively using `brew cask install fastlane` 16 | 17 | # Available Actions 18 | ## iOS 19 | ### ios run_unit_tests 20 | ``` 21 | fastlane ios run_unit_tests 22 | ``` 23 | 24 | 25 | ---- 26 | 27 | This README.md is auto-generated and will be re-generated every time [fastlane](https://fastlane.tools) is run. 28 | More information about fastlane can be found on [fastlane.tools](https://fastlane.tools). 29 | The documentation of fastlane can be found on [docs.fastlane.tools](https://docs.fastlane.tools). 30 | --------------------------------------------------------------------------------