diff --git a/README.md b/README.md index 56d5c50..3b6342a 100644 --- a/README.md +++ b/README.md @@ -209,3 +209,25 @@ npm run release #### Basic Usage 通过 RN 直接安装到通过数据线连着电脑的手机上。 + + + +---------- + + +### SHTLogin + +作者:何梓安 + +环境:IOS + +语言:Swift + +实现登录功能、记住密码、UI设计 + +使用方式:自行通过Xcode编译 + +---------- + + +### diff --git a/SHTLogin/LICENSE b/SHTLogin/LICENSE new file mode 100644 index 0000000..137fd96 --- /dev/null +++ b/SHTLogin/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 MasterFlower + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/SHTLogin/README.md b/SHTLogin/README.md new file mode 100644 index 0000000..819c320 --- /dev/null +++ b/SHTLogin/README.md @@ -0,0 +1,4 @@ +# SHTLogin +ShanghaiTech WIFI登录器 + + diff --git a/SHTLogin/SHTLogin.xcodeproj/project.pbxproj b/SHTLogin/SHTLogin.xcodeproj/project.pbxproj new file mode 100644 index 0000000..83427d4 --- /dev/null +++ b/SHTLogin/SHTLogin.xcodeproj/project.pbxproj @@ -0,0 +1,365 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 55; + objects = { + +/* Begin PBXBuildFile section */ + D70E9DC627E20A7800AE249C /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D70E9DC527E20A7800AE249C /* AppDelegate.swift */; }; + D70E9DC827E20A7800AE249C /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D70E9DC727E20A7800AE249C /* SceneDelegate.swift */; }; + D70E9DCA27E20A7800AE249C /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D70E9DC927E20A7800AE249C /* ViewController.swift */; }; + D70E9DCD27E20A7800AE249C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D70E9DCB27E20A7800AE249C /* Main.storyboard */; }; + D70E9DCF27E20A7800AE249C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D70E9DCE27E20A7800AE249C /* Assets.xcassets */; }; + D70E9DD227E20A7800AE249C /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D70E9DD027E20A7800AE249C /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + D70E9DC227E20A7800AE249C /* SHTLogin.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SHTLogin.app; sourceTree = BUILT_PRODUCTS_DIR; }; + D70E9DC527E20A7800AE249C /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + D70E9DC727E20A7800AE249C /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + D70E9DC927E20A7800AE249C /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + D70E9DCC27E20A7800AE249C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + D70E9DCE27E20A7800AE249C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + D70E9DD127E20A7800AE249C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + D70E9DD327E20A7800AE249C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + D70E9DBF27E20A7800AE249C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + D70E9DB927E20A7800AE249C = { + isa = PBXGroup; + children = ( + D70E9DC427E20A7800AE249C /* SHTLogin */, + D70E9DC327E20A7800AE249C /* Products */, + ); + sourceTree = ""; + }; + D70E9DC327E20A7800AE249C /* Products */ = { + isa = PBXGroup; + children = ( + D70E9DC227E20A7800AE249C /* SHTLogin.app */, + ); + name = Products; + sourceTree = ""; + }; + D70E9DC427E20A7800AE249C /* SHTLogin */ = { + isa = PBXGroup; + children = ( + D70E9DC527E20A7800AE249C /* AppDelegate.swift */, + D70E9DC727E20A7800AE249C /* SceneDelegate.swift */, + D70E9DC927E20A7800AE249C /* ViewController.swift */, + D70E9DCB27E20A7800AE249C /* Main.storyboard */, + D70E9DCE27E20A7800AE249C /* Assets.xcassets */, + D70E9DD027E20A7800AE249C /* LaunchScreen.storyboard */, + D70E9DD327E20A7800AE249C /* Info.plist */, + ); + path = SHTLogin; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + D70E9DC127E20A7800AE249C /* SHTLogin */ = { + isa = PBXNativeTarget; + buildConfigurationList = D70E9DD627E20A7800AE249C /* Build configuration list for PBXNativeTarget "SHTLogin" */; + buildPhases = ( + D70E9DBE27E20A7800AE249C /* Sources */, + D70E9DBF27E20A7800AE249C /* Frameworks */, + D70E9DC027E20A7800AE249C /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = SHTLogin; + productName = SHTLogin; + productReference = D70E9DC227E20A7800AE249C /* SHTLogin.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + D70E9DBA27E20A7800AE249C /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1330; + LastUpgradeCheck = 1330; + TargetAttributes = { + D70E9DC127E20A7800AE249C = { + CreatedOnToolsVersion = 13.3; + }; + }; + }; + buildConfigurationList = D70E9DBD27E20A7800AE249C /* Build configuration list for PBXProject "SHTLogin" */; + compatibilityVersion = "Xcode 13.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = D70E9DB927E20A7800AE249C; + productRefGroup = D70E9DC327E20A7800AE249C /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + D70E9DC127E20A7800AE249C /* SHTLogin */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + D70E9DC027E20A7800AE249C /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D70E9DD227E20A7800AE249C /* LaunchScreen.storyboard in Resources */, + D70E9DCF27E20A7800AE249C /* Assets.xcassets in Resources */, + D70E9DCD27E20A7800AE249C /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + D70E9DBE27E20A7800AE249C /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D70E9DCA27E20A7800AE249C /* ViewController.swift in Sources */, + D70E9DC627E20A7800AE249C /* AppDelegate.swift in Sources */, + D70E9DC827E20A7800AE249C /* SceneDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + D70E9DCB27E20A7800AE249C /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + D70E9DCC27E20A7800AE249C /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + D70E9DD027E20A7800AE249C /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + D70E9DD127E20A7800AE249C /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + D70E9DD427E20A7800AE249C /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 15.4; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + D70E9DD527E20A7800AE249C /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 15.4; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + D70E9DD727E20A7800AE249C /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = A6Y533PXAY; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = SHTLogin/Info.plist; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UIMainStoryboardFile = Main; + INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = UIInterfaceOrientationPortrait; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = cn.hezian.SHTLogin; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + D70E9DD827E20A7800AE249C /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = A6Y533PXAY; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = SHTLogin/Info.plist; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UIMainStoryboardFile = Main; + INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = UIInterfaceOrientationPortrait; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = cn.hezian.SHTLogin; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + D70E9DBD27E20A7800AE249C /* Build configuration list for PBXProject "SHTLogin" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D70E9DD427E20A7800AE249C /* Debug */, + D70E9DD527E20A7800AE249C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + D70E9DD627E20A7800AE249C /* Build configuration list for PBXNativeTarget "SHTLogin" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D70E9DD727E20A7800AE249C /* Debug */, + D70E9DD827E20A7800AE249C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = D70E9DBA27E20A7800AE249C /* Project object */; +} diff --git a/SHTLogin/SHTLogin.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/SHTLogin/SHTLogin.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/SHTLogin/SHTLogin.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/SHTLogin/SHTLogin.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/SHTLogin/SHTLogin.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/SHTLogin/SHTLogin.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/SHTLogin/SHTLogin.xcodeproj/project.xcworkspace/xcuserdata/silver.xcuserdatad/UserInterfaceState.xcuserstate b/SHTLogin/SHTLogin.xcodeproj/project.xcworkspace/xcuserdata/silver.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..f46042d Binary files /dev/null and b/SHTLogin/SHTLogin.xcodeproj/project.xcworkspace/xcuserdata/silver.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/SHTLogin/SHTLogin.xcodeproj/xcuserdata/silver.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/SHTLogin/SHTLogin.xcodeproj/xcuserdata/silver.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..ea5dd6a --- /dev/null +++ b/SHTLogin/SHTLogin.xcodeproj/xcuserdata/silver.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,6 @@ + + + diff --git a/SHTLogin/SHTLogin.xcodeproj/xcuserdata/silver.xcuserdatad/xcschemes/xcschememanagement.plist b/SHTLogin/SHTLogin.xcodeproj/xcuserdata/silver.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..b138bb0 --- /dev/null +++ b/SHTLogin/SHTLogin.xcodeproj/xcuserdata/silver.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + SHTLogin.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/SHTLogin/SHTLogin/AppDelegate.swift b/SHTLogin/SHTLogin/AppDelegate.swift new file mode 100644 index 0000000..d72d3c4 --- /dev/null +++ b/SHTLogin/SHTLogin/AppDelegate.swift @@ -0,0 +1,37 @@ +// +// AppDelegate.swift +// SHTLogin +// +// Created by Zian He on 2022/3/16. +// + +import UIKit + +@main +class AppDelegate: UIResponder, UIApplicationDelegate { + + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + Thread.sleep(forTimeInterval: 0.5) + 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) + } + + 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. + } + + +} + diff --git a/SHTLogin/SHTLogin/Assets.xcassets/AccentColor.colorset/Contents.json b/SHTLogin/SHTLogin/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/SHTLogin/SHTLogin/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/100.png b/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/100.png new file mode 100644 index 0000000..7ad6d89 Binary files /dev/null and b/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/100.png differ diff --git a/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/1024.png b/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/1024.png new file mode 100644 index 0000000..17b330f Binary files /dev/null and b/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/1024.png differ diff --git a/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/114.png b/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/114.png new file mode 100644 index 0000000..88bfef6 Binary files /dev/null and b/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/114.png differ diff --git a/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/120.png b/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/120.png new file mode 100644 index 0000000..ab80337 Binary files /dev/null and b/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/120.png differ diff --git a/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/144.png b/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/144.png new file mode 100644 index 0000000..55eae54 Binary files /dev/null and b/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/144.png differ diff --git a/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/152.png b/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/152.png new file mode 100644 index 0000000..bd021f6 Binary files /dev/null and b/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/152.png differ diff --git a/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/167.png b/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/167.png new file mode 100644 index 0000000..714c269 Binary files /dev/null and b/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/167.png differ diff --git a/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/180.png b/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/180.png new file mode 100644 index 0000000..de6c895 Binary files /dev/null and b/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/180.png differ diff --git a/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/20.png b/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/20.png new file mode 100644 index 0000000..c6b5ace Binary files /dev/null and b/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/20.png differ diff --git a/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/29.png b/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/29.png new file mode 100644 index 0000000..56e9d8b Binary files /dev/null and b/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/29.png differ diff --git a/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/40.png b/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/40.png new file mode 100644 index 0000000..dfbe535 Binary files /dev/null and b/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/40.png differ diff --git a/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/50.png b/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/50.png new file mode 100644 index 0000000..b31da58 Binary files /dev/null and b/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/50.png differ diff --git a/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/57.png b/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/57.png new file mode 100644 index 0000000..3ebd584 Binary files /dev/null and b/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/57.png differ diff --git a/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/58.png b/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/58.png new file mode 100644 index 0000000..825f64c Binary files /dev/null and b/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/58.png differ diff --git a/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/60.png b/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/60.png new file mode 100644 index 0000000..0ceaa26 Binary files /dev/null and b/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/60.png differ diff --git a/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/72.png b/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/72.png new file mode 100644 index 0000000..d10eac3 Binary files /dev/null and b/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/72.png differ diff --git a/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/76.png b/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/76.png new file mode 100644 index 0000000..a637d9d Binary files /dev/null and b/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/76.png differ diff --git a/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/80.png b/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/80.png new file mode 100644 index 0000000..e20aa0b Binary files /dev/null and b/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/80.png differ diff --git a/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/87.png b/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/87.png new file mode 100644 index 0000000..8126876 Binary files /dev/null and b/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/87.png differ diff --git a/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/Contents.json b/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..4fdf882 --- /dev/null +++ b/SHTLogin/SHTLogin/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,158 @@ +{ + "images" : [ + { + "filename" : "40.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "filename" : "60.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "filename" : "29.png", + "idiom" : "iphone", + "scale" : "1x", + "size" : "29x29" + }, + { + "filename" : "58.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "filename" : "87.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "filename" : "80.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "filename" : "120.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "filename" : "57.png", + "idiom" : "iphone", + "scale" : "1x", + "size" : "57x57" + }, + { + "filename" : "114.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "57x57" + }, + { + "filename" : "120.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "filename" : "180.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "filename" : "20.png", + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "filename" : "40.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "filename" : "29.png", + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "filename" : "58.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "filename" : "40.png", + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "filename" : "80.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "filename" : "50.png", + "idiom" : "ipad", + "scale" : "1x", + "size" : "50x50" + }, + { + "filename" : "100.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "50x50" + }, + { + "filename" : "72.png", + "idiom" : "ipad", + "scale" : "1x", + "size" : "72x72" + }, + { + "filename" : "144.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "72x72" + }, + { + "filename" : "76.png", + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "filename" : "152.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "filename" : "167.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "filename" : "1024.png", + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/SHTLogin/SHTLogin/Assets.xcassets/Contents.json b/SHTLogin/SHTLogin/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/SHTLogin/SHTLogin/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/SHTLogin/SHTLogin/Assets.xcassets/bg.colorset/Contents.json b/SHTLogin/SHTLogin/Assets.xcassets/bg.colorset/Contents.json new file mode 100644 index 0000000..2c6c457 --- /dev/null +++ b/SHTLogin/SHTLogin/Assets.xcassets/bg.colorset/Contents.json @@ -0,0 +1,148 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.071", + "green" : "0.039", + "red" : "0.616" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.071", + "green" : "0.039", + "red" : "0.616" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "contrast", + "value" : "high" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.071", + "green" : "0.039", + "red" : "0.616" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + }, + { + "appearance" : "contrast", + "value" : "high" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.071", + "green" : "0.039", + "red" : "0.616" + } + }, + "idiom" : "universal" + }, + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.071", + "green" : "0.039", + "red" : "0.616" + } + }, + "idiom" : "iphone" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.071", + "green" : "0.039", + "red" : "0.616" + } + }, + "idiom" : "iphone" + }, + { + "appearances" : [ + { + "appearance" : "contrast", + "value" : "high" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.071", + "green" : "0.039", + "red" : "0.616" + } + }, + "idiom" : "iphone" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + }, + { + "appearance" : "contrast", + "value" : "high" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.071", + "green" : "0.039", + "red" : "0.616" + } + }, + "idiom" : "iphone" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/SHTLogin/SHTLogin/Assets.xcassets/bg2.imageset/Contents.json b/SHTLogin/SHTLogin/Assets.xcassets/bg2.imageset/Contents.json new file mode 100644 index 0000000..732b6a7 --- /dev/null +++ b/SHTLogin/SHTLogin/Assets.xcassets/bg2.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "bg.jpg", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/SHTLogin/SHTLogin/Assets.xcassets/bg2.imageset/bg.jpg b/SHTLogin/SHTLogin/Assets.xcassets/bg2.imageset/bg.jpg new file mode 100644 index 0000000..ed8abaa Binary files /dev/null and b/SHTLogin/SHTLogin/Assets.xcassets/bg2.imageset/bg.jpg differ diff --git a/SHTLogin/SHTLogin/Assets.xcassets/bg3.imageset/11.jpg b/SHTLogin/SHTLogin/Assets.xcassets/bg3.imageset/11.jpg new file mode 100644 index 0000000..be66ede Binary files /dev/null and b/SHTLogin/SHTLogin/Assets.xcassets/bg3.imageset/11.jpg differ diff --git a/SHTLogin/SHTLogin/Assets.xcassets/bg3.imageset/Contents.json b/SHTLogin/SHTLogin/Assets.xcassets/bg3.imageset/Contents.json new file mode 100644 index 0000000..0461945 --- /dev/null +++ b/SHTLogin/SHTLogin/Assets.xcassets/bg3.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "11.jpg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/SHTLogin/SHTLogin/Assets.xcassets/bg4.imageset/4.jpg b/SHTLogin/SHTLogin/Assets.xcassets/bg4.imageset/4.jpg new file mode 100644 index 0000000..ceba2c5 Binary files /dev/null and b/SHTLogin/SHTLogin/Assets.xcassets/bg4.imageset/4.jpg differ diff --git a/SHTLogin/SHTLogin/Assets.xcassets/bg4.imageset/Contents.json b/SHTLogin/SHTLogin/Assets.xcassets/bg4.imageset/Contents.json new file mode 100644 index 0000000..424f84a --- /dev/null +++ b/SHTLogin/SHTLogin/Assets.xcassets/bg4.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "4.jpg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/SHTLogin/SHTLogin/Assets.xcassets/login.imageset/Contents.json b/SHTLogin/SHTLogin/Assets.xcassets/login.imageset/Contents.json new file mode 100644 index 0000000..892e1d4 --- /dev/null +++ b/SHTLogin/SHTLogin/Assets.xcassets/login.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "login_bg.jpg", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/SHTLogin/SHTLogin/Assets.xcassets/login.imageset/login_bg.jpg b/SHTLogin/SHTLogin/Assets.xcassets/login.imageset/login_bg.jpg new file mode 100644 index 0000000..f0c780f Binary files /dev/null and b/SHTLogin/SHTLogin/Assets.xcassets/login.imageset/login_bg.jpg differ diff --git a/SHTLogin/SHTLogin/Assets.xcassets/logo.imageset/Contents.json b/SHTLogin/SHTLogin/Assets.xcassets/logo.imageset/Contents.json new file mode 100644 index 0000000..9a315c9 --- /dev/null +++ b/SHTLogin/SHTLogin/Assets.xcassets/logo.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Group.svg", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/SHTLogin/SHTLogin/Assets.xcassets/logo.imageset/Group.svg b/SHTLogin/SHTLogin/Assets.xcassets/logo.imageset/Group.svg new file mode 100644 index 0000000..8a4bd24 --- /dev/null +++ b/SHTLogin/SHTLogin/Assets.xcassets/logo.imageset/Group.svg @@ -0,0 +1,176 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SHTLogin/SHTLogin/Assets.xcassets/pic.imageset/13.png b/SHTLogin/SHTLogin/Assets.xcassets/pic.imageset/13.png new file mode 100644 index 0000000..67a315c Binary files /dev/null and b/SHTLogin/SHTLogin/Assets.xcassets/pic.imageset/13.png differ diff --git a/SHTLogin/SHTLogin/Assets.xcassets/pic.imageset/Contents.json b/SHTLogin/SHTLogin/Assets.xcassets/pic.imageset/Contents.json new file mode 100644 index 0000000..4b96946 --- /dev/null +++ b/SHTLogin/SHTLogin/Assets.xcassets/pic.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "13.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/SHTLogin/SHTLogin/Assets.xcassets/white.colorset/Contents.json b/SHTLogin/SHTLogin/Assets.xcassets/white.colorset/Contents.json new file mode 100644 index 0000000..39c6f56 --- /dev/null +++ b/SHTLogin/SHTLogin/Assets.xcassets/white.colorset/Contents.json @@ -0,0 +1,78 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "1.000", + "green" : "1.000", + "red" : "1.000" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "1.000", + "green" : "1.000", + "red" : "1.000" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "contrast", + "value" : "high" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "1.000", + "green" : "1.000", + "red" : "1.000" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + }, + { + "appearance" : "contrast", + "value" : "high" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "1.000", + "green" : "1.000", + "red" : "1.000" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git "a/SHTLogin/SHTLogin/Assets.xcassets/\344\270\212\346\265\267\347\247\221\346\212\200\345\244\247\345\255\246.imageset/Contents.json" "b/SHTLogin/SHTLogin/Assets.xcassets/\344\270\212\346\265\267\347\247\221\346\212\200\345\244\247\345\255\246.imageset/Contents.json" new file mode 100644 index 0000000..e451b7b --- /dev/null +++ "b/SHTLogin/SHTLogin/Assets.xcassets/\344\270\212\346\265\267\347\247\221\346\212\200\345\244\247\345\255\246.imageset/Contents.json" @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Group (1).svg", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git "a/SHTLogin/SHTLogin/Assets.xcassets/\344\270\212\346\265\267\347\247\221\346\212\200\345\244\247\345\255\246.imageset/Group (1).svg" "b/SHTLogin/SHTLogin/Assets.xcassets/\344\270\212\346\265\267\347\247\221\346\212\200\345\244\247\345\255\246.imageset/Group (1).svg" new file mode 100644 index 0000000..36deca8 --- /dev/null +++ "b/SHTLogin/SHTLogin/Assets.xcassets/\344\270\212\346\265\267\347\247\221\346\212\200\345\244\247\345\255\246.imageset/Group (1).svg" @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SHTLogin/SHTLogin/Base.lproj/LaunchScreen.storyboard b/SHTLogin/SHTLogin/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..a723534 --- /dev/null +++ b/SHTLogin/SHTLogin/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SHTLogin/SHTLogin/Base.lproj/Main.storyboard b/SHTLogin/SHTLogin/Base.lproj/Main.storyboard new file mode 100644 index 0000000..d68ddf1 --- /dev/null +++ b/SHTLogin/SHTLogin/Base.lproj/Main.storyboard @@ -0,0 +1,149 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SHTLogin/SHTLogin/Info.plist b/SHTLogin/SHTLogin/Info.plist new file mode 100644 index 0000000..c0ae0b4 --- /dev/null +++ b/SHTLogin/SHTLogin/Info.plist @@ -0,0 +1,30 @@ + + + + + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + UISceneStoryboardFile + Main + + + + + + diff --git a/SHTLogin/SHTLogin/SceneDelegate.swift b/SHTLogin/SHTLogin/SceneDelegate.swift new file mode 100644 index 0000000..05cc923 --- /dev/null +++ b/SHTLogin/SHTLogin/SceneDelegate.swift @@ -0,0 +1,52 @@ +// +// SceneDelegate.swift +// SHTLogin +// +// Created by Zian He on 2022/3/16. +// + +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/SHTLogin/SHTLogin/ViewController.swift b/SHTLogin/SHTLogin/ViewController.swift new file mode 100644 index 0000000..f063dc3 --- /dev/null +++ b/SHTLogin/SHTLogin/ViewController.swift @@ -0,0 +1,144 @@ +// +// ViewController.swift +// SHTLogin +// +// Created by Zian He on 2022/3/16. +// +import UIKit +import WebKit +import SystemConfiguration + +class ViewController: UIViewController, WKUIDelegate { + struct DefaultsKeys { + static let name = "name" + static let pass = "pass" + } + var flg = 0 + + @IBOutlet weak var username: UITextField! + @IBOutlet weak var password: UITextField! + @IBOutlet weak var label: UILabel! + + @IBOutlet weak var web1: WKWebView! + + @IBAction func reload(_ sender: Any) { + label.text="" + loadweb() + } + @IBAction func connect(_ sender: Any) { + log() + } + @IBAction func check(_ sender: Any) { + if currentReachabilityStatus == .notReachable { + label.text="网络未连接" + //print("网络未连接") + // Network Unavailable + } else { + label.text="网络已连接" + //print("网络已连接") + // Network Available + } + } + + @IBAction func save(_ sender: Any) { + let defaults = UserDefaults.standard + let n1 = (username.text! as NSString) + let p1 = (password.text! as NSString) + defaults.set(n1, forKey: DefaultsKeys.name) + defaults.set(p1, forKey: DefaultsKeys.pass) + flg = 1 + } + // 点击屏幕收起键盘 + override func touchesBegan(_ touches: Set, with event: UIEvent?) { + + view.endEditing(true) + + } + + override func motionEnded(_ motion: UIEvent.EventSubtype, with event: UIEvent?) { + log() + } + + func log(){ + if flg == 1{ + if (!web1.isLoading) { + let defaults = UserDefaults.standard + let name1 = (defaults.string(forKey: DefaultsKeys.name)! as NSString) + let pass1 = (defaults.string(forKey: DefaultsKeys.pass)! as NSString) + web1.evaluateJavaScript("document.getElementById('username').value='\(name1)';") + web1.evaluateJavaScript("document.getElementById('password').value='\(pass1)';") + let jsString = "document.getElementById('loginBtn').click()" + web1.evaluateJavaScript(jsString)}} + else{ + let jsString = "document.getElementById('loginBtn').click()" + web1.evaluateJavaScript(jsString) + } + } + func loadweb(){ + let myURL = URL(string:"https://controller.shanghaitech.edu.cn:8445/PortalServer/customize/1478262836414/phone/auth.jsp") + let myRequest = URLRequest(url: myURL!) + web1.load(myRequest) + + let defaults = UserDefaults.standard + if (!DefaultsKeys.name.isEmpty) && (!DefaultsKeys.pass.isEmpty){ + let name1 = defaults.string(forKey: DefaultsKeys.name) + let pass1 = defaults.string(forKey: DefaultsKeys.pass) + username.text = name1 + password.text = pass1 + } + } + + override func viewDidLoad() { + super.viewDidLoad() + loadweb() + } +} + +protocol Utilities {} +extension NSObject: Utilities { + enum ReachabilityStatus { + case notReachable + case reachableViaWWAN + case reachableViaWiFi + } + + var currentReachabilityStatus: ReachabilityStatus { + + var zeroAddress = sockaddr_in() + zeroAddress.sin_len = UInt8(MemoryLayout.size) + zeroAddress.sin_family = sa_family_t(AF_INET) + guard let defaultRouteReachability = withUnsafePointer(to: &zeroAddress, { + $0.withMemoryRebound(to: sockaddr.self, capacity: 1) { + SCNetworkReachabilityCreateWithAddress(nil, $0) + } + }) else { + return .notReachable + } + + var flags: SCNetworkReachabilityFlags = [] + if !SCNetworkReachabilityGetFlags(defaultRouteReachability, &flags) { + return .notReachable + } + + if flags.contains(.reachable) == false { + // The target host is not reachable. + return .notReachable + } + else if flags.contains(.isWWAN) == true { + // WWAN connections are OK if the calling application is using the CFNetwork APIs. + return .reachableViaWWAN + } + else if flags.contains(.connectionRequired) == false { + // If the target host is reachable and no connection is required then we'll assume that you're on Wi-Fi... + return .reachableViaWiFi + } + else if (flags.contains(.connectionOnDemand) == true || flags.contains(.connectionOnTraffic) == true) && flags.contains(.interventionRequired) == false { + // The connection is on-demand (or on-traffic) if the calling application is using the CFSocketStream or higher APIs and no [user] intervention is needed + return .reachableViaWiFi + } + else { + return .notReachable + } + } +} + diff --git a/SHTLogin/image/image.PNG b/SHTLogin/image/image.PNG new file mode 100644 index 0000000..842fda8 Binary files /dev/null and b/SHTLogin/image/image.PNG differ