From 08ab97780653b8a6576ac8c9f2bd5b371b287aa5 Mon Sep 17 00:00:00 2001 From: Frank <472730949@qq.com> Date: Thu, 9 Sep 2021 10:55:11 +0800 Subject: [PATCH] Remove unnecessary code in demo. --- MJExtension.xcodeproj/project.pbxproj | 26 +++++------ MJExtensionDemo/AppDelegate.swift | 21 ++++----- MJExtensionDemo/Base.lproj/Main.storyboard | 21 ++++++--- MJExtensionDemo/Info.plist | 30 +++++------- MJExtensionDemo/SceneDelegate.swift | 53 ---------------------- MJExtensionDemo/ViewController.h | 15 ------ MJExtensionDemo/ViewController.m | 23 ---------- MJExtensionDemo/ViewController.swift | 20 -------- 8 files changed, 45 insertions(+), 164 deletions(-) delete mode 100644 MJExtensionDemo/SceneDelegate.swift delete mode 100644 MJExtensionDemo/ViewController.h delete mode 100644 MJExtensionDemo/ViewController.m delete mode 100644 MJExtensionDemo/ViewController.swift diff --git a/MJExtension.xcodeproj/project.pbxproj b/MJExtension.xcodeproj/project.pbxproj index 8f4a4936..3595bb37 100644 --- a/MJExtension.xcodeproj/project.pbxproj +++ b/MJExtension.xcodeproj/project.pbxproj @@ -14,12 +14,10 @@ 0107507E26E890C100AAEA10 /* CoreDataTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0107507D26E890C100AAEA10 /* CoreDataTests.swift */; }; 0107508726E8C2DB00AAEA10 /* MJExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2D2DB9F42317DA64005A689E /* MJExtension.framework */; }; 0107508F26E8C59F00AAEA10 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0107508E26E8C59F00AAEA10 /* AppDelegate.swift */; }; - 0107509126E8C5A000AAEA10 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0107509026E8C5A000AAEA10 /* SceneDelegate.swift */; }; - 0107509326E8C5A000AAEA10 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0107509226E8C5A000AAEA10 /* ViewController.swift */; }; 0107509626E8C5A000AAEA10 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0107509426E8C5A000AAEA10 /* Main.storyboard */; }; 0107509826E8C5A300AAEA10 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0107509726E8C5A300AAEA10 /* Assets.xcassets */; }; 0107509B26E8C5A300AAEA10 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0107509926E8C5A300AAEA10 /* LaunchScreen.storyboard */; }; - 010750A226E8C5EB00AAEA10 /* MJCoreDataTestModel.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 0107507626E88DD400AAEA10 /* MJCoreDataTestModel.xcdatamodeld */; }; + 0121B2CE26E9B277008EE973 /* MJCoreDataTestModel.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 0107507626E88DD400AAEA10 /* MJCoreDataTestModel.xcdatamodeld */; }; 0130EE80233C56D8008D2386 /* MJFrenchUser.m in Sources */ = {isa = PBXBuildFile; fileRef = 0130EE7F233C56D8008D2386 /* MJFrenchUser.m */; }; 0179886C24EFA460007F7FBC /* MJTester.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0179886B24EFA460007F7FBC /* MJTester.swift */; }; 0179887024EFA58B007F7FBC /* SwiftModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0179886F24EFA58B007F7FBC /* SwiftModelTests.swift */; }; @@ -78,8 +76,6 @@ 0107507D26E890C100AAEA10 /* CoreDataTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoreDataTests.swift; sourceTree = ""; }; 0107508C26E8C59F00AAEA10 /* MJExtensionDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MJExtensionDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 0107508E26E8C59F00AAEA10 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 0107509026E8C5A000AAEA10 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; - 0107509226E8C5A000AAEA10 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 0107509526E8C5A000AAEA10 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 0107509726E8C5A300AAEA10 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 0107509A26E8C5A300AAEA10 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; @@ -191,8 +187,6 @@ isa = PBXGroup; children = ( 0107508E26E8C59F00AAEA10 /* AppDelegate.swift */, - 0107509026E8C5A000AAEA10 /* SceneDelegate.swift */, - 0107509226E8C5A000AAEA10 /* ViewController.swift */, 0107509426E8C5A000AAEA10 /* Main.storyboard */, 0107509726E8C5A300AAEA10 /* Assets.xcassets */, 0107509926E8C5A300AAEA10 /* LaunchScreen.storyboard */, @@ -463,10 +457,8 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 0107509326E8C5A000AAEA10 /* ViewController.swift in Sources */, + 0121B2CE26E9B277008EE973 /* MJCoreDataTestModel.xcdatamodeld in Sources */, 0107508F26E8C59F00AAEA10 /* AppDelegate.swift in Sources */, - 010750A226E8C5EB00AAEA10 /* MJCoreDataTestModel.xcdatamodeld in Sources */, - 0107509126E8C5A000AAEA10 /* SceneDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -553,9 +545,10 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CODE_SIGN_ENTITLEMENTS = MJExtensionDemo/MJExtensionDemo.entitlements; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = NA88Z4T63A; + DEVELOPMENT_TEAM = ""; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = MJExtensionDemo/Info.plist; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; @@ -563,7 +556,6 @@ INFOPLIST_KEY_UIMainStoryboardFile = Main; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -571,6 +563,7 @@ MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = com.mj.MJExtension.MJExtensionDemo; PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTS_MACCATALYST = NO; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -586,9 +579,10 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CODE_SIGN_ENTITLEMENTS = MJExtensionDemo/MJExtensionDemo.entitlements; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = NA88Z4T63A; + DEVELOPMENT_TEAM = ""; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = MJExtensionDemo/Info.plist; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; @@ -596,7 +590,6 @@ INFOPLIST_KEY_UIMainStoryboardFile = Main; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -604,6 +597,7 @@ MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = com.mj.MJExtension.MJExtensionDemo; PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTS_MACCATALYST = NO; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_OPTIMIZATION_LEVEL = "-O"; @@ -747,6 +741,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.mj.MJExtension; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; + SUPPORTS_MACCATALYST = NO; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -774,6 +769,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.mj.MJExtension; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; + SUPPORTS_MACCATALYST = NO; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -786,6 +782,7 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = ""; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = MJExtensionTests/PrefixHeader.pch; INFOPLIST_FILE = MJExtensionTests/Info.plist; @@ -809,6 +806,7 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = ""; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = MJExtensionTests/PrefixHeader.pch; INFOPLIST_FILE = MJExtensionTests/Info.plist; diff --git a/MJExtensionDemo/AppDelegate.swift b/MJExtensionDemo/AppDelegate.swift index 4ac5bf43..0ea59201 100644 --- a/MJExtensionDemo/AppDelegate.swift +++ b/MJExtensionDemo/AppDelegate.swift @@ -10,28 +10,23 @@ import UIKit @main class AppDelegate: UIResponder, UIApplicationDelegate { - - + + var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } - // MARK: UISceneSession Lifecycle +} + - func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { - // Called when a new scene session is being created. - // Use this method to select a configuration to create the new scene with. - return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) - } +class ViewController: UIViewController { - func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { - // Called when the user discards a scene session. - // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. - // Use this method to release any resources that were specific to the discarded scenes, as they will not return. + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view. } } - diff --git a/MJExtensionDemo/Base.lproj/Main.storyboard b/MJExtensionDemo/Base.lproj/Main.storyboard index 75f3f5cf..f421a267 100644 --- a/MJExtensionDemo/Base.lproj/Main.storyboard +++ b/MJExtensionDemo/Base.lproj/Main.storyboard @@ -1,9 +1,9 @@ - + - + @@ -11,21 +11,28 @@ - + - - + + + + + diff --git a/MJExtensionDemo/Info.plist b/MJExtensionDemo/Info.plist index dd3c9afd..8c9bd452 100644 --- a/MJExtensionDemo/Info.plist +++ b/MJExtensionDemo/Info.plist @@ -2,24 +2,16 @@ - UIApplicationSceneManifest - - UIApplicationSupportsMultipleScenes - - UISceneConfigurations - - UIWindowSceneSessionRoleApplication - - - UISceneConfigurationName - Default Configuration - UISceneDelegateClassName - $(PRODUCT_MODULE_NAME).SceneDelegate - UISceneStoryboardFile - Main - - - - + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + diff --git a/MJExtensionDemo/SceneDelegate.swift b/MJExtensionDemo/SceneDelegate.swift deleted file mode 100644 index 2c4a5c2b..00000000 --- a/MJExtensionDemo/SceneDelegate.swift +++ /dev/null @@ -1,53 +0,0 @@ -// -// SceneDelegate.swift -// MJExtensionDemo -// -// Created by Frank on 2021/9/8. -// Copyright © 2021 MJ Lee. All rights reserved. -// - -import UIKit - -class SceneDelegate: UIResponder, UIWindowSceneDelegate { - - var window: UIWindow? - - - func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { - // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. - // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. - // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). - guard let _ = (scene as? UIWindowScene) else { return } - } - - func sceneDidDisconnect(_ scene: UIScene) { - // Called as the scene is being released by the system. - // This occurs shortly after the scene enters the background, or when its session is discarded. - // Release any resources associated with this scene that can be re-created the next time the scene connects. - // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). - } - - func sceneDidBecomeActive(_ scene: UIScene) { - // Called when the scene has moved from an inactive state to an active state. - // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. - } - - func sceneWillResignActive(_ scene: UIScene) { - // Called when the scene will move from an active state to an inactive state. - // This may occur due to temporary interruptions (ex. an incoming phone call). - } - - func sceneWillEnterForeground(_ scene: UIScene) { - // Called as the scene transitions from the background to the foreground. - // Use this method to undo the changes made on entering the background. - } - - func sceneDidEnterBackground(_ scene: UIScene) { - // Called as the scene transitions from the foreground to the background. - // Use this method to save data, release shared resources, and store enough scene-specific state information - // to restore the scene back to its current state. - } - - -} - diff --git a/MJExtensionDemo/ViewController.h b/MJExtensionDemo/ViewController.h deleted file mode 100644 index a51bdec0..00000000 --- a/MJExtensionDemo/ViewController.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// ViewController.h -// MJExtensionDemo -// -// Created by MJ Lee on 2019/8/29. -// Copyright © 2019 MJ Lee. All rights reserved. -// - -#import - -@interface ViewController : UIViewController - - -@end - diff --git a/MJExtensionDemo/ViewController.m b/MJExtensionDemo/ViewController.m deleted file mode 100644 index 2ca2fa15..00000000 --- a/MJExtensionDemo/ViewController.m +++ /dev/null @@ -1,23 +0,0 @@ -// -// ViewController.m -// MJExtensionDemo -// -// Created by MJ Lee on 2019/8/29. -// Copyright © 2019 MJ Lee. All rights reserved. -// - -#import "ViewController.h" - -@interface ViewController () - -@end - -@implementation ViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - // Do any additional setup after loading the view. -} - - -@end diff --git a/MJExtensionDemo/ViewController.swift b/MJExtensionDemo/ViewController.swift deleted file mode 100644 index 11309c1d..00000000 --- a/MJExtensionDemo/ViewController.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// ViewController.swift -// MJExtensionDemo -// -// Created by Frank on 2021/9/8. -// Copyright © 2021 MJ Lee. All rights reserved. -// - -import UIKit - -class ViewController: UIViewController { - - override func viewDidLoad() { - super.viewDidLoad() - // Do any additional setup after loading the view. - } - - -} -