diff --git a/HW1/HW1.xcodeproj/project.pbxproj b/HW1/HW1.xcodeproj/project.pbxproj new file mode 100644 index 0000000..a89d849 --- /dev/null +++ b/HW1/HW1.xcodeproj/project.pbxproj @@ -0,0 +1,568 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 77; + objects = { + +/* Begin PBXContainerItemProxy section */ + A31FDF3B2CAFBFAE002ADBD1 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A31FDF1C2CAFBFAD002ADBD1 /* Project object */; + proxyType = 1; + remoteGlobalIDString = A31FDF232CAFBFAD002ADBD1; + remoteInfo = HW1; + }; + A31FDF452CAFBFAE002ADBD1 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A31FDF1C2CAFBFAD002ADBD1 /* Project object */; + proxyType = 1; + remoteGlobalIDString = A31FDF232CAFBFAD002ADBD1; + remoteInfo = HW1; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + A31FDF242CAFBFAD002ADBD1 /* HW1.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HW1.app; sourceTree = BUILT_PRODUCTS_DIR; }; + A31FDF3A2CAFBFAE002ADBD1 /* HW1Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = HW1Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + A31FDF442CAFBFAE002ADBD1 /* HW1UITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = HW1UITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */ + A31FDF4C2CAFBFAE002ADBD1 /* Exceptions for "HW1" folder in "HW1" target */ = { + isa = PBXFileSystemSynchronizedBuildFileExceptionSet; + membershipExceptions = ( + Info.plist, + ); + target = A31FDF232CAFBFAD002ADBD1 /* HW1 */; + }; +/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */ + +/* Begin PBXFileSystemSynchronizedRootGroup section */ + A31FDF262CAFBFAD002ADBD1 /* HW1 */ = { + isa = PBXFileSystemSynchronizedRootGroup; + exceptions = ( + A31FDF4C2CAFBFAE002ADBD1 /* Exceptions for "HW1" folder in "HW1" target */, + ); + path = HW1; + sourceTree = ""; + }; + A31FDF3D2CAFBFAE002ADBD1 /* HW1Tests */ = { + isa = PBXFileSystemSynchronizedRootGroup; + path = HW1Tests; + sourceTree = ""; + }; + A31FDF472CAFBFAE002ADBD1 /* HW1UITests */ = { + isa = PBXFileSystemSynchronizedRootGroup; + path = HW1UITests; + sourceTree = ""; + }; +/* End PBXFileSystemSynchronizedRootGroup section */ + +/* Begin PBXFrameworksBuildPhase section */ + A31FDF212CAFBFAD002ADBD1 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A31FDF372CAFBFAE002ADBD1 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A31FDF412CAFBFAE002ADBD1 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + A31FDF1B2CAFBFAD002ADBD1 = { + isa = PBXGroup; + children = ( + A31FDF262CAFBFAD002ADBD1 /* HW1 */, + A31FDF3D2CAFBFAE002ADBD1 /* HW1Tests */, + A31FDF472CAFBFAE002ADBD1 /* HW1UITests */, + A31FDF252CAFBFAD002ADBD1 /* Products */, + ); + sourceTree = ""; + }; + A31FDF252CAFBFAD002ADBD1 /* Products */ = { + isa = PBXGroup; + children = ( + A31FDF242CAFBFAD002ADBD1 /* HW1.app */, + A31FDF3A2CAFBFAE002ADBD1 /* HW1Tests.xctest */, + A31FDF442CAFBFAE002ADBD1 /* HW1UITests.xctest */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + A31FDF232CAFBFAD002ADBD1 /* HW1 */ = { + isa = PBXNativeTarget; + buildConfigurationList = A31FDF4D2CAFBFAE002ADBD1 /* Build configuration list for PBXNativeTarget "HW1" */; + buildPhases = ( + A31FDF202CAFBFAD002ADBD1 /* Sources */, + A31FDF212CAFBFAD002ADBD1 /* Frameworks */, + A31FDF222CAFBFAD002ADBD1 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + fileSystemSynchronizedGroups = ( + A31FDF262CAFBFAD002ADBD1 /* HW1 */, + ); + name = HW1; + packageProductDependencies = ( + ); + productName = HW1; + productReference = A31FDF242CAFBFAD002ADBD1 /* HW1.app */; + productType = "com.apple.product-type.application"; + }; + A31FDF392CAFBFAE002ADBD1 /* HW1Tests */ = { + isa = PBXNativeTarget; + buildConfigurationList = A31FDF522CAFBFAE002ADBD1 /* Build configuration list for PBXNativeTarget "HW1Tests" */; + buildPhases = ( + A31FDF362CAFBFAE002ADBD1 /* Sources */, + A31FDF372CAFBFAE002ADBD1 /* Frameworks */, + A31FDF382CAFBFAE002ADBD1 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + A31FDF3C2CAFBFAE002ADBD1 /* PBXTargetDependency */, + ); + fileSystemSynchronizedGroups = ( + A31FDF3D2CAFBFAE002ADBD1 /* HW1Tests */, + ); + name = HW1Tests; + packageProductDependencies = ( + ); + productName = HW1Tests; + productReference = A31FDF3A2CAFBFAE002ADBD1 /* HW1Tests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + A31FDF432CAFBFAE002ADBD1 /* HW1UITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = A31FDF552CAFBFAE002ADBD1 /* Build configuration list for PBXNativeTarget "HW1UITests" */; + buildPhases = ( + A31FDF402CAFBFAE002ADBD1 /* Sources */, + A31FDF412CAFBFAE002ADBD1 /* Frameworks */, + A31FDF422CAFBFAE002ADBD1 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + A31FDF462CAFBFAE002ADBD1 /* PBXTargetDependency */, + ); + fileSystemSynchronizedGroups = ( + A31FDF472CAFBFAE002ADBD1 /* HW1UITests */, + ); + name = HW1UITests; + packageProductDependencies = ( + ); + productName = HW1UITests; + productReference = A31FDF442CAFBFAE002ADBD1 /* HW1UITests.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + A31FDF1C2CAFBFAD002ADBD1 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1600; + LastUpgradeCheck = 1600; + TargetAttributes = { + A31FDF232CAFBFAD002ADBD1 = { + CreatedOnToolsVersion = 16.0; + }; + A31FDF392CAFBFAE002ADBD1 = { + CreatedOnToolsVersion = 16.0; + TestTargetID = A31FDF232CAFBFAD002ADBD1; + }; + A31FDF432CAFBFAE002ADBD1 = { + CreatedOnToolsVersion = 16.0; + TestTargetID = A31FDF232CAFBFAD002ADBD1; + }; + }; + }; + buildConfigurationList = A31FDF1F2CAFBFAD002ADBD1 /* Build configuration list for PBXProject "HW1" */; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = A31FDF1B2CAFBFAD002ADBD1; + minimizedProjectReferenceProxies = 1; + preferredProjectObjectVersion = 77; + productRefGroup = A31FDF252CAFBFAD002ADBD1 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + A31FDF232CAFBFAD002ADBD1 /* HW1 */, + A31FDF392CAFBFAE002ADBD1 /* HW1Tests */, + A31FDF432CAFBFAE002ADBD1 /* HW1UITests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + A31FDF222CAFBFAD002ADBD1 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A31FDF382CAFBFAE002ADBD1 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A31FDF422CAFBFAE002ADBD1 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + A31FDF202CAFBFAD002ADBD1 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A31FDF362CAFBFAE002ADBD1 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A31FDF402CAFBFAE002ADBD1 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + A31FDF3C2CAFBFAE002ADBD1 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = A31FDF232CAFBFAD002ADBD1 /* HW1 */; + targetProxy = A31FDF3B2CAFBFAE002ADBD1 /* PBXContainerItemProxy */; + }; + A31FDF462CAFBFAE002ADBD1 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = A31FDF232CAFBFAD002ADBD1 /* HW1 */; + targetProxy = A31FDF452CAFBFAE002ADBD1 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + A31FDF4E2CAFBFAE002ADBD1 /* 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 = HW1/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 = "-.HW1"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + A31FDF4F2CAFBFAE002ADBD1 /* 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 = HW1/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 = "-.HW1"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + A31FDF502CAFBFAE002ADBD1 /* 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 = 18.0; + 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; + }; + A31FDF512CAFBFAE002ADBD1 /* 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 = 18.0; + 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; + }; + A31FDF532CAFBFAE002ADBD1 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 18.0; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "-.HW1Tests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HW1.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/HW1"; + }; + name = Debug; + }; + A31FDF542CAFBFAE002ADBD1 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 18.0; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "-.HW1Tests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HW1.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/HW1"; + }; + name = Release; + }; + A31FDF562CAFBFAE002ADBD1 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "-.HW1UITests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = HW1; + }; + name = Debug; + }; + A31FDF572CAFBFAE002ADBD1 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "-.HW1UITests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = HW1; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + A31FDF1F2CAFBFAD002ADBD1 /* Build configuration list for PBXProject "HW1" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A31FDF502CAFBFAE002ADBD1 /* Debug */, + A31FDF512CAFBFAE002ADBD1 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + A31FDF4D2CAFBFAE002ADBD1 /* Build configuration list for PBXNativeTarget "HW1" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A31FDF4E2CAFBFAE002ADBD1 /* Debug */, + A31FDF4F2CAFBFAE002ADBD1 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + A31FDF522CAFBFAE002ADBD1 /* Build configuration list for PBXNativeTarget "HW1Tests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A31FDF532CAFBFAE002ADBD1 /* Debug */, + A31FDF542CAFBFAE002ADBD1 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + A31FDF552CAFBFAE002ADBD1 /* Build configuration list for PBXNativeTarget "HW1UITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A31FDF562CAFBFAE002ADBD1 /* Debug */, + A31FDF572CAFBFAE002ADBD1 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = A31FDF1C2CAFBFAD002ADBD1 /* Project object */; +} diff --git a/HW1/HW1.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/HW1/HW1.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/HW1/HW1.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/HW1/HW1.xcodeproj/project.xcworkspace/xcuserdata/poiasdmnb.xcuserdatad/UserInterfaceState.xcuserstate b/HW1/HW1.xcodeproj/project.xcworkspace/xcuserdata/poiasdmnb.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..587dcc9 Binary files /dev/null and b/HW1/HW1.xcodeproj/project.xcworkspace/xcuserdata/poiasdmnb.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/HW1/HW1.xcodeproj/xcuserdata/poiasdmnb.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/HW1/HW1.xcodeproj/xcuserdata/poiasdmnb.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..ade6f02 --- /dev/null +++ b/HW1/HW1.xcodeproj/xcuserdata/poiasdmnb.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,24 @@ + + + + + + + + + diff --git a/HW1/HW1.xcodeproj/xcuserdata/poiasdmnb.xcuserdatad/xcschemes/xcschememanagement.plist b/HW1/HW1.xcodeproj/xcuserdata/poiasdmnb.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..13f6e97 --- /dev/null +++ b/HW1/HW1.xcodeproj/xcuserdata/poiasdmnb.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + HW1.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/HW1/HW1/AppDelegate.swift b/HW1/HW1/AppDelegate.swift new file mode 100644 index 0000000..537b35c --- /dev/null +++ b/HW1/HW1/AppDelegate.swift @@ -0,0 +1,23 @@ +// +// AppDelegate.swift +// HW1 +// +// Created by дилара on 04.10.2024. +// + +import UIKit + +@main +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + window = UIWindow(frame: UIScreen.main.bounds) + let profileViewController = ProfileViewController() + window?.rootViewController = UINavigationController(rootViewController: profileViewController) + window?.makeKeyAndVisible() + return true + } +} + diff --git a/HW1/HW1/Assets.xcassets/AccentColor.colorset/Contents.json b/HW1/HW1/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/HW1/HW1/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/HW1/HW1/Assets.xcassets/AppIcon.appiconset/Contents.json b/HW1/HW1/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..2305880 --- /dev/null +++ b/HW1/HW1/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,35 @@ +{ + "images" : [ + { + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "tinted" + } + ], + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/HW1/HW1/Assets.xcassets/Contents.json b/HW1/HW1/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/HW1/HW1/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/HW1/HW1/Assets.xcassets/Image.imageset/Contents.json b/HW1/HW1/Assets.xcassets/Image.imageset/Contents.json new file mode 100644 index 0000000..e796cbb --- /dev/null +++ b/HW1/HW1/Assets.xcassets/Image.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "грустный.jpeg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git "a/HW1/HW1/Assets.xcassets/Image.imageset/\320\263\321\200\321\203\321\201\321\202\320\275\321\213\320\270\314\206.jpeg" "b/HW1/HW1/Assets.xcassets/Image.imageset/\320\263\321\200\321\203\321\201\321\202\320\275\321\213\320\270\314\206.jpeg" new file mode 100644 index 0000000..e5993c5 Binary files /dev/null and "b/HW1/HW1/Assets.xcassets/Image.imageset/\320\263\321\200\321\203\321\201\321\202\320\275\321\213\320\270\314\206.jpeg" differ diff --git a/HW1/HW1/Assets.xcassets/Image1.imageset/Contents.json b/HW1/HW1/Assets.xcassets/Image1.imageset/Contents.json new file mode 100644 index 0000000..d9061af --- /dev/null +++ b/HW1/HW1/Assets.xcassets/Image1.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "пчелкошка.jpeg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git "a/HW1/HW1/Assets.xcassets/Image1.imageset/\320\277\321\207\320\265\320\273\320\272\320\276\321\210\320\272\320\260.jpeg" "b/HW1/HW1/Assets.xcassets/Image1.imageset/\320\277\321\207\320\265\320\273\320\272\320\276\321\210\320\272\320\260.jpeg" new file mode 100644 index 0000000..2f76c11 Binary files /dev/null and "b/HW1/HW1/Assets.xcassets/Image1.imageset/\320\277\321\207\320\265\320\273\320\272\320\276\321\210\320\272\320\260.jpeg" differ diff --git a/HW1/HW1/Assets.xcassets/Image2.imageset/Contents.json b/HW1/HW1/Assets.xcassets/Image2.imageset/Contents.json new file mode 100644 index 0000000..b2963a9 --- /dev/null +++ b/HW1/HW1/Assets.xcassets/Image2.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "картинка.jpeg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git "a/HW1/HW1/Assets.xcassets/Image2.imageset/\320\272\320\260\321\200\321\202\320\270\320\275\320\272\320\260.jpeg" "b/HW1/HW1/Assets.xcassets/Image2.imageset/\320\272\320\260\321\200\321\202\320\270\320\275\320\272\320\260.jpeg" new file mode 100644 index 0000000..f6c8866 Binary files /dev/null and "b/HW1/HW1/Assets.xcassets/Image2.imageset/\320\272\320\260\321\200\321\202\320\270\320\275\320\272\320\260.jpeg" differ diff --git a/HW1/HW1/Assets.xcassets/Image3.imageset/02-sad-ai-cats.jpeg b/HW1/HW1/Assets.xcassets/Image3.imageset/02-sad-ai-cats.jpeg new file mode 100644 index 0000000..b8a6747 Binary files /dev/null and b/HW1/HW1/Assets.xcassets/Image3.imageset/02-sad-ai-cats.jpeg differ diff --git a/HW1/HW1/Assets.xcassets/Image3.imageset/Contents.json b/HW1/HW1/Assets.xcassets/Image3.imageset/Contents.json new file mode 100644 index 0000000..e294a55 --- /dev/null +++ b/HW1/HW1/Assets.xcassets/Image3.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "02-sad-ai-cats.jpeg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/HW1/HW1/Assets.xcassets/Image4.imageset/Contents.json b/HW1/HW1/Assets.xcassets/Image4.imageset/Contents.json new file mode 100644 index 0000000..d392bbb --- /dev/null +++ b/HW1/HW1/Assets.xcassets/Image4.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "котик.jpeg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git "a/HW1/HW1/Assets.xcassets/Image4.imageset/\320\272\320\276\321\202\320\270\320\272.jpeg" "b/HW1/HW1/Assets.xcassets/Image4.imageset/\320\272\320\276\321\202\320\270\320\272.jpeg" new file mode 100644 index 0000000..0fd4800 Binary files /dev/null and "b/HW1/HW1/Assets.xcassets/Image4.imageset/\320\272\320\276\321\202\320\270\320\272.jpeg" differ diff --git a/HW1/HW1/Assets.xcassets/Image5.imageset/Contents.json b/HW1/HW1/Assets.xcassets/Image5.imageset/Contents.json new file mode 100644 index 0000000..fcea938 --- /dev/null +++ b/HW1/HW1/Assets.xcassets/Image5.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "d7ba91697ef24e72c196c609fcf2fee7.jpg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/HW1/HW1/Assets.xcassets/Image5.imageset/d7ba91697ef24e72c196c609fcf2fee7.jpg b/HW1/HW1/Assets.xcassets/Image5.imageset/d7ba91697ef24e72c196c609fcf2fee7.jpg new file mode 100644 index 0000000..2ce0f94 Binary files /dev/null and b/HW1/HW1/Assets.xcassets/Image5.imageset/d7ba91697ef24e72c196c609fcf2fee7.jpg differ diff --git a/HW1/HW1/Assets.xcassets/Image6.imageset/Contents.json b/HW1/HW1/Assets.xcassets/Image6.imageset/Contents.json new file mode 100644 index 0000000..11982d2 --- /dev/null +++ b/HW1/HW1/Assets.xcassets/Image6.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "eb1da5735474d107b9351bd2161a4760.jpg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/HW1/HW1/Assets.xcassets/Image6.imageset/eb1da5735474d107b9351bd2161a4760.jpg b/HW1/HW1/Assets.xcassets/Image6.imageset/eb1da5735474d107b9351bd2161a4760.jpg new file mode 100644 index 0000000..50f4c4e Binary files /dev/null and b/HW1/HW1/Assets.xcassets/Image6.imageset/eb1da5735474d107b9351bd2161a4760.jpg differ diff --git a/HW1/HW1/Base.lproj/LaunchScreen.storyboard b/HW1/HW1/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..865e932 --- /dev/null +++ b/HW1/HW1/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HW1/HW1/Base.lproj/Main.storyboard b/HW1/HW1/Base.lproj/Main.storyboard new file mode 100644 index 0000000..25a7638 --- /dev/null +++ b/HW1/HW1/Base.lproj/Main.storyboard @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HW1/HW1/ExperienceTableViewCell.swift b/HW1/HW1/ExperienceTableViewCell.swift new file mode 100644 index 0000000..1b8c3bb --- /dev/null +++ b/HW1/HW1/ExperienceTableViewCell.swift @@ -0,0 +1,47 @@ +// +// ExperienceTableViewCell.swift +// HW1 +// +// Created by дилара on 04.10.2024. +// + +import UIKit + +class ExperienceTableViewCell: UITableViewCell { + + private let yearLabel = UILabel() + private let descriptionLabel = UILabel() + + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { + super.init(style: style, reuseIdentifier: reuseIdentifier) + setUpViews() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + private func setUpViews() { + let stackView = UIStackView(arrangedSubviews: [yearLabel, descriptionLabel]) + stackView.axis = .vertical + stackView.spacing = 10 + stackView.translatesAutoresizingMaskIntoConstraints = false + contentView.addSubview(stackView) + descriptionLabel.numberOfLines = 0 + + NSLayoutConstraint.activate([ + stackView.leadingAnchor.constraint(equalTo: contentView.leadingAnchor, constant: 30), + stackView.trailingAnchor.constraint(equalTo: contentView.trailingAnchor, constant: -30), + stackView.topAnchor.constraint(equalTo: contentView.topAnchor, constant: 20), + stackView.bottomAnchor.constraint(equalTo: contentView.bottomAnchor, constant: -20) + ]) + + } + + func configure(with experience: Experience) { + yearLabel.text = experience.year + descriptionLabel.text = experience.description + } +} + + diff --git a/HW1/HW1/Info.plist b/HW1/HW1/Info.plist new file mode 100644 index 0000000..0eb786d --- /dev/null +++ b/HW1/HW1/Info.plist @@ -0,0 +1,23 @@ + + + + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + + + + + + diff --git a/HW1/HW1/PhotoCollectionViewCell.swift b/HW1/HW1/PhotoCollectionViewCell.swift new file mode 100644 index 0000000..c715446 --- /dev/null +++ b/HW1/HW1/PhotoCollectionViewCell.swift @@ -0,0 +1,37 @@ +// +// PhotoCollectionViewCell.swift +// HW1 +// +// Created by дилара on 04.10.2024. +// + +import UIKit + +class PhotoCollectionViewCell: UICollectionViewCell { + let imageView: UIImageView = { + let imageView = UIImageView() + imageView.translatesAutoresizingMaskIntoConstraints = false + imageView.contentMode = .scaleAspectFill + imageView.clipsToBounds = true + return imageView + }() + + override init(frame: CGRect) { + super.init(frame: frame) + contentView.addSubview(imageView) + NSLayoutConstraint.activate([ + imageView.leadingAnchor.constraint(equalTo: contentView.leadingAnchor), + imageView.trailingAnchor.constraint(equalTo: contentView.trailingAnchor), + imageView.topAnchor.constraint(equalTo: contentView.topAnchor), + imageView.bottomAnchor.constraint(equalTo: contentView.bottomAnchor) + ]) + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + func configure(with imageName: String) { + imageView.image = UIImage(named: imageName) + } +} diff --git a/HW1/HW1/PhotosTableViewCell.swift b/HW1/HW1/PhotosTableViewCell.swift new file mode 100644 index 0000000..8d90b6d --- /dev/null +++ b/HW1/HW1/PhotosTableViewCell.swift @@ -0,0 +1,68 @@ +// +// PhotosCollectionViewCell.swift +// HW1 +// +// Created by дилара on 04.10.2024. +// + + +import UIKit + +class PhotosTableViewCell: UITableViewCell { + + private let collectionView: UICollectionView = { + let layout = UICollectionViewFlowLayout() + layout.scrollDirection = .horizontal + let collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout) + collectionView.translatesAutoresizingMaskIntoConstraints = false + collectionView.register(PhotoCollectionViewCell.self, forCellWithReuseIdentifier: "PhotoCell") + return collectionView + }() + + private var photos: [Photo] = [] + + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { + super.init(style: style, reuseIdentifier: reuseIdentifier) + setUpViews() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + private func setUpViews() { + contentView.addSubview(collectionView) + NSLayoutConstraint.activate([ + collectionView.leadingAnchor.constraint(equalTo: contentView.leadingAnchor), + collectionView.trailingAnchor.constraint(equalTo: contentView.trailingAnchor), + collectionView.topAnchor.constraint(equalTo: contentView.topAnchor), + collectionView.bottomAnchor.constraint(equalTo: contentView.bottomAnchor) + ]) + } + + func configure(with photos: [Photo]) { + self.photos = photos + collectionView.dataSource = self + collectionView.delegate = self + collectionView.reloadData() + } +} + +extension PhotosTableViewCell: UICollectionViewDataSource, UICollectionViewDelegateFlowLayout { + func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + return photos.count + } + + func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "PhotoCell", for: indexPath) as! PhotoCollectionViewCell + cell.configure(with: photos[indexPath.item].imageName) + return cell + } + + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { + return CGSize(width: 100, height: 150) + } +} + + + diff --git a/HW1/HW1/ProfileViewController.swift b/HW1/HW1/ProfileViewController.swift new file mode 100644 index 0000000..27d6ab8 --- /dev/null +++ b/HW1/HW1/ProfileViewController.swift @@ -0,0 +1,104 @@ +// +// ViewController.swift +// HW1 +// +// Created by дилара on 04.10.2024. +// + +import UIKit + +class ProfileViewController: UIViewController { + + private let tableView = UITableView() + private let user = User(avatar: "Image", name: "Emili", age: 30, city: "Paris", experience: [ + Experience(year: "2021", description: "Senior software engineer"), + Experience(year: "2017", description: "Middle software engineer"), + Experience(year: "2015", description: "School teacher") + ], photos: ["Image", "Image1", "Image2", "Image3", "Image4", "Image5", "Image6"]) + + override func viewDidLoad() { + super.viewDidLoad() + setUpViews() + } + + private func setUpViews() { + view.addSubview(tableView) + tableView.translatesAutoresizingMaskIntoConstraints = false + NSLayoutConstraint.activate([ + tableView.leadingAnchor.constraint(equalTo: view.leadingAnchor), + tableView.trailingAnchor.constraint(equalTo: view.trailingAnchor), + tableView.topAnchor.constraint(equalTo: view.topAnchor), + tableView.bottomAnchor.constraint(equalTo: view.bottomAnchor) + ]) + + tableView.dataSource = self + tableView.delegate = self + tableView.register(UINib(nibName: "UserTableViewCell", bundle: nil), forCellReuseIdentifier: "UserTableViewCell") + tableView.register(ExperienceTableViewCell.self, forCellReuseIdentifier: "ExperienceTableViewCell") + tableView.register(PhotosTableViewCell.self, forCellReuseIdentifier: "PhotosTableViewCell") + } +} + +extension ProfileViewController: UITableViewDataSource, UITableViewDelegate { + func numberOfSections(in tableView: UITableView) -> Int { + return 3 + } + + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + switch section { + case 0: + return 1 + case 1: + return user.experience.count + case 2: + return 1 + default: + return 0 + } + } + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + switch indexPath.section { + case 0: + let cell = tableView.dequeueReusableCell(withIdentifier: "UserTableViewCell", for: indexPath) as! UserTableViewCell + cell.configure(with: user) + return cell + case 1: + let cell = tableView.dequeueReusableCell(withIdentifier: "ExperienceTableViewCell", for: indexPath) as! ExperienceTableViewCell + cell.configure(with: user.experience[indexPath.row]) + return cell + case 2: + let cell = tableView.dequeueReusableCell(withIdentifier: "PhotosTableViewCell", for: indexPath) as! PhotosTableViewCell + cell.configure(with: user.photos.map { Photo(imageName: $0) }) + return cell + default: + return UITableViewCell() + } + } + + func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? { + switch section { + case 0: + return "User" + case 1: + return "Work Experience" + case 2: + return "Photos" + default: + return nil + } + } + + func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { + switch indexPath.section { + case 0: + return 100 + case 1: + return UITableView.automaticDimension + case 2: + return 200 + default: + return UITableView.automaticDimension + } + } +} diff --git a/HW1/HW1/SceneDelegate.swift b/HW1/HW1/SceneDelegate.swift new file mode 100644 index 0000000..ceafe6b --- /dev/null +++ b/HW1/HW1/SceneDelegate.swift @@ -0,0 +1,55 @@ +// +// SceneDelegate.swift +// HW1 +// +// Created by дилара on 04.10.2024. +// + +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 } + + let window = UIWindow(windowScene: windowScene) + let profileViewController = ProfileViewController() + let navigationController = UINavigationController(rootViewController: profileViewController) + window.rootViewController = navigationController + self.window = window + 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/HW1/HW1/User.swift b/HW1/HW1/User.swift new file mode 100644 index 0000000..1495c93 --- /dev/null +++ b/HW1/HW1/User.swift @@ -0,0 +1,28 @@ +// +// User.swift +// HW1 +// +// Created by дилара on 04.10.2024. +// + +import Foundation + +import UIKit + +struct User { + let avatar: String + let name: String + let age: Int + let city: String + let experience: [Experience] + let photos: [String] +} + +struct Experience { + let year: String + let description: String +} + +struct Photo { + let imageName: String +} diff --git a/HW1/HW1/UserTableViewCell.swift b/HW1/HW1/UserTableViewCell.swift new file mode 100644 index 0000000..02e48d0 --- /dev/null +++ b/HW1/HW1/UserTableViewCell.swift @@ -0,0 +1,28 @@ +// +// UserTableViewCell.swift +// HW1 +// +// Created by дилара on 04.10.2024. +// + +import UIKit + +class UserTableViewCell: UITableViewCell { + + + + + @IBOutlet weak var nameLabel: UILabel! + @IBOutlet weak var ageLabel: UILabel! + @IBOutlet weak var cityLabel: UILabel! + @IBOutlet weak var avatarImageView: UIImageView! + + @IBOutlet weak var avatarImage: UIImageView! + func configure (with user: User) { + nameLabel.text = user.name + ageLabel.text = "\(user.age)" + "yo" + cityLabel.text = user.city + } + + +} diff --git a/HW1/HW1/UserTableViewCell.xib b/HW1/HW1/UserTableViewCell.xib new file mode 100644 index 0000000..41faf09 --- /dev/null +++ b/HW1/HW1/UserTableViewCell.xib @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HW1/HW1Tests/HW1Tests.swift b/HW1/HW1Tests/HW1Tests.swift new file mode 100644 index 0000000..32f5354 --- /dev/null +++ b/HW1/HW1Tests/HW1Tests.swift @@ -0,0 +1,17 @@ +// +// HW1Tests.swift +// HW1Tests +// +// Created by дилара on 04.10.2024. +// + +import Testing +@testable import HW1 + +struct HW1Tests { + + @Test func example() async throws { + // Write your test here and use APIs like `#expect(...)` to check expected conditions. + } + +} diff --git a/HW1/HW1UITests/HW1UITests.swift b/HW1/HW1UITests/HW1UITests.swift new file mode 100644 index 0000000..cb3a6f0 --- /dev/null +++ b/HW1/HW1UITests/HW1UITests.swift @@ -0,0 +1,43 @@ +// +// HW1UITests.swift +// HW1UITests +// +// Created by дилара on 04.10.2024. +// + +import XCTest + +final class HW1UITests: XCTestCase { + + override func setUpWithError() throws { + // Put setup code here. This method is called before the invocation of each test method in the class. + + // In UI tests it is usually best to stop immediately when a failure occurs. + continueAfterFailure = false + + // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. + } + + override func tearDownWithError() throws { + // Put teardown code here. This method is called after the invocation of each test method in the class. + } + + @MainActor + func testExample() throws { + // UI tests must launch the application that they test. + let app = XCUIApplication() + app.launch() + + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + + @MainActor + func testLaunchPerformance() throws { + if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 7.0, *) { + // This measures how long it takes to launch your application. + measure(metrics: [XCTApplicationLaunchMetric()]) { + XCUIApplication().launch() + } + } + } +} diff --git a/HW1/HW1UITests/HW1UITestsLaunchTests.swift b/HW1/HW1UITests/HW1UITestsLaunchTests.swift new file mode 100644 index 0000000..e0f24af --- /dev/null +++ b/HW1/HW1UITests/HW1UITestsLaunchTests.swift @@ -0,0 +1,33 @@ +// +// HW1UITestsLaunchTests.swift +// HW1UITests +// +// Created by дилара on 04.10.2024. +// + +import XCTest + +final class HW1UITestsLaunchTests: XCTestCase { + + override class var runsForEachTargetApplicationUIConfiguration: Bool { + true + } + + override func setUpWithError() throws { + continueAfterFailure = false + } + + @MainActor + func testLaunch() throws { + let app = XCUIApplication() + app.launch() + + // Insert steps here to perform after app launch but before taking a screenshot, + // such as logging into a test account or navigating somewhere in the app + + let attachment = XCTAttachment(screenshot: app.screenshot()) + attachment.name = "Launch Screen" + attachment.lifetime = .keepAlways + add(attachment) + } +}