diff --git a/networkexiercise/networkexiercise.xcodeproj/project.pbxproj b/networkexiercise/networkexiercise.xcodeproj/project.pbxproj new file mode 100644 index 0000000..d4ba244 --- /dev/null +++ b/networkexiercise/networkexiercise.xcodeproj/project.pbxproj @@ -0,0 +1,407 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 56; + objects = { + +/* Begin PBXBuildFile section */ + 80D7E07A2B0A21FE00C44269 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80D7E0792B0A21FE00C44269 /* AppDelegate.swift */; }; + 80D7E07C2B0A21FE00C44269 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80D7E07B2B0A21FE00C44269 /* SceneDelegate.swift */; }; + 80D7E07E2B0A21FE00C44269 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80D7E07D2B0A21FE00C44269 /* ViewController.swift */; }; + 80D7E0832B0A21FF00C44269 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 80D7E0822B0A21FF00C44269 /* Assets.xcassets */; }; + 80D7E0862B0A21FF00C44269 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 80D7E0842B0A21FF00C44269 /* LaunchScreen.storyboard */; }; + 80D7E08F2B0A22AE00C44269 /* Moya in Frameworks */ = {isa = PBXBuildFile; productRef = 80D7E08E2B0A22AE00C44269 /* Moya */; }; + 80D7E0922B0A22C500C44269 /* SnapKit in Frameworks */ = {isa = PBXBuildFile; productRef = 80D7E0912B0A22C500C44269 /* SnapKit */; }; + 80D7E0942B0A22D000C44269 /* weatherAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80D7E0932B0A22D000C44269 /* weatherAPI.swift */; }; + 80D7E0962B0A311C00C44269 /* weather.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80D7E0952B0A311C00C44269 /* weather.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 80D7E0762B0A21FE00C44269 /* networkexiercise.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = networkexiercise.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 80D7E0792B0A21FE00C44269 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 80D7E07B2B0A21FE00C44269 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + 80D7E07D2B0A21FE00C44269 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 80D7E0822B0A21FF00C44269 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 80D7E0852B0A21FF00C44269 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 80D7E0872B0A21FF00C44269 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 80D7E0932B0A22D000C44269 /* weatherAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = weatherAPI.swift; sourceTree = ""; }; + 80D7E0952B0A311C00C44269 /* weather.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = weather.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 80D7E0732B0A21FE00C44269 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 80D7E08F2B0A22AE00C44269 /* Moya in Frameworks */, + 80D7E0922B0A22C500C44269 /* SnapKit in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 80D7E06D2B0A21FE00C44269 = { + isa = PBXGroup; + children = ( + 80D7E0782B0A21FE00C44269 /* networkexiercise */, + 80D7E0772B0A21FE00C44269 /* Products */, + ); + sourceTree = ""; + }; + 80D7E0772B0A21FE00C44269 /* Products */ = { + isa = PBXGroup; + children = ( + 80D7E0762B0A21FE00C44269 /* networkexiercise.app */, + ); + name = Products; + sourceTree = ""; + }; + 80D7E0782B0A21FE00C44269 /* networkexiercise */ = { + isa = PBXGroup; + children = ( + 80D7E0972B0A312300C44269 /* Model */, + 80D7E0932B0A22D000C44269 /* weatherAPI.swift */, + 80D7E0792B0A21FE00C44269 /* AppDelegate.swift */, + 80D7E07B2B0A21FE00C44269 /* SceneDelegate.swift */, + 80D7E07D2B0A21FE00C44269 /* ViewController.swift */, + 80D7E0822B0A21FF00C44269 /* Assets.xcassets */, + 80D7E0842B0A21FF00C44269 /* LaunchScreen.storyboard */, + 80D7E0872B0A21FF00C44269 /* Info.plist */, + ); + path = networkexiercise; + sourceTree = ""; + }; + 80D7E0972B0A312300C44269 /* Model */ = { + isa = PBXGroup; + children = ( + 80D7E0952B0A311C00C44269 /* weather.swift */, + ); + path = Model; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 80D7E0752B0A21FE00C44269 /* networkexiercise */ = { + isa = PBXNativeTarget; + buildConfigurationList = 80D7E08A2B0A21FF00C44269 /* Build configuration list for PBXNativeTarget "networkexiercise" */; + buildPhases = ( + 80D7E0722B0A21FE00C44269 /* Sources */, + 80D7E0732B0A21FE00C44269 /* Frameworks */, + 80D7E0742B0A21FE00C44269 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = networkexiercise; + packageProductDependencies = ( + 80D7E08E2B0A22AE00C44269 /* Moya */, + 80D7E0912B0A22C500C44269 /* SnapKit */, + ); + productName = networkexiercise; + productReference = 80D7E0762B0A21FE00C44269 /* networkexiercise.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 80D7E06E2B0A21FE00C44269 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1420; + LastUpgradeCheck = 1420; + TargetAttributes = { + 80D7E0752B0A21FE00C44269 = { + CreatedOnToolsVersion = 14.2; + }; + }; + }; + buildConfigurationList = 80D7E0712B0A21FE00C44269 /* Build configuration list for PBXProject "networkexiercise" */; + compatibilityVersion = "Xcode 14.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 80D7E06D2B0A21FE00C44269; + packageReferences = ( + 80D7E08D2B0A22AE00C44269 /* XCRemoteSwiftPackageReference "Moya" */, + 80D7E0902B0A22C500C44269 /* XCRemoteSwiftPackageReference "SnapKit" */, + ); + productRefGroup = 80D7E0772B0A21FE00C44269 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 80D7E0752B0A21FE00C44269 /* networkexiercise */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 80D7E0742B0A21FE00C44269 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 80D7E0862B0A21FF00C44269 /* LaunchScreen.storyboard in Resources */, + 80D7E0832B0A21FF00C44269 /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 80D7E0722B0A21FE00C44269 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 80D7E0962B0A311C00C44269 /* weather.swift in Sources */, + 80D7E07E2B0A21FE00C44269 /* ViewController.swift in Sources */, + 80D7E0942B0A22D000C44269 /* weatherAPI.swift in Sources */, + 80D7E07A2B0A21FE00C44269 /* AppDelegate.swift in Sources */, + 80D7E07C2B0A21FE00C44269 /* SceneDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 80D7E0842B0A21FF00C44269 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 80D7E0852B0A21FF00C44269 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 80D7E0882B0A21FF00C44269 /* 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++20"; + 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 = 16.2; + 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; + }; + 80D7E0892B0A21FF00C44269 /* 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++20"; + 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 = 16.2; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 80D7E08B2B0A21FF00C44269 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = networkexiercise/Info.plist; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = soomin.networkexiercise; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 80D7E08C2B0A21FF00C44269 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = networkexiercise/Info.plist; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = soomin.networkexiercise; + 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 */ + 80D7E0712B0A21FE00C44269 /* Build configuration list for PBXProject "networkexiercise" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 80D7E0882B0A21FF00C44269 /* Debug */, + 80D7E0892B0A21FF00C44269 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 80D7E08A2B0A21FF00C44269 /* Build configuration list for PBXNativeTarget "networkexiercise" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 80D7E08B2B0A21FF00C44269 /* Debug */, + 80D7E08C2B0A21FF00C44269 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + +/* Begin XCRemoteSwiftPackageReference section */ + 80D7E08D2B0A22AE00C44269 /* XCRemoteSwiftPackageReference "Moya" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/Moya/Moya.git"; + requirement = { + branch = master; + kind = branch; + }; + }; + 80D7E0902B0A22C500C44269 /* XCRemoteSwiftPackageReference "SnapKit" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/SnapKit/SnapKit.git"; + requirement = { + branch = develop; + kind = branch; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 80D7E08E2B0A22AE00C44269 /* Moya */ = { + isa = XCSwiftPackageProductDependency; + package = 80D7E08D2B0A22AE00C44269 /* XCRemoteSwiftPackageReference "Moya" */; + productName = Moya; + }; + 80D7E0912B0A22C500C44269 /* SnapKit */ = { + isa = XCSwiftPackageProductDependency; + package = 80D7E0902B0A22C500C44269 /* XCRemoteSwiftPackageReference "SnapKit" */; + productName = SnapKit; + }; +/* End XCSwiftPackageProductDependency section */ + }; + rootObject = 80D7E06E2B0A21FE00C44269 /* Project object */; +} diff --git a/networkexiercise/networkexiercise.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/networkexiercise/networkexiercise.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/networkexiercise/networkexiercise.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/networkexiercise/networkexiercise.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/networkexiercise/networkexiercise.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/networkexiercise/networkexiercise.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/networkexiercise/networkexiercise.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/networkexiercise/networkexiercise.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 0000000..da1142b --- /dev/null +++ b/networkexiercise/networkexiercise.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,50 @@ +{ + "pins" : [ + { + "identity" : "alamofire", + "kind" : "remoteSourceControl", + "location" : "https://github.com/Alamofire/Alamofire.git", + "state" : { + "revision" : "3dc6a42c7727c49bf26508e29b0a0b35f9c7e1ad", + "version" : "5.8.1" + } + }, + { + "identity" : "moya", + "kind" : "remoteSourceControl", + "location" : "https://github.com/Moya/Moya.git", + "state" : { + "branch" : "master", + "revision" : "963654cd4f82d17d7546b9d6127c29f6df091717" + } + }, + { + "identity" : "reactiveswift", + "kind" : "remoteSourceControl", + "location" : "https://github.com/ReactiveCocoa/ReactiveSwift.git", + "state" : { + "revision" : "c43bae3dac73fdd3cb906bd5a1914686ca71ed3c", + "version" : "6.7.0" + } + }, + { + "identity" : "rxswift", + "kind" : "remoteSourceControl", + "location" : "https://github.com/ReactiveX/RxSwift.git", + "state" : { + "revision" : "9dcaa4b333db437b0fbfaf453fad29069044a8b4", + "version" : "6.6.0" + } + }, + { + "identity" : "snapkit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/SnapKit/SnapKit.git", + "state" : { + "branch" : "develop", + "revision" : "4d52cc3768ec5d345827b063dfa59e98a929965d" + } + } + ], + "version" : 2 +} diff --git a/networkexiercise/networkexiercise/AppDelegate.swift b/networkexiercise/networkexiercise/AppDelegate.swift new file mode 100644 index 0000000..d8f3e60 --- /dev/null +++ b/networkexiercise/networkexiercise/AppDelegate.swift @@ -0,0 +1,36 @@ +// +// AppDelegate.swift +// networkexiercise +// +// Created by 김수민 on 2023/11/19. +// + +import UIKit + +@main +class AppDelegate: UIResponder, UIApplicationDelegate { + + + + 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) + } + + 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/networkexiercise/networkexiercise/Assets.xcassets/AccentColor.colorset/Contents.json b/networkexiercise/networkexiercise/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/networkexiercise/networkexiercise/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/networkexiercise/networkexiercise/Assets.xcassets/AppIcon.appiconset/Contents.json b/networkexiercise/networkexiercise/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..13613e3 --- /dev/null +++ b/networkexiercise/networkexiercise/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,13 @@ +{ + "images" : [ + { + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/networkexiercise/networkexiercise/Assets.xcassets/Contents.json b/networkexiercise/networkexiercise/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/networkexiercise/networkexiercise/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/networkexiercise/networkexiercise/Base.lproj/LaunchScreen.storyboard b/networkexiercise/networkexiercise/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..865e932 --- /dev/null +++ b/networkexiercise/networkexiercise/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/networkexiercise/networkexiercise/Info.plist b/networkexiercise/networkexiercise/Info.plist new file mode 100644 index 0000000..0eb786d --- /dev/null +++ b/networkexiercise/networkexiercise/Info.plist @@ -0,0 +1,23 @@ + + + + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + + + + + + diff --git a/networkexiercise/networkexiercise/Model/weather.swift b/networkexiercise/networkexiercise/Model/weather.swift new file mode 100644 index 0000000..95bb3a1 --- /dev/null +++ b/networkexiercise/networkexiercise/Model/weather.swift @@ -0,0 +1,16 @@ +// +// weather.swift +// networkexiercise +// +// Created by 김수민 on 2023/11/19. +// + +import Foundation + +struct weather: Decodable { + var lat: Double + var lon: Double + var timezone: String + var timezone_offset: Int +} + diff --git a/networkexiercise/networkexiercise/SceneDelegate.swift b/networkexiercise/networkexiercise/SceneDelegate.swift new file mode 100644 index 0000000..6609b34 --- /dev/null +++ b/networkexiercise/networkexiercise/SceneDelegate.swift @@ -0,0 +1,58 @@ +// +// SceneDelegate.swift +// WeekFour +// +// Created by 김수민 on 2023/11/09. +// + + +import UIKit + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + + var window: UIWindow? + + + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + guard let windowScene = (scene as? UIWindowScene) else { return } + window = UIWindow(windowScene: windowScene) // SceneDelegate의 프로퍼티에 설정해줌 + let mainViewController = ViewController() // 맨 처음 보여줄 ViewController + + window?.rootViewController = mainViewController + window?.makeKeyAndVisible() + } + + + 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/networkexiercise/networkexiercise/ViewController.swift b/networkexiercise/networkexiercise/ViewController.swift new file mode 100644 index 0000000..cc9438d --- /dev/null +++ b/networkexiercise/networkexiercise/ViewController.swift @@ -0,0 +1,75 @@ +// +// ViewController.swift +// networkexiercise +// +// Created by 김수민 on 2023/11/19. +// +import SnapKit +import UIKit +import Moya +class ViewController: UIViewController { + let apiKey = "206b9ba8742999c6453ebc8907feef22" // OpenWeatherMap에서 발급받은 API 키를 사용해야 합니다. + let provider = MoyaProvider() + + + override func viewDidLoad() { + super.viewDidLoad() + configUI() + layout() + setAPIValue() + } + + var testTextview: UITextView { + let textView = UITextView() + textView.frame = CGRect(x: 20, y: 100, width: 300, height: 200) + textView.font = UIFont.systemFont(ofSize: 16) + textView.text = "안녕하세요, UITextView 예제입니다." + return textView + } + + var apiButton: UIButton { + let apiButton = UIButton(type: .system) // 시스템 버튼으로 초기화 + apiButton.setTitle("버튼", for: .normal) + apiButton.backgroundColor = .blue + return apiButton + } + + func configUI() { + view.addSubview(testTextview) + view.addSubview(apiButton) + } + + func layout(){ + apiButton.snp.makeConstraints { make in +// make.top.equalTo(testTextview.snp.bottom).offset(10) // 텍스트 뷰 아래로 10포인트 떨어짐 + make.centerX.equalToSuperview() + } + apiButton.snp.makeConstraints { make in +// make.top.equalTo(testTextview.snp.bottom).offset(10) // 텍스트 뷰 아래로 10포인트 떨어짐 + make.centerX.equalToSuperview() + } + } + + + + // API 호출 예제 + func setAPIValue(){ + + provider.request(.oneCall(lat: 37.7749, lon: -122.4194, exclude: ["current", "minutely", "hourly", "daily", "alerts"], apiKey: self.apiKey)) { result in + switch result { + case let .success(response): + // API 요청이 성공한 경우 처리 + print(response) + let result = try? response.map(weather.self) + if let result = result?.timezone { + self.testTextview.text = result + print(result) + } + case let .failure(error): + // API 요청이 실패한 경우 처리 + print(error) + } + } + } + +} diff --git a/networkexiercise/networkexiercise/weatherAPI.swift b/networkexiercise/networkexiercise/weatherAPI.swift new file mode 100644 index 0000000..f184573 --- /dev/null +++ b/networkexiercise/networkexiercise/weatherAPI.swift @@ -0,0 +1,45 @@ +// +// weatherAPI.swift +// networkexiercise +// +// Created by 김수민 on 2023/11/19. +// + +import Foundation +import Moya + +enum WeatherAPI { + case oneCall(lat: Double, lon: Double, exclude: [String], apiKey: String) +} + +extension WeatherAPI: TargetType { + var baseURL: URL { + return URL(string: "https://api.openweathermap.org/data/3.0")! + } + + var path: String { + switch self { + case .oneCall: + return "/onecall" + } + } + + var method: Moya.Method { + return .get + } + + var sampleData: Data { + return Data() + } + + var task: Task { + switch self { + case let .oneCall(lat, lon, exclude, apiKey): + return .requestParameters(parameters: ["lat": lat, "lon": lon, "exclude": exclude, "appid": apiKey], encoding: URLEncoding.default) + } + } + + var headers: [String: String]? { + return ["Content-type": "application/json"] + } +}