diff --git a/SecondWorkbook/CustomCollectionViewCell.swift b/SecondWorkbook/CustomCollectionViewCell.swift new file mode 100644 index 0000000..62cbd8a --- /dev/null +++ b/SecondWorkbook/CustomCollectionViewCell.swift @@ -0,0 +1,46 @@ +// +// CustomSelectionViewCell.swift +// SecondWorkbook +// +// Created by 김수민 on 2023/10/02. +// + +import UIKit + +class CustomCollectionViewCell: UITableViewCell, UICollectionViewDataSource { + + let cellIdentifier: String = "pink" + + func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + return 100 + } + + func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + let cell: UICollectionViewCell = collectionView.dequeueReusableCell(withReuseIdentifier: self.cellIdentifier, for: indexPath) + return cell + } + + + @IBOutlet var customCollectionViewCell: UICollectionView! + @IBOutlet var label: UILabel! + + + + override func awakeFromNib() { + super.awakeFromNib() + // Initialization code + self.customCollectionViewCell.dataSource = self + label.font = UIFont.boldSystemFont(ofSize: 16) + + } + + override func setSelected(_ selected: Bool, animated: Bool) { + super.setSelected(selected, animated: animated) + + // Configure the view for the selected state + } + + + +} + diff --git a/SecondWorkbook/SecondWorkbook.xcodeproj/project.pbxproj b/SecondWorkbook/SecondWorkbook.xcodeproj/project.pbxproj new file mode 100644 index 0000000..3e98985 --- /dev/null +++ b/SecondWorkbook/SecondWorkbook.xcodeproj/project.pbxproj @@ -0,0 +1,369 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 56; + objects = { + +/* Begin PBXBuildFile section */ + 80EFC1182AC7FC970006DA72 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80EFC1172AC7FC970006DA72 /* AppDelegate.swift */; }; + 80EFC11A2AC7FC970006DA72 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80EFC1192AC7FC970006DA72 /* SceneDelegate.swift */; }; + 80EFC11C2AC7FC970006DA72 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80EFC11B2AC7FC970006DA72 /* ViewController.swift */; }; + 80EFC11F2AC7FC970006DA72 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 80EFC11D2AC7FC970006DA72 /* Main.storyboard */; }; + 80EFC1212AC7FC970006DA72 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 80EFC1202AC7FC970006DA72 /* Assets.xcassets */; }; + 80EFC1242AC7FC970006DA72 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 80EFC1222AC7FC970006DA72 /* LaunchScreen.storyboard */; }; + 80EFC12C2AC80CB10006DA72 /* CustomCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80EFC12B2AC80CB10006DA72 /* CustomCell.swift */; }; + 80EFC1C52AD17E6F0006DA72 /* CustomCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80EFC1C42AD17E6F0006DA72 /* CustomCollectionViewCell.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 80EFC1142AC7FC970006DA72 /* SecondWorkbook.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SecondWorkbook.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 80EFC1172AC7FC970006DA72 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 80EFC1192AC7FC970006DA72 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + 80EFC11B2AC7FC970006DA72 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 80EFC11E2AC7FC970006DA72 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 80EFC1202AC7FC970006DA72 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 80EFC1232AC7FC970006DA72 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 80EFC1252AC7FC970006DA72 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 80EFC12B2AC80CB10006DA72 /* CustomCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomCell.swift; sourceTree = ""; }; + 80EFC1C42AD17E6F0006DA72 /* CustomCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomCollectionViewCell.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 80EFC1112AC7FC970006DA72 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 80EFC10B2AC7FC970006DA72 = { + isa = PBXGroup; + children = ( + 80EFC1C42AD17E6F0006DA72 /* CustomCollectionViewCell.swift */, + 80EFC1162AC7FC970006DA72 /* SecondWorkbook */, + 80EFC1152AC7FC970006DA72 /* Products */, + ); + sourceTree = ""; + }; + 80EFC1152AC7FC970006DA72 /* Products */ = { + isa = PBXGroup; + children = ( + 80EFC1142AC7FC970006DA72 /* SecondWorkbook.app */, + ); + name = Products; + sourceTree = ""; + }; + 80EFC1162AC7FC970006DA72 /* SecondWorkbook */ = { + isa = PBXGroup; + children = ( + 80EFC1172AC7FC970006DA72 /* AppDelegate.swift */, + 80EFC1192AC7FC970006DA72 /* SceneDelegate.swift */, + 80EFC11B2AC7FC970006DA72 /* ViewController.swift */, + 80EFC12B2AC80CB10006DA72 /* CustomCell.swift */, + 80EFC11D2AC7FC970006DA72 /* Main.storyboard */, + 80EFC1202AC7FC970006DA72 /* Assets.xcassets */, + 80EFC1222AC7FC970006DA72 /* LaunchScreen.storyboard */, + 80EFC1252AC7FC970006DA72 /* Info.plist */, + ); + path = SecondWorkbook; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 80EFC1132AC7FC970006DA72 /* SecondWorkbook */ = { + isa = PBXNativeTarget; + buildConfigurationList = 80EFC1282AC7FC970006DA72 /* Build configuration list for PBXNativeTarget "SecondWorkbook" */; + buildPhases = ( + 80EFC1102AC7FC970006DA72 /* Sources */, + 80EFC1112AC7FC970006DA72 /* Frameworks */, + 80EFC1122AC7FC970006DA72 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = SecondWorkbook; + productName = SecondWorkbook; + productReference = 80EFC1142AC7FC970006DA72 /* SecondWorkbook.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 80EFC10C2AC7FC970006DA72 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1420; + LastUpgradeCheck = 1420; + TargetAttributes = { + 80EFC1132AC7FC970006DA72 = { + CreatedOnToolsVersion = 14.2; + }; + }; + }; + buildConfigurationList = 80EFC10F2AC7FC970006DA72 /* Build configuration list for PBXProject "SecondWorkbook" */; + compatibilityVersion = "Xcode 14.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 80EFC10B2AC7FC970006DA72; + productRefGroup = 80EFC1152AC7FC970006DA72 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 80EFC1132AC7FC970006DA72 /* SecondWorkbook */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 80EFC1122AC7FC970006DA72 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 80EFC1242AC7FC970006DA72 /* LaunchScreen.storyboard in Resources */, + 80EFC1212AC7FC970006DA72 /* Assets.xcassets in Resources */, + 80EFC11F2AC7FC970006DA72 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 80EFC1102AC7FC970006DA72 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 80EFC11C2AC7FC970006DA72 /* ViewController.swift in Sources */, + 80EFC1C52AD17E6F0006DA72 /* CustomCollectionViewCell.swift in Sources */, + 80EFC1182AC7FC970006DA72 /* AppDelegate.swift in Sources */, + 80EFC12C2AC80CB10006DA72 /* CustomCell.swift in Sources */, + 80EFC11A2AC7FC970006DA72 /* SceneDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 80EFC11D2AC7FC970006DA72 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 80EFC11E2AC7FC970006DA72 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 80EFC1222AC7FC970006DA72 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 80EFC1232AC7FC970006DA72 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 80EFC1262AC7FC970006DA72 /* 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; + }; + 80EFC1272AC7FC970006DA72 /* 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; + }; + 80EFC1292AC7FC970006DA72 /* 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 = SecondWorkbook/Info.plist; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UIMainStoryboardFile = Main; + 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.SecondWorkbook; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 80EFC12A2AC7FC970006DA72 /* 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 = SecondWorkbook/Info.plist; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UIMainStoryboardFile = Main; + 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.SecondWorkbook; + 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 */ + 80EFC10F2AC7FC970006DA72 /* Build configuration list for PBXProject "SecondWorkbook" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 80EFC1262AC7FC970006DA72 /* Debug */, + 80EFC1272AC7FC970006DA72 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 80EFC1282AC7FC970006DA72 /* Build configuration list for PBXNativeTarget "SecondWorkbook" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 80EFC1292AC7FC970006DA72 /* Debug */, + 80EFC12A2AC7FC970006DA72 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 80EFC10C2AC7FC970006DA72 /* Project object */; +} diff --git a/SecondWorkbook/SecondWorkbook.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/SecondWorkbook/SecondWorkbook.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/SecondWorkbook/SecondWorkbook.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/SecondWorkbook/SecondWorkbook.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/SecondWorkbook/SecondWorkbook.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/SecondWorkbook/SecondWorkbook.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/SecondWorkbook/SecondWorkbook/AppDelegate.swift b/SecondWorkbook/SecondWorkbook/AppDelegate.swift new file mode 100644 index 0000000..613efcc --- /dev/null +++ b/SecondWorkbook/SecondWorkbook/AppDelegate.swift @@ -0,0 +1,36 @@ +// +// AppDelegate.swift +// SecondWorkbook +// +// Created by 김수민 on 2023/09/30. +// + +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/SecondWorkbook/SecondWorkbook/Assets.xcassets/AccentColor.colorset/Contents.json b/SecondWorkbook/SecondWorkbook/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/SecondWorkbook/SecondWorkbook/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/SecondWorkbook/SecondWorkbook/Assets.xcassets/AppIcon.appiconset/Contents.json b/SecondWorkbook/SecondWorkbook/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..13613e3 --- /dev/null +++ b/SecondWorkbook/SecondWorkbook/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/SecondWorkbook/SecondWorkbook/Assets.xcassets/Contents.json b/SecondWorkbook/SecondWorkbook/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/SecondWorkbook/SecondWorkbook/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/SecondWorkbook/SecondWorkbook/Assets.xcassets/cellImage.imageset/Contents.json b/SecondWorkbook/SecondWorkbook/Assets.xcassets/cellImage.imageset/Contents.json new file mode 100644 index 0000000..6ef6f2f --- /dev/null +++ b/SecondWorkbook/SecondWorkbook/Assets.xcassets/cellImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "스크린샷 2023-09-30 오후 4.37.03.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "스크린샷 2023-09-30 오후 4.37.03 1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "스크린샷 2023-09-30 오후 4.37.03 2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git "a/SecondWorkbook/SecondWorkbook/Assets.xcassets/cellImage.imageset/\354\212\244\355\201\254\353\246\260\354\203\267 2023-09-30 \354\230\244\355\233\204 4.37.03 1.png" "b/SecondWorkbook/SecondWorkbook/Assets.xcassets/cellImage.imageset/\354\212\244\355\201\254\353\246\260\354\203\267 2023-09-30 \354\230\244\355\233\204 4.37.03 1.png" new file mode 100644 index 0000000..4c3fa57 Binary files /dev/null and "b/SecondWorkbook/SecondWorkbook/Assets.xcassets/cellImage.imageset/\354\212\244\355\201\254\353\246\260\354\203\267 2023-09-30 \354\230\244\355\233\204 4.37.03 1.png" differ diff --git "a/SecondWorkbook/SecondWorkbook/Assets.xcassets/cellImage.imageset/\354\212\244\355\201\254\353\246\260\354\203\267 2023-09-30 \354\230\244\355\233\204 4.37.03 2.png" "b/SecondWorkbook/SecondWorkbook/Assets.xcassets/cellImage.imageset/\354\212\244\355\201\254\353\246\260\354\203\267 2023-09-30 \354\230\244\355\233\204 4.37.03 2.png" new file mode 100644 index 0000000..4c3fa57 Binary files /dev/null and "b/SecondWorkbook/SecondWorkbook/Assets.xcassets/cellImage.imageset/\354\212\244\355\201\254\353\246\260\354\203\267 2023-09-30 \354\230\244\355\233\204 4.37.03 2.png" differ diff --git "a/SecondWorkbook/SecondWorkbook/Assets.xcassets/cellImage.imageset/\354\212\244\355\201\254\353\246\260\354\203\267 2023-09-30 \354\230\244\355\233\204 4.37.03.png" "b/SecondWorkbook/SecondWorkbook/Assets.xcassets/cellImage.imageset/\354\212\244\355\201\254\353\246\260\354\203\267 2023-09-30 \354\230\244\355\233\204 4.37.03.png" new file mode 100644 index 0000000..4c3fa57 Binary files /dev/null and "b/SecondWorkbook/SecondWorkbook/Assets.xcassets/cellImage.imageset/\354\212\244\355\201\254\353\246\260\354\203\267 2023-09-30 \354\230\244\355\233\204 4.37.03.png" differ diff --git a/SecondWorkbook/SecondWorkbook/Base.lproj/LaunchScreen.storyboard b/SecondWorkbook/SecondWorkbook/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..865e932 --- /dev/null +++ b/SecondWorkbook/SecondWorkbook/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SecondWorkbook/SecondWorkbook/Base.lproj/Main.storyboard b/SecondWorkbook/SecondWorkbook/Base.lproj/Main.storyboard new file mode 100644 index 0000000..880d3cb --- /dev/null +++ b/SecondWorkbook/SecondWorkbook/Base.lproj/Main.storyboard @@ -0,0 +1,240 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SecondWorkbook/SecondWorkbook/CustomCell.swift b/SecondWorkbook/SecondWorkbook/CustomCell.swift new file mode 100644 index 0000000..358c557 --- /dev/null +++ b/SecondWorkbook/SecondWorkbook/CustomCell.swift @@ -0,0 +1,29 @@ +// +// CustomCell.swift +// SecondWorkbook +// +// Created by 김수민 on 2023/09/30. +// + +import UIKit + +class CustomCell: UITableViewCell { + + @IBOutlet var leftImageView: UIImageView! + @IBOutlet var firstLabel: UILabel! + @IBOutlet var secondLabel: UILabel! + @IBOutlet var thirdLabel: UILabel! + override func awakeFromNib() { + super.awakeFromNib() + // Initialization code + } + + override func setSelected(_ selected: Bool, animated: Bool) { + super.setSelected(selected, animated: animated) + + // Configure the view for the selected state + } + + + +} diff --git a/SecondWorkbook/SecondWorkbook/Info.plist b/SecondWorkbook/SecondWorkbook/Info.plist new file mode 100644 index 0000000..dd3c9af --- /dev/null +++ b/SecondWorkbook/SecondWorkbook/Info.plist @@ -0,0 +1,25 @@ + + + + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + UISceneStoryboardFile + Main + + + + + + diff --git a/SecondWorkbook/SecondWorkbook/SceneDelegate.swift b/SecondWorkbook/SecondWorkbook/SceneDelegate.swift new file mode 100644 index 0000000..0f9a759 --- /dev/null +++ b/SecondWorkbook/SecondWorkbook/SceneDelegate.swift @@ -0,0 +1,52 @@ +// +// SceneDelegate.swift +// SecondWorkbook +// +// Created by 김수민 on 2023/09/30. +// + +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/SecondWorkbook/SecondWorkbook/ViewController.swift b/SecondWorkbook/SecondWorkbook/ViewController.swift new file mode 100644 index 0000000..28b34f3 --- /dev/null +++ b/SecondWorkbook/SecondWorkbook/ViewController.swift @@ -0,0 +1,90 @@ +// +// ViewController.swift +// SecondWorkbook +// +// Created by 김수민 on 2023/09/30. +// + +import UIKit + +class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate { + + let tableViewCellTitle: [String] = ["1", "2", "3", "4", "5", "6", "7"] + let tableViewCellSubtitle: [String] = ["11", "22", "33", "44", "55", "66", "77"] + let price: [String] = ["100원", "200원", "300원", "400원", "500원", "600원", "700원"] + let cellIdentifier: String = "cell" + let twoCellIdentifier: String = "twoCell" + + @IBOutlet weak var tableView: UITableView! + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return tableViewCellTitle.count + } + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + if indexPath.row == 1 { + let collectionCell: CustomCollectionViewCell = tableView.dequeueReusableCell(withIdentifier: self.twoCellIdentifier, for: indexPath) as! CustomCollectionViewCell + return collectionCell + } else { + let cell: CustomCell = tableView.dequeueReusableCell(withIdentifier: self.cellIdentifier, for: indexPath) as! CustomCell + let firstText: String = tableViewCellTitle[indexPath.row] + let secondText: String = tableViewCellSubtitle[indexPath.row] + let thirdText: String = price[indexPath.row] + cell.firstLabel.text = firstText + cell.secondLabel.text = secondText + cell.thirdLabel.text = thirdText + return cell + } + } + +// func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { +// return UITableView.automaticDimension +// } + func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { + return 150 + } + + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view. + self.tableView.delegate = self + self.tableView.dataSource = self + let titleLabel = UILabel() + titleLabel.textColor = UIColor.black + titleLabel.text = "광명동" + titleLabel.font = UIFont.systemFont(ofSize: 20, weight: .bold) + self.navigationItem.leftBarButtonItem = UIBarButtonItem.init(customView: titleLabel) + setRightBarButtons() + } + + private func setRightBarButtons() { + let writeButton = self.navigationItem.makeSFSymbolButton(self, + action: Selector("pushToWrite"), + symbolName: "highlighter") + let scanQRButton = self.navigationItem.makeSFSymbolButton(self, + action: Selector("pushToScanQR"), + symbolName: "viewfinder") + let notificationButton = self.navigationItem.makeSFSymbolButton(self, + action: Selector("pushToNotification"), + symbolName: "bell") + + self.navigationItem.rightBarButtonItems = [notificationButton, scanQRButton, writeButton] + } +} + +extension UINavigationItem { + func makeSFSymbolButton(_ target: Any?, action: Selector, symbolName: String) -> UIBarButtonItem { + let button = UIButton(type: .system) + button.setImage(UIImage(systemName: symbolName), for: .normal) + button.addTarget(target, action: action, for: .touchUpInside) + button.tintColor = .black + + let barButtonItem = UIBarButtonItem(customView: button) + barButtonItem.customView?.translatesAutoresizingMaskIntoConstraints = false + barButtonItem.customView?.heightAnchor.constraint(equalToConstant: 24).isActive = true + barButtonItem.customView?.widthAnchor.constraint(equalToConstant: 24).isActive = true + + return barButtonItem + } + +} diff --git a/iOS_Study_A/Base.lproj/Main.storyboard b/iOS_Study_A/Base.lproj/Main.storyboard index 25a7638..0e12f03 100644 --- a/iOS_Study_A/Base.lproj/Main.storyboard +++ b/iOS_Study_A/Base.lproj/Main.storyboard @@ -1,24 +1,47 @@ - + + - - + - + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +