diff --git a/week4_min0/week4_min0.xcodeproj/project.pbxproj b/week4_min0/week4_min0.xcodeproj/project.pbxproj new file mode 100644 index 0000000..adae056 --- /dev/null +++ b/week4_min0/week4_min0.xcodeproj/project.pbxproj @@ -0,0 +1,390 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 56; + objects = { + +/* Begin PBXBuildFile section */ + D234F2392BF0F7A800612030 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D234F2382BF0F7A800612030 /* AppDelegate.swift */; }; + D234F23B2BF0F7A800612030 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D234F23A2BF0F7A800612030 /* SceneDelegate.swift */; }; + D234F23D2BF0F7A800612030 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D234F23C2BF0F7A800612030 /* ViewController.swift */; }; + D234F2422BF0F7A900612030 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D234F2412BF0F7A900612030 /* Assets.xcassets */; }; + D234F2452BF0F7A900612030 /* Base in Resources */ = {isa = PBXBuildFile; fileRef = D234F2442BF0F7A900612030 /* Base */; }; + D234F2E92BF2815A00612030 /* Day.swift in Sources */ = {isa = PBXBuildFile; fileRef = D234F2E82BF2815A00612030 /* Day.swift */; }; + D234F2EE2BF28A9700612030 /* Tommorow.swift in Sources */ = {isa = PBXBuildFile; fileRef = D234F2ED2BF28A9700612030 /* Tommorow.swift */; }; + D24F2CB82BF3612F00BE823B /* WeekCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D24F2CB72BF3612F00BE823B /* WeekCell.swift */; }; + D24F2CBA2BF3AE7E00BE823B /* TommorowCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D24F2CB92BF3AE7E00BE823B /* TommorowCell.swift */; }; + D24F2CBC2BF3B19800BE823B /* CompositionalLayoutSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = D24F2CBB2BF3B19800BE823B /* CompositionalLayoutSection.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + D234F2352BF0F7A800612030 /* week4_min0.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = week4_min0.app; sourceTree = BUILT_PRODUCTS_DIR; }; + D234F2382BF0F7A800612030 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + D234F23A2BF0F7A800612030 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + D234F23C2BF0F7A800612030 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + D234F2412BF0F7A900612030 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + D234F2442BF0F7A900612030 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + D234F2462BF0F7A900612030 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + D234F2E82BF2815A00612030 /* Day.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Day.swift; sourceTree = ""; }; + D234F2ED2BF28A9700612030 /* Tommorow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tommorow.swift; sourceTree = ""; }; + D24F2CB72BF3612F00BE823B /* WeekCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WeekCell.swift; sourceTree = ""; }; + D24F2CB92BF3AE7E00BE823B /* TommorowCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TommorowCell.swift; sourceTree = ""; }; + D24F2CBB2BF3B19800BE823B /* CompositionalLayoutSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CompositionalLayoutSection.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + D234F2322BF0F7A800612030 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + D234F22C2BF0F7A800612030 = { + isa = PBXGroup; + children = ( + D234F2372BF0F7A800612030 /* week4_min0 */, + D234F2362BF0F7A800612030 /* Products */, + ); + sourceTree = ""; + }; + D234F2362BF0F7A800612030 /* Products */ = { + isa = PBXGroup; + children = ( + D234F2352BF0F7A800612030 /* week4_min0.app */, + ); + name = Products; + sourceTree = ""; + }; + D234F2372BF0F7A800612030 /* week4_min0 */ = { + isa = PBXGroup; + children = ( + D234F2EA2BF289BE00612030 /* Cells */, + D234F2E72BF2812000612030 /* Models */, + D234F2382BF0F7A800612030 /* AppDelegate.swift */, + D234F23A2BF0F7A800612030 /* SceneDelegate.swift */, + D234F23C2BF0F7A800612030 /* ViewController.swift */, + D24F2CBB2BF3B19800BE823B /* CompositionalLayoutSection.swift */, + D234F2412BF0F7A900612030 /* Assets.xcassets */, + D234F2432BF0F7A900612030 /* LaunchScreen.storyboard */, + D234F2462BF0F7A900612030 /* Info.plist */, + ); + path = week4_min0; + sourceTree = ""; + }; + D234F2E72BF2812000612030 /* Models */ = { + isa = PBXGroup; + children = ( + D234F2E82BF2815A00612030 /* Day.swift */, + D234F2ED2BF28A9700612030 /* Tommorow.swift */, + ); + path = Models; + sourceTree = ""; + }; + D234F2EA2BF289BE00612030 /* Cells */ = { + isa = PBXGroup; + children = ( + D24F2CB72BF3612F00BE823B /* WeekCell.swift */, + D24F2CB92BF3AE7E00BE823B /* TommorowCell.swift */, + ); + path = Cells; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + D234F2342BF0F7A800612030 /* week4_min0 */ = { + isa = PBXNativeTarget; + buildConfigurationList = D234F2492BF0F7A900612030 /* Build configuration list for PBXNativeTarget "week4_min0" */; + buildPhases = ( + D234F2312BF0F7A800612030 /* Sources */, + D234F2322BF0F7A800612030 /* Frameworks */, + D234F2332BF0F7A800612030 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = week4_min0; + productName = week4_min0; + productReference = D234F2352BF0F7A800612030 /* week4_min0.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + D234F22D2BF0F7A800612030 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1530; + LastUpgradeCheck = 1530; + TargetAttributes = { + D234F2342BF0F7A800612030 = { + CreatedOnToolsVersion = 15.3; + }; + }; + }; + buildConfigurationList = D234F2302BF0F7A800612030 /* Build configuration list for PBXProject "week4_min0" */; + compatibilityVersion = "Xcode 14.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = D234F22C2BF0F7A800612030; + productRefGroup = D234F2362BF0F7A800612030 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + D234F2342BF0F7A800612030 /* week4_min0 */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + D234F2332BF0F7A800612030 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D234F2422BF0F7A900612030 /* Assets.xcassets in Resources */, + D234F2452BF0F7A900612030 /* Base in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + D234F2312BF0F7A800612030 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D234F23D2BF0F7A800612030 /* ViewController.swift in Sources */, + D234F2E92BF2815A00612030 /* Day.swift in Sources */, + D234F2EE2BF28A9700612030 /* Tommorow.swift in Sources */, + D234F2392BF0F7A800612030 /* AppDelegate.swift in Sources */, + D24F2CBA2BF3AE7E00BE823B /* TommorowCell.swift in Sources */, + D24F2CB82BF3612F00BE823B /* WeekCell.swift in Sources */, + D24F2CBC2BF3B19800BE823B /* CompositionalLayoutSection.swift in Sources */, + D234F23B2BF0F7A800612030 /* SceneDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + D234F2432BF0F7A900612030 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + D234F2442BF0F7A900612030 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + D234F2472BF0F7A900612030 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + 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; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + 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 = 17.4; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + D234F2482BF0F7A900612030 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + 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; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + 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 = 17.4; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + D234F24A2BF0F7A900612030 /* 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 = 8383VR3NFP; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = week4_min0/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 = "com.mminy62.week4-min0"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + D234F24B2BF0F7A900612030 /* 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 = 8383VR3NFP; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = week4_min0/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 = "com.mminy62.week4-min0"; + 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 */ + D234F2302BF0F7A800612030 /* Build configuration list for PBXProject "week4_min0" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D234F2472BF0F7A900612030 /* Debug */, + D234F2482BF0F7A900612030 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + D234F2492BF0F7A900612030 /* Build configuration list for PBXNativeTarget "week4_min0" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D234F24A2BF0F7A900612030 /* Debug */, + D234F24B2BF0F7A900612030 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = D234F22D2BF0F7A800612030 /* Project object */; +} diff --git a/week4_min0/week4_min0.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/week4_min0/week4_min0.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/week4_min0/week4_min0.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/week4_min0/week4_min0.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/week4_min0/week4_min0.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/week4_min0/week4_min0.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/week4_min0/week4_min0/AppDelegate.swift b/week4_min0/week4_min0/AppDelegate.swift new file mode 100644 index 0000000..47e2dec --- /dev/null +++ b/week4_min0/week4_min0/AppDelegate.swift @@ -0,0 +1,33 @@ +// +// AppDelegate.swift +// week4_min0 +// +// Created by 이민영 on 5/12/24. +// + +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/week4_min0/week4_min0/Assets.xcassets/AccentColor.colorset/Contents.json b/week4_min0/week4_min0/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/week4_min0/week4_min0/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/week4_min0/week4_min0/Assets.xcassets/AppIcon.appiconset/Contents.json b/week4_min0/week4_min0/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..13613e3 --- /dev/null +++ b/week4_min0/week4_min0/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/week4_min0/week4_min0/Assets.xcassets/Contents.json b/week4_min0/week4_min0/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/week4_min0/week4_min0/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/week4_min0/week4_min0/Assets.xcassets/cloud_thunder.imageset/Contents.json b/week4_min0/week4_min0/Assets.xcassets/cloud_thunder.imageset/Contents.json new file mode 100644 index 0000000..9c3cfdc --- /dev/null +++ b/week4_min0/week4_min0/Assets.xcassets/cloud_thunder.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "cloud_thunder.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/week4_min0/week4_min0/Assets.xcassets/cloud_thunder.imageset/cloud_thunder.png b/week4_min0/week4_min0/Assets.xcassets/cloud_thunder.imageset/cloud_thunder.png new file mode 100644 index 0000000..bd672c7 Binary files /dev/null and b/week4_min0/week4_min0/Assets.xcassets/cloud_thunder.imageset/cloud_thunder.png differ diff --git a/week4_min0/week4_min0/Assets.xcassets/cloudy.imageset/Contents.json b/week4_min0/week4_min0/Assets.xcassets/cloudy.imageset/Contents.json new file mode 100644 index 0000000..eff8219 --- /dev/null +++ b/week4_min0/week4_min0/Assets.xcassets/cloudy.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "cloudy.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/week4_min0/week4_min0/Assets.xcassets/cloudy.imageset/cloudy.png b/week4_min0/week4_min0/Assets.xcassets/cloudy.imageset/cloudy.png new file mode 100644 index 0000000..6cf550f Binary files /dev/null and b/week4_min0/week4_min0/Assets.xcassets/cloudy.imageset/cloudy.png differ diff --git a/week4_min0/week4_min0/Assets.xcassets/humid_percent.imageset/Contents.json b/week4_min0/week4_min0/Assets.xcassets/humid_percent.imageset/Contents.json new file mode 100644 index 0000000..14e15f5 --- /dev/null +++ b/week4_min0/week4_min0/Assets.xcassets/humid_percent.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "humid_percent.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/week4_min0/week4_min0/Assets.xcassets/humid_percent.imageset/humid_percent.png b/week4_min0/week4_min0/Assets.xcassets/humid_percent.imageset/humid_percent.png new file mode 100644 index 0000000..e7f653f Binary files /dev/null and b/week4_min0/week4_min0/Assets.xcassets/humid_percent.imageset/humid_percent.png differ diff --git a/week4_min0/week4_min0/Assets.xcassets/rain_percent.imageset/Contents.json b/week4_min0/week4_min0/Assets.xcassets/rain_percent.imageset/Contents.json new file mode 100644 index 0000000..690cc12 --- /dev/null +++ b/week4_min0/week4_min0/Assets.xcassets/rain_percent.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "rain_percent.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/week4_min0/week4_min0/Assets.xcassets/rain_percent.imageset/rain_percent.png b/week4_min0/week4_min0/Assets.xcassets/rain_percent.imageset/rain_percent.png new file mode 100644 index 0000000..b6db27a Binary files /dev/null and b/week4_min0/week4_min0/Assets.xcassets/rain_percent.imageset/rain_percent.png differ diff --git a/week4_min0/week4_min0/Assets.xcassets/rain_thunder.imageset/Contents.json b/week4_min0/week4_min0/Assets.xcassets/rain_thunder.imageset/Contents.json new file mode 100644 index 0000000..30483a8 --- /dev/null +++ b/week4_min0/week4_min0/Assets.xcassets/rain_thunder.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "rain_thunder.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/week4_min0/week4_min0/Assets.xcassets/rain_thunder.imageset/rain_thunder.png b/week4_min0/week4_min0/Assets.xcassets/rain_thunder.imageset/rain_thunder.png new file mode 100644 index 0000000..0279e87 Binary files /dev/null and b/week4_min0/week4_min0/Assets.xcassets/rain_thunder.imageset/rain_thunder.png differ diff --git a/week4_min0/week4_min0/Assets.xcassets/rainy.imageset/Contents.json b/week4_min0/week4_min0/Assets.xcassets/rainy.imageset/Contents.json new file mode 100644 index 0000000..4226368 --- /dev/null +++ b/week4_min0/week4_min0/Assets.xcassets/rainy.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "sun_rain.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/week4_min0/week4_min0/Assets.xcassets/rainy.imageset/sun_rain.png b/week4_min0/week4_min0/Assets.xcassets/rainy.imageset/sun_rain.png new file mode 100644 index 0000000..2dadacf Binary files /dev/null and b/week4_min0/week4_min0/Assets.xcassets/rainy.imageset/sun_rain.png differ diff --git a/week4_min0/week4_min0/Assets.xcassets/snow.imageset/Contents.json b/week4_min0/week4_min0/Assets.xcassets/snow.imageset/Contents.json new file mode 100644 index 0000000..82266c5 --- /dev/null +++ b/week4_min0/week4_min0/Assets.xcassets/snow.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "snow.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/week4_min0/week4_min0/Assets.xcassets/snow.imageset/snow.png b/week4_min0/week4_min0/Assets.xcassets/snow.imageset/snow.png new file mode 100644 index 0000000..7b3eef0 Binary files /dev/null and b/week4_min0/week4_min0/Assets.xcassets/snow.imageset/snow.png differ diff --git a/week4_min0/week4_min0/Assets.xcassets/snowy.imageset/Contents.json b/week4_min0/week4_min0/Assets.xcassets/snowy.imageset/Contents.json new file mode 100644 index 0000000..904af3a --- /dev/null +++ b/week4_min0/week4_min0/Assets.xcassets/snowy.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "snowy.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/week4_min0/week4_min0/Assets.xcassets/snowy.imageset/snowy.png b/week4_min0/week4_min0/Assets.xcassets/snowy.imageset/snowy.png new file mode 100644 index 0000000..f68e315 Binary files /dev/null and b/week4_min0/week4_min0/Assets.xcassets/snowy.imageset/snowy.png differ diff --git a/week4_min0/week4_min0/Assets.xcassets/storm.imageset/Contents.json b/week4_min0/week4_min0/Assets.xcassets/storm.imageset/Contents.json new file mode 100644 index 0000000..9fdbb83 --- /dev/null +++ b/week4_min0/week4_min0/Assets.xcassets/storm.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "thunder.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/week4_min0/week4_min0/Assets.xcassets/storm.imageset/thunder.png b/week4_min0/week4_min0/Assets.xcassets/storm.imageset/thunder.png new file mode 100644 index 0000000..8f32e97 Binary files /dev/null and b/week4_min0/week4_min0/Assets.xcassets/storm.imageset/thunder.png differ diff --git a/week4_min0/week4_min0/Assets.xcassets/sun.imageset/Contents.json b/week4_min0/week4_min0/Assets.xcassets/sun.imageset/Contents.json new file mode 100644 index 0000000..97a98e4 --- /dev/null +++ b/week4_min0/week4_min0/Assets.xcassets/sun.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "sun.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/week4_min0/week4_min0/Assets.xcassets/sun.imageset/sun.png b/week4_min0/week4_min0/Assets.xcassets/sun.imageset/sun.png new file mode 100644 index 0000000..e5ef357 Binary files /dev/null and b/week4_min0/week4_min0/Assets.xcassets/sun.imageset/sun.png differ diff --git a/week4_min0/week4_min0/Assets.xcassets/sun_cloud.imageset/Contents.json b/week4_min0/week4_min0/Assets.xcassets/sun_cloud.imageset/Contents.json new file mode 100644 index 0000000..f70a01b --- /dev/null +++ b/week4_min0/week4_min0/Assets.xcassets/sun_cloud.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "sun_cloud.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/week4_min0/week4_min0/Assets.xcassets/sun_cloud.imageset/sun_cloud.png b/week4_min0/week4_min0/Assets.xcassets/sun_cloud.imageset/sun_cloud.png new file mode 100644 index 0000000..140b2de Binary files /dev/null and b/week4_min0/week4_min0/Assets.xcassets/sun_cloud.imageset/sun_cloud.png differ diff --git a/week4_min0/week4_min0/Assets.xcassets/thunder.imageset/Contents.json b/week4_min0/week4_min0/Assets.xcassets/thunder.imageset/Contents.json new file mode 100644 index 0000000..897eaff --- /dev/null +++ b/week4_min0/week4_min0/Assets.xcassets/thunder.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "storm.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/week4_min0/week4_min0/Assets.xcassets/thunder.imageset/storm.png b/week4_min0/week4_min0/Assets.xcassets/thunder.imageset/storm.png new file mode 100644 index 0000000..8440b7a Binary files /dev/null and b/week4_min0/week4_min0/Assets.xcassets/thunder.imageset/storm.png differ diff --git a/week4_min0/week4_min0/Assets.xcassets/tooraniny.imageset/Contents.json b/week4_min0/week4_min0/Assets.xcassets/tooraniny.imageset/Contents.json new file mode 100644 index 0000000..d4e031e --- /dev/null +++ b/week4_min0/week4_min0/Assets.xcassets/tooraniny.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "rainy.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/week4_min0/week4_min0/Assets.xcassets/tooraniny.imageset/rainy.png b/week4_min0/week4_min0/Assets.xcassets/tooraniny.imageset/rainy.png new file mode 100644 index 0000000..908e702 Binary files /dev/null and b/week4_min0/week4_min0/Assets.xcassets/tooraniny.imageset/rainy.png differ diff --git a/week4_min0/week4_min0/Assets.xcassets/wind_percent.imageset/Contents.json b/week4_min0/week4_min0/Assets.xcassets/wind_percent.imageset/Contents.json new file mode 100644 index 0000000..7a03ea3 --- /dev/null +++ b/week4_min0/week4_min0/Assets.xcassets/wind_percent.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "wind_percent.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/week4_min0/week4_min0/Assets.xcassets/wind_percent.imageset/wind_percent.png b/week4_min0/week4_min0/Assets.xcassets/wind_percent.imageset/wind_percent.png new file mode 100644 index 0000000..fb008bd Binary files /dev/null and b/week4_min0/week4_min0/Assets.xcassets/wind_percent.imageset/wind_percent.png differ diff --git a/week4_min0/week4_min0/Base.lproj/LaunchScreen.storyboard b/week4_min0/week4_min0/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..865e932 --- /dev/null +++ b/week4_min0/week4_min0/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/week4_min0/week4_min0/Cells/TommorowCell.swift b/week4_min0/week4_min0/Cells/TommorowCell.swift new file mode 100644 index 0000000..b81fa66 --- /dev/null +++ b/week4_min0/week4_min0/Cells/TommorowCell.swift @@ -0,0 +1,357 @@ +// +// TommorowCell.swift +// week4_min0 +// +// Created by 이민영 on 5/14/24. +// + +import UIKit + +class TommorowCell: UICollectionViewCell { + static let identifier = "nextStateCell" + + var nextStateItem: Tommorow! { + didSet { + bindCell(with: nextStateItem) + } + } + + private lazy var emptyLabel: UILabel = { + let label = UILabel() + label.font = .boldSystemFont(ofSize: 25) + label.numberOfLines = 0 + label.translatesAutoresizingMaskIntoConstraints = false + label.textAlignment = .center + label.textColor = .white + return label + }() + + private lazy var backButton: UIButton = { + let button = UIButton() + button.setImage(UIImage(systemName: "chevron.left"), for: .normal) + button.tintColor = .white + button.translatesAutoresizingMaskIntoConstraints = false + button.contentHorizontalAlignment = .leading + return button + }() + + private lazy var headerTitle: UILabel = { + let label = UILabel() + label.font = .boldSystemFont(ofSize: 25) + label.numberOfLines = 0 + label.translatesAutoresizingMaskIntoConstraints = false + label.textAlignment = .center + label.textColor = .white + return label + }() + + private lazy var rightButton: UIButton = { + let button = UIButton() + button.setImage(UIImage(systemName: "ellipsis"), for: .normal) + button.tintColor = .white + button.translatesAutoresizingMaskIntoConstraints = false + button.contentHorizontalAlignment = .right + return button + }() + + private lazy var headerStack: UIStackView = { + let stackView = UIStackView(arrangedSubviews: [backButton, headerTitle, rightButton]) + stackView.axis = .horizontal // vertical -> vstack + stackView.alignment = .center + stackView.distribution = .fillEqually + stackView.spacing = 50 + stackView.translatesAutoresizingMaskIntoConstraints = false + return stackView + }() + + private lazy var title: UILabel = { + let label = UILabel() + label.font = .boldSystemFont(ofSize: 20) + label.numberOfLines = 0 + label.translatesAutoresizingMaskIntoConstraints = false + label.textAlignment = .center + label.textColor = .white + return label + }() + + private lazy var weatherImageView: UIImageView = { + let imageView = UIImageView() + imageView.widthAnchor.constraint(equalToConstant: 150).isActive = true + imageView.heightAnchor.constraint(equalToConstant: 120).isActive = true + imageView.contentMode = .scaleAspectFit + imageView.clipsToBounds = true + imageView.translatesAutoresizingMaskIntoConstraints = false + return imageView + }() + + private lazy var highTempLabel: UILabel = { + let label = UILabel() + label.font = .systemFont(ofSize: 70, weight: .bold) + label.numberOfLines = 0 + label.translatesAutoresizingMaskIntoConstraints = false + label.textAlignment = .right + label.textColor = .white + return label + }() + + private lazy var lowTempLabel: UILabel = { + let label = UILabel() + label.font = .systemFont(ofSize: 40, weight: .bold) + label.numberOfLines = 0 + label.translatesAutoresizingMaskIntoConstraints = false + label.textAlignment = .center + label.textColor = .white + label.layer.opacity = 0.5 + return label + }() + + private lazy var weather: UILabel = { + let label = UILabel() + label.font = .boldSystemFont(ofSize: 17) + label.numberOfLines = 0 + label.translatesAutoresizingMaskIntoConstraints = false + label.textAlignment = .center + label.textColor = .white + label.layer.opacity = 0.5 + return label + }() + + // 날짜, 온도 + private lazy var vStack1: UIStackView = { + let stackView = UIStackView() + stackView.axis = .vertical + stackView.alignment = .leading + stackView.spacing = 3 + stackView.translatesAutoresizingMaskIntoConstraints = false + return stackView + }() + + private lazy var windImage: UIImageView = { + let imageView = UIImageView() + imageView.widthAnchor.constraint(equalToConstant: 20).isActive = true + imageView.heightAnchor.constraint(equalToConstant: 20).isActive = true + imageView.contentMode = .scaleAspectFit + imageView.clipsToBounds = true + imageView.translatesAutoresizingMaskIntoConstraints = false + return imageView + }() + + private lazy var humidImage: UIImageView = { + let imageView = UIImageView() + imageView.widthAnchor.constraint(equalToConstant: 20).isActive = true + imageView.heightAnchor.constraint(equalToConstant: 20).isActive = true + imageView.contentMode = .scaleAspectFit + imageView.clipsToBounds = true + imageView.translatesAutoresizingMaskIntoConstraints = false + return imageView + }() + + private lazy var rainImage: UIImageView = { + let imageView = UIImageView() + imageView.widthAnchor.constraint(equalToConstant: 20).isActive = true + imageView.heightAnchor.constraint(equalToConstant: 20).isActive = true + imageView.contentMode = .scaleAspectFit + imageView.clipsToBounds = true + imageView.translatesAutoresizingMaskIntoConstraints = false + return imageView + }() + + private lazy var windLabel: UILabel = { + let label = UILabel() + label.font = .systemFont(ofSize: 14) + label.numberOfLines = 0 + label.translatesAutoresizingMaskIntoConstraints = false + label.textAlignment = .center + label.textColor = .white + return label + }() + + private lazy var humidLabel: UILabel = { + let label = UILabel() + label.font = .systemFont(ofSize: 14) + label.numberOfLines = 0 + label.translatesAutoresizingMaskIntoConstraints = false + label.textAlignment = .center + label.textColor = .white + + return label + }() + + private lazy var rainLabel: UILabel = { + let label = UILabel() + label.font = .systemFont(ofSize: 14) + label.numberOfLines = 0 + label.translatesAutoresizingMaskIntoConstraints = false + label.textAlignment = .center + label.textColor = .white + + return label + }() + + private lazy var windTitle: UILabel = { + let label = UILabel() + label.font = .systemFont(ofSize: 12) + label.numberOfLines = 0 + label.translatesAutoresizingMaskIntoConstraints = false + label.textAlignment = .center + label.textColor = .white + label.layer.opacity = 0.5 + return label + }() + + private lazy var humidTitle: UILabel = { + let label = UILabel() + label.font = .systemFont(ofSize: 12) + label.numberOfLines = 0 + label.translatesAutoresizingMaskIntoConstraints = false + label.textAlignment = .center + label.textColor = .white + label.layer.opacity = 0.5 + return label + }() + + private lazy var rainTitle: UILabel = { + let label = UILabel() + label.font = .systemFont(ofSize: 12) + label.numberOfLines = 0 + label.translatesAutoresizingMaskIntoConstraints = false + label.textAlignment = .center + label.textColor = .white + label.layer.opacity = 0.5 + return label + }() + + private lazy var hStack1: UIStackView = { + let stackView = UIStackView(arrangedSubviews: [highTempLabel, lowTempLabel]) + stackView.axis = .horizontal // vertical -> vstack + stackView.alignment = .center + stackView.distribution = .fill + stackView.spacing = 0 + stackView.alignment = .lastBaseline + stackView.translatesAutoresizingMaskIntoConstraints = false + return stackView + }() + + private lazy var hStack2: UIStackView = { + let stackView = UIStackView() + stackView.axis = .horizontal + stackView.alignment = .lastBaseline + stackView.distribution = .fill + stackView.spacing = 30 + stackView.translatesAutoresizingMaskIntoConstraints = false + return stackView + }() + + private lazy var hStack3: UIStackView = { + let stackView = UIStackView() + stackView.axis = .horizontal + stackView.alignment = .center + stackView.distribution = .fill + stackView.spacing = 40 + stackView.translatesAutoresizingMaskIntoConstraints = false + return stackView + }() + + private lazy var vStack: UIStackView = { + let stackView = UIStackView() + stackView.axis = .vertical + stackView.alignment = .center + stackView.spacing = 30 + stackView.translatesAutoresizingMaskIntoConstraints = false + return stackView + }() + + + private lazy var vStackLeft: UIStackView = { + let stackView = UIStackView(arrangedSubviews: [windImage, windLabel, windTitle]) + stackView.axis = .vertical + stackView.alignment = .center + stackView.spacing = 0 + stackView.translatesAutoresizingMaskIntoConstraints = false + return stackView + }() + + private lazy var vStackCenter: UIStackView = { + let stackView = UIStackView(arrangedSubviews: [humidImage, humidLabel, humidTitle]) + stackView.axis = .vertical + stackView.alignment = .center + stackView.spacing = 0 + stackView.translatesAutoresizingMaskIntoConstraints = false + return stackView + }() + private lazy var vStackRight: UIStackView = { + let stackView = UIStackView(arrangedSubviews: [rainImage, rainLabel, rainTitle]) + stackView.axis = .vertical + stackView.alignment = .center + stackView.spacing = 0 + stackView.translatesAutoresizingMaskIntoConstraints = false + return stackView + }() + + private lazy var containerView: UIView = { + let view = UIView() + view.translatesAutoresizingMaskIntoConstraints = false + return view + }() + + override init(frame: CGRect) { + super.init(frame: frame) + self.contentView.backgroundColor = UIColor(red: 22/255, green: 179/255, blue: 248/255, alpha: 1.0) + self.contentView.layer.cornerRadius = 30.0 + self.contentView.layer.shadowColor = UIColor(red: 22/255, green: 179/255, blue: 248/255, alpha: 1.0).cgColor + self.contentView.layer.shadowOpacity = 1 + self.contentView.layer.shadowRadius = 10 + self.contentView.layer.shadowOffset = CGSize(width: 0, height: 10) + configureCell() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + private func configureCell() { + contentView.addSubview(containerView) + containerView.addSubview(vStack) + NSLayoutConstraint.activate([ + vStack.centerXAnchor.constraint(equalTo: contentView.centerXAnchor), + vStack.centerYAnchor.constraint(equalTo: contentView.centerYAnchor), + ]) + + // Tommorow & 20/17 + [title, hStack1, weather].forEach { + vStack1.addArrangedSubview($0) + } + + [weatherImageView, vStack1].forEach { + hStack2.addArrangedSubview($0) + } + // wind, humid, rain + [vStackLeft, vStackCenter, vStackRight].forEach { + hStack3.addArrangedSubview($0) + } + + [emptyLabel, headerStack, hStack2, hStack3].forEach { + vStack.addArrangedSubview($0) + } + + } + + private func bindCell(with item: Tommorow ) { + headerTitle.text = "7 days" + title.text = "Tommorow" + weather.text = item.weather + weatherImageView.image = item.weatherImg + highTempLabel.text = item.highTemp + lowTempLabel.text = item.lowTemp + windLabel.text = item.wind + humidLabel.text = item.humidity + rainLabel.text = item.chanceOfRain + windImage.image = item.windImg + humidImage.image = item.humidImg + rainImage.image = item.chanceRainImg + windTitle.text = "Wind" + humidTitle.text = "Humidity" + rainTitle.text = "Chance of rain" + + } +} diff --git a/week4_min0/week4_min0/Cells/WeekCell.swift b/week4_min0/week4_min0/Cells/WeekCell.swift new file mode 100644 index 0000000..8e47a22 --- /dev/null +++ b/week4_min0/week4_min0/Cells/WeekCell.swift @@ -0,0 +1,163 @@ +// +// WeekCell.swift +// week4_min0 +// +// Created by 이민영 on 5/14/24. +// + +import UIKit + +class WeekCell: UICollectionViewCell { + static let identifier = "dayInfoCell" + + var dayInfoCellItem: Day! { + didSet { + bindCell(with: dayInfoCellItem) + } + } + + private lazy var dayLabel: UILabel = { + let label = UILabel() + label.font = .boldSystemFont(ofSize: 17) + label.numberOfLines = 0 + label.translatesAutoresizingMaskIntoConstraints = false + label.textAlignment = .center + label.textColor = .systemGray2 + return label + }() + + private lazy var weatherImageView: UIImageView = { + let imageView = UIImageView() + imageView.widthAnchor.constraint(equalToConstant: 35).isActive = true + imageView.heightAnchor.constraint(equalToConstant: 35).isActive = true + imageView.contentMode = .scaleAspectFit + imageView.clipsToBounds = true + imageView.translatesAutoresizingMaskIntoConstraints = false + return imageView + }() + + private lazy var weather: UILabel = { + let label = UILabel() + label.font = .boldSystemFont(ofSize: 17) + label.numberOfLines = 0 + label.translatesAutoresizingMaskIntoConstraints = false + label.textAlignment = .left + label.textColor = .systemGray2 + return label + }() + + private lazy var highTempLabel: UILabel = { + let label = UILabel() + label.font = .boldSystemFont(ofSize: 17) + label.numberOfLines = 0 + label.translatesAutoresizingMaskIntoConstraints = false + label.textAlignment = .right + label.textColor = .white + return label + }() + + private lazy var lowTempLabel: UILabel = { + let label = UILabel() + label.font = .boldSystemFont(ofSize: 17) + label.numberOfLines = 0 + label.translatesAutoresizingMaskIntoConstraints = false + label.textColor = .systemGray2 + return label + }() + + private lazy var hStack: UIStackView = { + let stackView = UIStackView() + stackView.axis = .horizontal // vertical -> vstack + stackView.alignment = .center + stackView.distribution = .fill + // 한 줄의 아이템 간의 간격 + stackView.spacing = 10 + stackView.translatesAutoresizingMaskIntoConstraints = false + return stackView + }() + + private lazy var subStack1: UIStackView = { + let stackView = UIStackView() + stackView.axis = .horizontal + stackView.alignment = .center + // 한 줄의 아이템 간의 간격 + stackView.spacing = 4 + stackView.translatesAutoresizingMaskIntoConstraints = false + return stackView + }() + + private lazy var subStack2: UIStackView = { + let stackView = UIStackView() + stackView.axis = .horizontal + stackView.alignment = .center + stackView.distribution = .fill + stackView.spacing = 0 + stackView.translatesAutoresizingMaskIntoConstraints = false + return stackView + }() + + private lazy var containerView: UIView = { + let view = UIView() + view.translatesAutoresizingMaskIntoConstraints = false + return view + }() + + override init(frame: CGRect) { + super.init(frame: frame) + configureCell() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + private func configureCell() { + contentView.addSubview(containerView) + containerView.addSubview(hStack) + + NSLayoutConstraint.activate([ + hStack.centerXAnchor.constraint(equalTo: contentView.centerXAnchor), + hStack.centerYAnchor.constraint(equalTo: contentView.centerYAnchor), + hStack.leadingAnchor.constraint(equalTo: contentView.leadingAnchor, constant: 16), + hStack.trailingAnchor.constraint(equalTo: contentView.trailingAnchor, constant: -16) + ]) + + [weatherImageView, weather].forEach { + subStack1.addArrangedSubview($0) + } + [highTempLabel, lowTempLabel].forEach { + subStack2.addArrangedSubview($0) + } + [dayLabel, subStack1, subStack2].forEach { hStack.addArrangedSubview($0) } + } + + private func bindCell(with item: Day) { + dayLabel.text = item.day + weatherImageView.image = item.weatherImg + weather.text = item.weather + highTempLabel.text = item.highTemp + lowTempLabel.text = item.lowTemp + } +} + + +#if DEBUG +import SwiftUI +struct FeaturedAppsCollectionView: UIViewRepresentable { + typealias UIViewType = UIView + func makeUIView(context: Context) -> UIView { + let cell = WeekCell() + cell.dayInfoCellItem = weekInfo.first! + return cell + } + func updateUIView(_ uiView: UIView, context: Context) {} +} + +struct FeaturedAppsCollectionView_Previews: PreviewProvider { + static var previews: some View { + FeaturedAppsCollectionView() + .edgesIgnoringSafeArea(.all) + .previewLayout(.fixed(width: 300, height: 200)) + } +} +#endif diff --git a/week4_min0/week4_min0/CompositionalLayoutSection.swift b/week4_min0/week4_min0/CompositionalLayoutSection.swift new file mode 100644 index 0000000..cc5c17b --- /dev/null +++ b/week4_min0/week4_min0/CompositionalLayoutSection.swift @@ -0,0 +1,44 @@ +// +// CompositionalLayoutSection.swift +// week4_min0 +// +// Created by 이민영 on 5/14/24. +// + +import Foundation +import UIKit + +class CompositionalLayoutSection { + static func tommorowSection() -> NSCollectionLayoutSection? { + // one item size + let itemSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0), heightDimension: .fractionalHeight(1.0)) + let item = NSCollectionLayoutItem(layoutSize: itemSize) + + // item을 포함하는 group + let groupSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0), heightDimension: .fractionalHeight(0.4)) + let group = NSCollectionLayoutGroup.vertical(layoutSize: groupSize, subitems: [item]) + + let section = NSCollectionLayoutSection(group: group) + + return section + + } + + static func weekSection() -> NSCollectionLayoutSection? { + // item, layout에 사이즈 설정해야 나옴 + // one item size + let itemSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0), heightDimension: .fractionalHeight(1/7)) + let item = NSCollectionLayoutItem(layoutSize: itemSize) + + // item을 포함하는 group + let groupSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0), heightDimension: .fractionalHeight(0.6)) + // group -> vertical 로 item vStack 처럼 쌓기 + let group = NSCollectionLayoutGroup.vertical(layoutSize: groupSize, subitems: [item]) + group.interItemSpacing = NSCollectionLayoutSpacing.fixed(-10) + + let section = NSCollectionLayoutSection(group: group) + + return section + } + +} diff --git a/week4_min0/week4_min0/Info.plist b/week4_min0/week4_min0/Info.plist new file mode 100644 index 0000000..0eb786d --- /dev/null +++ b/week4_min0/week4_min0/Info.plist @@ -0,0 +1,23 @@ + + + + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + + + + + + diff --git a/week4_min0/week4_min0/Models/Day.swift b/week4_min0/week4_min0/Models/Day.swift new file mode 100644 index 0000000..24f4e58 --- /dev/null +++ b/week4_min0/week4_min0/Models/Day.swift @@ -0,0 +1,66 @@ +// +// Day.swift +// week4_min0 +// +// Created by 이민영 on 5/14/24. +// + +import UIKit + +struct Day { + let id: UUID = UUID() + let day, weather, highTemp, lowTemp: String + let weatherImg: UIImage +} + +let weekInfo: [Day] = [ + Day( + day: "Mon", + weather: "Rainy", + highTemp: "+20°", + lowTemp: "+14°", + weatherImg: UIImage(named: "rainy")! + ), + Day( + day: "The", + weather: "Rainy", + highTemp: "+22°", + lowTemp: "+16°", + weatherImg: UIImage(named: "rainy.png")! + ), + Day( + day: "Wed", + weather: "Storm", + highTemp: "+19°", + lowTemp: "+14°", + weatherImg: UIImage(named: "storm.png")! + ), + Day( + day: "Thu", + weather: "Sun", + highTemp: "+18°", + lowTemp: "+12°", + weatherImg: UIImage(named: "sun.png")! + ), + Day( + day: "Fri", + weather: "Thunder", + highTemp: "+23°", + lowTemp: "+19°", + weatherImg: UIImage(named: "thunder.png")! + ), + Day( + day: "Sat", + weather: "Rainy", + highTemp: "+25°", + lowTemp: "+17°", + weatherImg: UIImage(named: "rainy.png")! + ), + Day( + day: "Sun", + weather: "Storm", + highTemp: "+21°", + lowTemp: "+18°", + weatherImg: UIImage(named: "storm.png")! + ), +] diff --git a/week4_min0/week4_min0/Models/Tommorow.swift b/week4_min0/week4_min0/Models/Tommorow.swift new file mode 100644 index 0000000..c8a1290 --- /dev/null +++ b/week4_min0/week4_min0/Models/Tommorow.swift @@ -0,0 +1,30 @@ +// +// Tommorow.swift +// week4_min0 +// +// Created by 이민영 on 5/14/24. +// + +import Foundation +import UIKit + +struct Tommorow { + let id = UUID() + let weatherImg: UIImage + let highTemp, lowTemp, weather, wind, humidity, chanceOfRain: String + let windImg, humidImg, chanceRainImg: UIImage +} + +let tommorowItem: [Tommorow] = [ + Tommorow( + weatherImg: UIImage(named: "rainy")!, + highTemp: "20", + lowTemp: "/17°", + weather: "Rainy-Cloudy", + wind: "9 km/h", + humidity: "31%", + chanceOfRain: "93%", + windImg: UIImage(named: "wind_percent")!, + humidImg: UIImage(named: "humid_percent")!, + chanceRainImg: UIImage(named: "rain_percent")! +)] diff --git a/week4_min0/week4_min0/SceneDelegate.swift b/week4_min0/week4_min0/SceneDelegate.swift new file mode 100644 index 0000000..fcc43d9 --- /dev/null +++ b/week4_min0/week4_min0/SceneDelegate.swift @@ -0,0 +1,56 @@ +// +// SceneDelegate.swift +// week4_min0 +// +// Created by 이민영 on 5/12/24. +// + +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 windowScene = (scene as? UIWindowScene) else { return } + let navigationController = UINavigationController(rootViewController: ViewController()) + window = UIWindow(windowScene: windowScene) + window?.rootViewController = navigationController // 네비게이션 컨트롤러를 윈도우의 루트 뷰 컨트롤러로 설정 + 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/week4_min0/week4_min0/ViewController.swift b/week4_min0/week4_min0/ViewController.swift new file mode 100644 index 0000000..2be03c6 --- /dev/null +++ b/week4_min0/week4_min0/ViewController.swift @@ -0,0 +1,88 @@ +// +// ViewController.swift +// week4_min0 +// +// Created by 이민영 on 5/12/24. +// + +import UIKit + +class ViewController: UIViewController { + + private lazy var collectionView: UICollectionView = { + + let layout = UICollectionViewCompositionalLayout { (sectionIndex, rect) -> NSCollectionLayoutSection? in + + switch sectionIndex { + case 0: return CompositionalLayoutSection.tommorowSection() + case 1: return CompositionalLayoutSection.weekSection() + default: return nil + } + + } + + let collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout) + collectionView.translatesAutoresizingMaskIntoConstraints = false + collectionView.backgroundColor = .black + + return collectionView + }() + + // CollectionView의 constraint 설정 + override func viewDidLoad() { + super.viewDidLoad() + view.backgroundColor = .black + setupCollectionView() + + } + + func setupCollectionView() { + view.addSubview(collectionView) + + NSLayoutConstraint.activate([ + collectionView.topAnchor.constraint(equalTo: view.topAnchor), + collectionView.bottomAnchor.constraint(equalTo: view.bottomAnchor), + collectionView.leadingAnchor.constraint(equalTo: view.leadingAnchor), + collectionView.trailingAnchor.constraint(equalTo: view.trailingAnchor) + ]) + + collectionView.dataSource = self + collectionView.contentInsetAdjustmentBehavior = .never // ignore to safe area + + collectionView.register(TommorowCell.self, forCellWithReuseIdentifier: TommorowCell.identifier) + collectionView.register(WeekCell.self, forCellWithReuseIdentifier: WeekCell.identifier) + } + +} + + +extension ViewController: UICollectionViewDataSource { + + func numberOfSections(in collectionView: UICollectionView) -> Int { + 2 + } + + func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + + if section == 0{ + return tommorowItem.count + } else { + return weekInfo.count + } + } + + // 셀 등록 + func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + if indexPath.section == 0 { + let cell = collectionView.dequeueReusableCell(withReuseIdentifier: TommorowCell.identifier, for: indexPath) as! TommorowCell + cell.nextStateItem = tommorowItem[indexPath.row] + return cell + } else { + let cell = collectionView.dequeueReusableCell(withReuseIdentifier: WeekCell.identifier, for: indexPath) as! WeekCell + cell.dayInfoCellItem = weekInfo[indexPath.row] + return cell + } + + } + +}