From 07ae3245862d235bb5d994cfb8ab01960ef1d5b6 Mon Sep 17 00:00:00 2001 From: Shin Yamamoto Date: Wed, 24 Nov 2021 20:26:35 +0900 Subject: [PATCH] Clean up the example projects and codes (#512) * Clean up Samples and Maps examples * Rename the root view controller in Maps/Stocks/SampleObjC examples * Reorder resource file references * Rename examples' bundle ids with `example` domain. * Remove 'Run Script' to modify CFBundleVersion: now this has not been used for testing since unit tests were added * Revise methods to handle content view controllers in UseCaseController * Fix a bug on PagePanelController --- .../Maps-SwiftUI.xcodeproj/project.pbxproj | 4 +- Examples/Maps/Maps.xcodeproj/project.pbxproj | 18 +- Examples/Maps/Maps/AppDelegate.swift | 4 - Examples/Maps/Maps/Base.lproj/Main.storyboard | 66 ++-- ...troller.swift => MainViewController.swift} | 41 +-- Examples/Maps/Maps/SearchViewController.swift | 2 +- .../Samples/Samples.xcodeproj/project.pbxproj | 51 +-- .../Sources/Base.lproj/Main.storyboard | 8 +- .../DebugTableViewController.swift | 1 + .../DebugTextViewController.swift | 0 .../DetailViewController.swift | 0 .../ImageViewController.swift | 0 .../InspectorViewController.swift | 0 .../ModalViewController.swift | 0 .../MultiPanelController.swift | 0 .../NestedScrollViewController.swift | 0 .../SettingsViewController.swift | 0 .../TabBarViewController.swift | 0 .../Sources/{UseCases => }/CustomState.swift | 0 .../Samples/Sources/MainViewController.swift | 8 +- .../{Layouts.swift => PanelLayouts.swift} | 0 ...ponents.swift => SupplementaryViews.swift} | 14 +- .../UseCases/PagePanelController.swift | 17 +- .../Samples/Sources/UseCases/UseCase.swift | 62 ++-- .../{ => UseCases}/UseCaseController.swift | 315 ++++++++++-------- .../SamplesObjC.xcodeproj/project.pbxproj | 22 +- .../SamplesObjC/Base.lproj/Main.storyboard | 12 +- ...{ViewController.h => MainViewController.h} | 2 +- ...{ViewController.m => MainViewController.m} | 6 +- .../Stocks/Stocks.xcodeproj/project.pbxproj | 16 +- .../Stocks/Stocks/Base.lproj/Main.storyboard | 28 +- ...troller.swift => MainViewController.swift} | 2 +- 32 files changed, 373 insertions(+), 326 deletions(-) rename Examples/Maps/Maps/{ViewController.swift => MainViewController.swift} (94%) rename Examples/Samples/Sources/{ViewControllers => ContentViewControllers}/DebugTableViewController.swift (99%) rename Examples/Samples/Sources/{ViewControllers => ContentViewControllers}/DebugTextViewController.swift (100%) rename Examples/Samples/Sources/{ViewControllers => ContentViewControllers}/DetailViewController.swift (100%) rename Examples/Samples/Sources/{ViewControllers => ContentViewControllers}/ImageViewController.swift (100%) rename Examples/Samples/Sources/{ViewControllers => ContentViewControllers}/InspectorViewController.swift (100%) rename Examples/Samples/Sources/{ViewControllers => ContentViewControllers}/ModalViewController.swift (100%) rename Examples/Samples/Sources/{ViewControllers => ContentViewControllers}/MultiPanelController.swift (100%) rename Examples/Samples/Sources/{ViewControllers => ContentViewControllers}/NestedScrollViewController.swift (100%) rename Examples/Samples/Sources/{ViewControllers => ContentViewControllers}/SettingsViewController.swift (100%) rename Examples/Samples/Sources/{ViewControllers => ContentViewControllers}/TabBarViewController.swift (100%) rename Examples/Samples/Sources/{UseCases => }/CustomState.swift (100%) rename Examples/Samples/Sources/{Layouts.swift => PanelLayouts.swift} (100%) rename Examples/Samples/Sources/{Components.swift => SupplementaryViews.swift} (97%) rename Examples/Samples/Sources/{ => UseCases}/UseCaseController.swift (59%) rename Examples/SamplesObjC/SamplesObjC/{ViewController.h => MainViewController.h} (85%) rename Examples/SamplesObjC/SamplesObjC/{ViewController.m => MainViewController.m} (96%) rename Examples/Stocks/Stocks/{ViewController.swift => MainViewController.swift} (98%) diff --git a/Examples/Maps-SwiftUI/Maps-SwiftUI.xcodeproj/project.pbxproj b/Examples/Maps-SwiftUI/Maps-SwiftUI.xcodeproj/project.pbxproj index bab97d9..71e73f6 100644 --- a/Examples/Maps-SwiftUI/Maps-SwiftUI.xcodeproj/project.pbxproj +++ b/Examples/Maps-SwiftUI/Maps-SwiftUI.xcodeproj/project.pbxproj @@ -364,7 +364,7 @@ "@executable_path/Frameworks", ); MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = "com.scenee.Maps-SwiftUI"; + PRODUCT_BUNDLE_IDENTIFIER = "example.Maps-SwiftUI"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; @@ -391,7 +391,7 @@ "@executable_path/Frameworks", ); MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = "com.scenee.Maps-SwiftUI"; + PRODUCT_BUNDLE_IDENTIFIER = "exmaple.Maps-SwiftUI"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; diff --git a/Examples/Maps/Maps.xcodeproj/project.pbxproj b/Examples/Maps/Maps.xcodeproj/project.pbxproj index f76f50b..64489c7 100644 --- a/Examples/Maps/Maps.xcodeproj/project.pbxproj +++ b/Examples/Maps/Maps.xcodeproj/project.pbxproj @@ -12,7 +12,7 @@ 549D23D2233C77D5008EF4D7 /* FloatingPanel.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 549D23D1233C77D5008EF4D7 /* FloatingPanel.framework */; }; 549D23D3233C77D5008EF4D7 /* FloatingPanel.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 549D23D1233C77D5008EF4D7 /* FloatingPanel.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 54B5112A216C3D840033A6F3 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54B51129216C3D840033A6F3 /* AppDelegate.swift */; }; - 54B5112C216C3D840033A6F3 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54B5112B216C3D840033A6F3 /* ViewController.swift */; }; + 54B5112C216C3D840033A6F3 /* MainViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54B5112B216C3D840033A6F3 /* MainViewController.swift */; }; 54B5112F216C3D840033A6F3 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 54B5112D216C3D840033A6F3 /* Main.storyboard */; }; 54B51131216C3D860033A6F3 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 54B51130216C3D860033A6F3 /* Assets.xcassets */; }; 54B51134216C3D860033A6F3 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 54B51132216C3D860033A6F3 /* LaunchScreen.storyboard */; }; @@ -40,7 +40,7 @@ 549D23D1233C77D5008EF4D7 /* FloatingPanel.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = FloatingPanel.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 54B51126216C3D840033A6F3 /* Maps.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Maps.app; sourceTree = BUILT_PRODUCTS_DIR; }; 54B51129216C3D840033A6F3 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 54B5112B216C3D840033A6F3 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 54B5112B216C3D840033A6F3 /* MainViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainViewController.swift; sourceTree = ""; }; 54B5112E216C3D840033A6F3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 54B51130216C3D860033A6F3 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 54B51133216C3D860033A6F3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; @@ -91,14 +91,14 @@ 54B51128216C3D840033A6F3 /* Maps */ = { isa = PBXGroup; children = ( + 54B51130216C3D860033A6F3 /* Assets.xcassets */, + 54B51132216C3D860033A6F3 /* LaunchScreen.storyboard */, + 54B5112D216C3D840033A6F3 /* Main.storyboard */, 54B51129216C3D840033A6F3 /* AppDelegate.swift */, - 54B5112B216C3D840033A6F3 /* ViewController.swift */, + 54B5112B216C3D840033A6F3 /* MainViewController.swift */, 549A5F58244673FE0025F312 /* SearchViewController.swift */, 54E26CB724A98E310066C720 /* DetailViewController.swift */, 54E26CB524A989090066C720 /* Utils.swift */, - 54B5112D216C3D840033A6F3 /* Main.storyboard */, - 54B51130216C3D860033A6F3 /* Assets.xcassets */, - 54B51132216C3D860033A6F3 /* LaunchScreen.storyboard */, 54B51135216C3D860033A6F3 /* Info.plist */, ); path = Maps; @@ -177,7 +177,7 @@ buildActionMask = 2147483647; files = ( 549A5F59244673FE0025F312 /* SearchViewController.swift in Sources */, - 54B5112C216C3D840033A6F3 /* ViewController.swift in Sources */, + 54B5112C216C3D840033A6F3 /* MainViewController.swift in Sources */, 54E26CB824A98E310066C720 /* DetailViewController.swift in Sources */, 54B5112A216C3D840033A6F3 /* AppDelegate.swift in Sources */, 54E26CB624A989090066C720 /* Utils.swift in Sources */, @@ -336,7 +336,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.scenee.Maps; + PRODUCT_BUNDLE_IDENTIFIER = example.Maps; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -355,7 +355,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.scenee.Maps; + PRODUCT_BUNDLE_IDENTIFIER = example.Maps; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; diff --git a/Examples/Maps/Maps/AppDelegate.swift b/Examples/Maps/Maps/AppDelegate.swift index cf0ab26..57b8295 100644 --- a/Examples/Maps/Maps/AppDelegate.swift +++ b/Examples/Maps/Maps/AppDelegate.swift @@ -5,9 +5,5 @@ import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - return true - } } diff --git a/Examples/Maps/Maps/Base.lproj/Main.storyboard b/Examples/Maps/Maps/Base.lproj/Main.storyboard index 68fac7f..35cfa74 100644 --- a/Examples/Maps/Maps/Base.lproj/Main.storyboard +++ b/Examples/Maps/Maps/Base.lproj/Main.storyboard @@ -1,28 +1,26 @@ - - + - - + - + - + - + - + - + - + @@ -54,31 +52,31 @@ - + - + - + - + - + - + - + - + @@ -88,7 +86,7 @@ - + @@ -106,7 +104,7 @@ - + @@ -126,7 +124,7 @@ - + @@ -146,7 +144,7 @@ - + - + @@ -183,16 +181,16 @@ - +