From 42b9871dbe4748b1b1fd85a7a773a6fce88f92e5 Mon Sep 17 00:00:00 2001 From: swg99 <87419041+swg99@users.noreply.github.com> Date: Thu, 29 Jul 2021 11:35:08 +0100 Subject: [PATCH 1/2] Removed Main.storyboard --- .../Rick And Morty.xcodeproj/project.pbxproj | 12 - .../Rick And Morty/AppDelegate.swift | 2 +- .../Rick And Morty/Base.lproj/Main.storyboard | 245 ------------------ Rick-and-Morty/Rick And Morty/Info.plist | 2 - 4 files changed, 1 insertion(+), 260 deletions(-) delete mode 100644 Rick-and-Morty/Rick And Morty/Base.lproj/Main.storyboard diff --git a/Rick-and-Morty/Rick And Morty.xcodeproj/project.pbxproj b/Rick-and-Morty/Rick And Morty.xcodeproj/project.pbxproj index f657038d..e7b640cc 100644 --- a/Rick-and-Morty/Rick And Morty.xcodeproj/project.pbxproj +++ b/Rick-and-Morty/Rick And Morty.xcodeproj/project.pbxproj @@ -14,7 +14,6 @@ 17F1E38A26A1D877009C1CDB /* CharacterCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17F1E38926A1D877009C1CDB /* CharacterCollectionViewCell.swift */; }; 17F1E38D26A1DCF0009C1CDB /* Data.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17F1E38C26A1DCF0009C1CDB /* Data.swift */; }; B811686D1CFF1C9900301A0A /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B811686C1CFF1C9900301A0A /* AppDelegate.swift */; }; - B81168741CFF1C9900301A0A /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B81168721CFF1C9900301A0A /* Main.storyboard */; }; B81168761CFF1C9900301A0A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B81168751CFF1C9900301A0A /* Assets.xcassets */; }; B81168791CFF1C9900301A0A /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B81168771CFF1C9900301A0A /* LaunchScreen.storyboard */; }; B81168841CFF1C9900301A0A /* Rick_And_MortyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B81168831CFF1C9900301A0A /* Rick_And_MortyTests.swift */; }; @@ -41,7 +40,6 @@ 17F1E38C26A1DCF0009C1CDB /* Data.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Data.swift; sourceTree = ""; }; B81168691CFF1C9900301A0A /* Rick And Morty.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Rick And Morty.app"; sourceTree = BUILT_PRODUCTS_DIR; }; B811686C1CFF1C9900301A0A /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - B81168731CFF1C9900301A0A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; B81168751CFF1C9900301A0A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; B81168781CFF1C9900301A0A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; B811687A1CFF1C9900301A0A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -116,7 +114,6 @@ 17F1E38E26A5724A009C1CDB /* Views */, 17F1E38026A184F3009C1CDB /* Models */, B811686C1CFF1C9900301A0A /* AppDelegate.swift */, - B81168721CFF1C9900301A0A /* Main.storyboard */, B81168751CFF1C9900301A0A /* Assets.xcassets */, B81168771CFF1C9900301A0A /* LaunchScreen.storyboard */, B811687A1CFF1C9900301A0A /* Info.plist */, @@ -220,7 +217,6 @@ files = ( B81168791CFF1C9900301A0A /* LaunchScreen.storyboard in Resources */, B81168761CFF1C9900301A0A /* Assets.xcassets in Resources */, - B81168741CFF1C9900301A0A /* Main.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -269,14 +265,6 @@ /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ - B81168721CFF1C9900301A0A /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - B81168731CFF1C9900301A0A /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; B81168771CFF1C9900301A0A /* LaunchScreen.storyboard */ = { isa = PBXVariantGroup; children = ( diff --git a/Rick-and-Morty/Rick And Morty/AppDelegate.swift b/Rick-and-Morty/Rick And Morty/AppDelegate.swift index 4bc13f8c..7f10988e 100644 --- a/Rick-and-Morty/Rick And Morty/AppDelegate.swift +++ b/Rick-and-Morty/Rick And Morty/AppDelegate.swift @@ -1,4 +1,4 @@ -import UIKit +//import UIKit import SwiftUI @main diff --git a/Rick-and-Morty/Rick And Morty/Base.lproj/Main.storyboard b/Rick-and-Morty/Rick And Morty/Base.lproj/Main.storyboard deleted file mode 100644 index 98a64f8c..00000000 --- a/Rick-and-Morty/Rick And Morty/Base.lproj/Main.storyboard +++ /dev/null @@ -1,245 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Rick-and-Morty/Rick And Morty/Info.plist b/Rick-and-Morty/Rick And Morty/Info.plist index e214702e..74420fed 100644 --- a/Rick-and-Morty/Rick And Morty/Info.plist +++ b/Rick-and-Morty/Rick And Morty/Info.plist @@ -24,8 +24,6 @@ UILaunchStoryboardName LaunchScreen - UIMainStoryboardFile - Main UIRequiredDeviceCapabilities armv7 From eccf0e656a76281b3feea1fe955312754e2140b3 Mon Sep 17 00:00:00 2001 From: swg99 <87419041+swg99@users.noreply.github.com> Date: Thu, 29 Jul 2021 11:36:42 +0100 Subject: [PATCH 2/2] Removed old UIKit cell --- .../Rick And Morty.xcodeproj/project.pbxproj | 4 -- .../Views/CharacterCollectionViewCell.swift | 45 ------------------- 2 files changed, 49 deletions(-) delete mode 100644 Rick-and-Morty/Rick And Morty/Views/CharacterCollectionViewCell.swift diff --git a/Rick-and-Morty/Rick And Morty.xcodeproj/project.pbxproj b/Rick-and-Morty/Rick And Morty.xcodeproj/project.pbxproj index e7b640cc..22fac9a2 100644 --- a/Rick-and-Morty/Rick And Morty.xcodeproj/project.pbxproj +++ b/Rick-and-Morty/Rick And Morty.xcodeproj/project.pbxproj @@ -11,7 +11,6 @@ 1711B39E26B1898100BE935B /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1711B39D26B1898100BE935B /* ContentView.swift */; }; 17CAB4FA26A824470048F2F1 /* CharacterCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17CAB4F926A824470048F2F1 /* CharacterCell.swift */; }; 17F1E38626A1AF6A009C1CDB /* Character.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17F1E38526A1AF6A009C1CDB /* Character.swift */; }; - 17F1E38A26A1D877009C1CDB /* CharacterCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17F1E38926A1D877009C1CDB /* CharacterCollectionViewCell.swift */; }; 17F1E38D26A1DCF0009C1CDB /* Data.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17F1E38C26A1DCF0009C1CDB /* Data.swift */; }; B811686D1CFF1C9900301A0A /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B811686C1CFF1C9900301A0A /* AppDelegate.swift */; }; B81168761CFF1C9900301A0A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B81168751CFF1C9900301A0A /* Assets.xcassets */; }; @@ -36,7 +35,6 @@ 1711B39D26B1898100BE935B /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 17CAB4F926A824470048F2F1 /* CharacterCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CharacterCell.swift; sourceTree = ""; }; 17F1E38526A1AF6A009C1CDB /* Character.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Character.swift; sourceTree = ""; }; - 17F1E38926A1D877009C1CDB /* CharacterCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CharacterCollectionViewCell.swift; sourceTree = ""; }; 17F1E38C26A1DCF0009C1CDB /* Data.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Data.swift; sourceTree = ""; }; B81168691CFF1C9900301A0A /* Rick And Morty.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Rick And Morty.app"; sourceTree = BUILT_PRODUCTS_DIR; }; B811686C1CFF1C9900301A0A /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; @@ -82,7 +80,6 @@ 17F1E38E26A5724A009C1CDB /* Views */ = { isa = PBXGroup; children = ( - 17F1E38926A1D877009C1CDB /* CharacterCollectionViewCell.swift */, 17CAB4F926A824470048F2F1 /* CharacterCell.swift */, 1711B39B26B16D6200BE935B /* CharactersView.swift */, 1711B39D26B1898100BE935B /* ContentView.swift */, @@ -242,7 +239,6 @@ 1711B39C26B16D6200BE935B /* CharactersView.swift in Sources */, 17F1E38626A1AF6A009C1CDB /* Character.swift in Sources */, B81168951CFF235600301A0A /* Morty.swift in Sources */, - 17F1E38A26A1D877009C1CDB /* CharacterCollectionViewCell.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Rick-and-Morty/Rick And Morty/Views/CharacterCollectionViewCell.swift b/Rick-and-Morty/Rick And Morty/Views/CharacterCollectionViewCell.swift deleted file mode 100644 index 7791788b..00000000 --- a/Rick-and-Morty/Rick And Morty/Views/CharacterCollectionViewCell.swift +++ /dev/null @@ -1,45 +0,0 @@ -import UIKit -import SwiftUI - -class CharacterCollectionViewCell: UICollectionViewCell { - static var reuseIdentifier = "character-cell" - - private(set) var host: UIHostingController? - - override init(frame: CGRect) { - super.init(frame: frame) - } - - required init?(coder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - func embed(in parent: UIViewController, withCharacter character: Character, imagePosition: CharacterImagePosition) { - if let host = self.host { - host.rootView = CharacterCell(character: character, imagePosition: imagePosition) - host.view.layoutIfNeeded() - } else { - let host = createHostView(parent: parent, character: character, imagePosition: imagePosition) - self.contentView.addSubview(host.view) - - self.host = host - } - } - - func createHostView(parent: UIViewController, character: Character, imagePosition: CharacterImagePosition) -> UIHostingController { - let host = UIHostingController(rootView: CharacterCell(character: character, imagePosition: imagePosition)) - parent.addChild(host) - host.didMove(toParent: parent) - - host.view.frame = self.contentView.bounds - - return host - } - - deinit { - host?.willMove(toParent: nil) - host?.view.removeFromSuperview() - host?.removeFromParent() - host = nil - } -}