diff --git a/List.txt b/List.txt new file mode 100644 index 0000000..4768b64 --- /dev/null +++ b/List.txt @@ -0,0 +1,19 @@ +∙ What is Interface Builder's object library? + +Interface Builder's object library is a library that contains all the elements used in creating the user interface for iOS apps, from table view controllers to buttons, labels, etc. + +∙ What is the difference between an outlet and an action? + +An outlet is a reference to an object in a storyboard from a source code file. An action is a piece of code that’s linked to an event that can occur in your app. + +∙ What is the role of a View Controller? + +The view controller manages a set of views and coordinates the flow of information between the app's data model and the views that display that data. + +∙ What is Model-View-Controller? + +A pattern of app design in which view controllers serve as the communication pipeline between views and the data model. + +∙ Why use Model-View-Controller? + +It is Apple's recommended architectural pattern and many of the Apple frameworks use MVC. \ No newline at end of file diff --git a/List/List.xcodeproj/project.pbxproj b/List/List.xcodeproj/project.pbxproj new file mode 100644 index 0000000..1297983 --- /dev/null +++ b/List/List.xcodeproj/project.pbxproj @@ -0,0 +1,397 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 4B4A793921E57D4000AD245A /* Item.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B4A793821E57D4000AD245A /* Item.swift */; }; + 4B8B411621E52D0800BA89B3 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B8B411521E52D0800BA89B3 /* AppDelegate.swift */; }; + 4B8B411821E52D0800BA89B3 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B8B411721E52D0800BA89B3 /* ViewController.swift */; }; + 4B8B411B21E52D0800BA89B3 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4B8B411921E52D0800BA89B3 /* Main.storyboard */; }; + 4B8B411D21E52D0900BA89B3 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4B8B411C21E52D0900BA89B3 /* Assets.xcassets */; }; + 4B8B412021E52D0900BA89B3 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4B8B411E21E52D0900BA89B3 /* LaunchScreen.storyboard */; }; + 4BF977FC21E6DAC400E6231C /* ItemsController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BF977FB21E6DAC400E6231C /* ItemsController.swift */; }; + 4BF9783021E7E70C00E6231C /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4BF9782E21E7E70C00E6231C /* LaunchScreen.storyboard */; }; + 4BF9783121E7E70C00E6231C /* LambdaLogoAssets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4BF9782F21E7E70C00E6231C /* LambdaLogoAssets.xcassets */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 4B4A793821E57D4000AD245A /* Item.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Item.swift; sourceTree = ""; }; + 4B8B411221E52D0800BA89B3 /* List.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = List.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 4B8B411521E52D0800BA89B3 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 4B8B411721E52D0800BA89B3 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 4B8B411A21E52D0800BA89B3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 4B8B411C21E52D0900BA89B3 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 4B8B411F21E52D0900BA89B3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 4B8B412121E52D0900BA89B3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 4BF977FB21E6DAC400E6231C /* ItemsController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ItemsController.swift; sourceTree = ""; }; + 4BF9782E21E7E70C00E6231C /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = ""; }; + 4BF9782F21E7E70C00E6231C /* LambdaLogoAssets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = LambdaLogoAssets.xcassets; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 4B8B410F21E52D0800BA89B3 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 4B8B410921E52D0800BA89B3 = { + isa = PBXGroup; + children = ( + 4B8B411421E52D0800BA89B3 /* List */, + 4B8B411321E52D0800BA89B3 /* Products */, + ); + sourceTree = ""; + }; + 4B8B411321E52D0800BA89B3 /* Products */ = { + isa = PBXGroup; + children = ( + 4B8B411221E52D0800BA89B3 /* List.app */, + ); + name = Products; + sourceTree = ""; + }; + 4B8B411421E52D0800BA89B3 /* List */ = { + isa = PBXGroup; + children = ( + 4B8B411521E52D0800BA89B3 /* AppDelegate.swift */, + 4BF9782921E7E6D500E6231C /* Model */, + 4BF9782A21E7E6DA00E6231C /* Controller */, + 4BF9782B21E7E6E000E6231C /* View Controller */, + 4BF9782C21E7E6E800E6231C /* Storyboards */, + 4B8B411C21E52D0900BA89B3 /* Assets.xcassets */, + 4BF9782D21E7E70C00E6231C /* DragAndDropLaunchScreen */, + 4B8B412121E52D0900BA89B3 /* Info.plist */, + ); + path = List; + sourceTree = ""; + }; + 4BF9782921E7E6D500E6231C /* Model */ = { + isa = PBXGroup; + children = ( + 4B4A793821E57D4000AD245A /* Item.swift */, + ); + path = Model; + sourceTree = ""; + }; + 4BF9782A21E7E6DA00E6231C /* Controller */ = { + isa = PBXGroup; + children = ( + 4BF977FB21E6DAC400E6231C /* ItemsController.swift */, + ); + path = Controller; + sourceTree = ""; + }; + 4BF9782B21E7E6E000E6231C /* View Controller */ = { + isa = PBXGroup; + children = ( + 4B8B411721E52D0800BA89B3 /* ViewController.swift */, + ); + path = "View Controller"; + sourceTree = ""; + }; + 4BF9782C21E7E6E800E6231C /* Storyboards */ = { + isa = PBXGroup; + children = ( + 4B8B411E21E52D0900BA89B3 /* LaunchScreen.storyboard */, + 4B8B411921E52D0800BA89B3 /* Main.storyboard */, + ); + path = Storyboards; + sourceTree = ""; + }; + 4BF9782D21E7E70C00E6231C /* DragAndDropLaunchScreen */ = { + isa = PBXGroup; + children = ( + 4BF9782E21E7E70C00E6231C /* LaunchScreen.storyboard */, + 4BF9782F21E7E70C00E6231C /* LambdaLogoAssets.xcassets */, + ); + path = DragAndDropLaunchScreen; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 4B8B411121E52D0800BA89B3 /* List */ = { + isa = PBXNativeTarget; + buildConfigurationList = 4B8B412421E52D0900BA89B3 /* Build configuration list for PBXNativeTarget "List" */; + buildPhases = ( + 4B8B410E21E52D0800BA89B3 /* Sources */, + 4B8B410F21E52D0800BA89B3 /* Frameworks */, + 4B8B411021E52D0800BA89B3 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = List; + productName = List; + productReference = 4B8B411221E52D0800BA89B3 /* List.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 4B8B410A21E52D0800BA89B3 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1010; + LastUpgradeCheck = 1010; + ORGANIZATIONNAME = "Paul Yi"; + TargetAttributes = { + 4B8B411121E52D0800BA89B3 = { + CreatedOnToolsVersion = 10.1; + }; + }; + }; + buildConfigurationList = 4B8B410D21E52D0800BA89B3 /* Build configuration list for PBXProject "List" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 4B8B410921E52D0800BA89B3; + productRefGroup = 4B8B411321E52D0800BA89B3 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 4B8B411121E52D0800BA89B3 /* List */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 4B8B411021E52D0800BA89B3 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 4BF9783121E7E70C00E6231C /* LambdaLogoAssets.xcassets in Resources */, + 4B8B412021E52D0900BA89B3 /* LaunchScreen.storyboard in Resources */, + 4BF9783021E7E70C00E6231C /* LaunchScreen.storyboard in Resources */, + 4B8B411D21E52D0900BA89B3 /* Assets.xcassets in Resources */, + 4B8B411B21E52D0800BA89B3 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 4B8B410E21E52D0800BA89B3 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 4B4A793921E57D4000AD245A /* Item.swift in Sources */, + 4B8B411821E52D0800BA89B3 /* ViewController.swift in Sources */, + 4BF977FC21E6DAC400E6231C /* ItemsController.swift in Sources */, + 4B8B411621E52D0800BA89B3 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 4B8B411921E52D0800BA89B3 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 4B8B411A21E52D0800BA89B3 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 4B8B411E21E52D0900BA89B3 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 4B8B411F21E52D0900BA89B3 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 4B8B412221E52D0900BA89B3 /* 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++14"; + CLANG_CXX_LIBRARY = "libc++"; + 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_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; + CODE_SIGN_IDENTITY = "iPhone Developer"; + 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 = 12.1; + 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; + }; + 4B8B412321E52D0900BA89B3 /* 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++14"; + CLANG_CXX_LIBRARY = "libc++"; + 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_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; + CODE_SIGN_IDENTITY = "iPhone Developer"; + 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 = 12.1; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 4B8B412521E52D0900BA89B3 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 6Z7SV6KDUH; + INFOPLIST_FILE = List/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.paulyi.List; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 4B8B412621E52D0900BA89B3 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 6Z7SV6KDUH; + INFOPLIST_FILE = List/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.paulyi.List; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 4B8B410D21E52D0800BA89B3 /* Build configuration list for PBXProject "List" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 4B8B412221E52D0900BA89B3 /* Debug */, + 4B8B412321E52D0900BA89B3 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 4B8B412421E52D0900BA89B3 /* Build configuration list for PBXNativeTarget "List" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 4B8B412521E52D0900BA89B3 /* Debug */, + 4B8B412621E52D0900BA89B3 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 4B8B410A21E52D0800BA89B3 /* Project object */; +} diff --git a/List/List.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/List/List.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..1119a07 --- /dev/null +++ b/List/List.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/List/List.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/List/List.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/List/List.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/List/List.xcodeproj/project.xcworkspace/xcuserdata/paulyi.xcuserdatad/UserInterfaceState.xcuserstate b/List/List.xcodeproj/project.xcworkspace/xcuserdata/paulyi.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..69aa238 Binary files /dev/null and b/List/List.xcodeproj/project.xcworkspace/xcuserdata/paulyi.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/List/List.xcodeproj/xcuserdata/paulyi.xcuserdatad/xcschemes/xcschememanagement.plist b/List/List.xcodeproj/xcuserdata/paulyi.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..7c17791 --- /dev/null +++ b/List/List.xcodeproj/xcuserdata/paulyi.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + List.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/List/List/AppDelegate.swift b/List/List/AppDelegate.swift new file mode 100644 index 0000000..101e811 --- /dev/null +++ b/List/List/AppDelegate.swift @@ -0,0 +1,15 @@ +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + + return true + } + +} + diff --git a/List/List/Assets.xcassets/AppIcon.appiconset/Contents.json b/List/List/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..d8db8d6 --- /dev/null +++ b/List/List/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/List/List/Assets.xcassets/Contents.json b/List/List/Assets.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/List/List/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/List/List/Controller/ItemsController.swift b/List/List/Controller/ItemsController.swift new file mode 100644 index 0000000..657e001 --- /dev/null +++ b/List/List/Controller/ItemsController.swift @@ -0,0 +1,13 @@ +import Foundation + +class ItemsController { + var items: [String] = [] + + func add(_ item: String) { + items.append(item) + } + + func resetItems() { + items.removeAll() + } +} diff --git a/List/List/DragAndDropLaunchScreen/LambdaLogoAssets.xcassets/Contents.json b/List/List/DragAndDropLaunchScreen/LambdaLogoAssets.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/List/List/DragAndDropLaunchScreen/LambdaLogoAssets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/List/List/DragAndDropLaunchScreen/LambdaLogoAssets.xcassets/Lambda_Logo_Full.imageset/Contents.json b/List/List/DragAndDropLaunchScreen/LambdaLogoAssets.xcassets/Lambda_Logo_Full.imageset/Contents.json new file mode 100644 index 0000000..a8c4d08 --- /dev/null +++ b/List/List/DragAndDropLaunchScreen/LambdaLogoAssets.xcassets/Lambda_Logo_Full.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "Lambda_Logo_Full.pdf", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "Lambda_Logo_Full-1.pdf", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "Lambda_Logo_Full-2.pdf", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/List/List/DragAndDropLaunchScreen/LambdaLogoAssets.xcassets/Lambda_Logo_Full.imageset/Lambda_Logo_Full-1.pdf b/List/List/DragAndDropLaunchScreen/LambdaLogoAssets.xcassets/Lambda_Logo_Full.imageset/Lambda_Logo_Full-1.pdf new file mode 100644 index 0000000..3a8651d Binary files /dev/null and b/List/List/DragAndDropLaunchScreen/LambdaLogoAssets.xcassets/Lambda_Logo_Full.imageset/Lambda_Logo_Full-1.pdf differ diff --git a/List/List/DragAndDropLaunchScreen/LambdaLogoAssets.xcassets/Lambda_Logo_Full.imageset/Lambda_Logo_Full-2.pdf b/List/List/DragAndDropLaunchScreen/LambdaLogoAssets.xcassets/Lambda_Logo_Full.imageset/Lambda_Logo_Full-2.pdf new file mode 100644 index 0000000..3a8651d Binary files /dev/null and b/List/List/DragAndDropLaunchScreen/LambdaLogoAssets.xcassets/Lambda_Logo_Full.imageset/Lambda_Logo_Full-2.pdf differ diff --git a/List/List/DragAndDropLaunchScreen/LambdaLogoAssets.xcassets/Lambda_Logo_Full.imageset/Lambda_Logo_Full.pdf b/List/List/DragAndDropLaunchScreen/LambdaLogoAssets.xcassets/Lambda_Logo_Full.imageset/Lambda_Logo_Full.pdf new file mode 100644 index 0000000..3a8651d Binary files /dev/null and b/List/List/DragAndDropLaunchScreen/LambdaLogoAssets.xcassets/Lambda_Logo_Full.imageset/Lambda_Logo_Full.pdf differ diff --git a/List/List/DragAndDropLaunchScreen/LaunchScreen.storyboard b/List/List/DragAndDropLaunchScreen/LaunchScreen.storyboard new file mode 100644 index 0000000..d742ae9 --- /dev/null +++ b/List/List/DragAndDropLaunchScreen/LaunchScreen.storyboard @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/List/List/Info.plist b/List/List/Info.plist new file mode 100644 index 0000000..16be3b6 --- /dev/null +++ b/List/List/Info.plist @@ -0,0 +1,45 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/List/List/Model/Item.swift b/List/List/Model/Item.swift new file mode 100644 index 0000000..b242269 --- /dev/null +++ b/List/List/Model/Item.swift @@ -0,0 +1,5 @@ +import Foundation + +struct Item { + var name: String +} diff --git a/List/List/Storyboards/Base.lproj/LaunchScreen.storyboard b/List/List/Storyboards/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..bfa3612 --- /dev/null +++ b/List/List/Storyboards/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/List/List/Storyboards/Base.lproj/Main.storyboard b/List/List/Storyboards/Base.lproj/Main.storyboard new file mode 100644 index 0000000..b214e2a --- /dev/null +++ b/List/List/Storyboards/Base.lproj/Main.storyboard @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/List/List/View Controller/ViewController.swift b/List/List/View Controller/ViewController.swift new file mode 100644 index 0000000..abdefd7 --- /dev/null +++ b/List/List/View Controller/ViewController.swift @@ -0,0 +1,38 @@ +import UIKit + +class ViewController: UIViewController { + @IBOutlet var textField: UITextField! + @IBOutlet var textView: UITextView! + + let itemsController = ItemsController() + + override func viewDidLoad() { + super.viewDidLoad() + } + + @IBAction func shouldAdd(_ sender: Any) { + let text = textField.text ?? "" + guard !text.isEmpty else { return } + itemsController.add("∙ \(text)") + textField.text = "" + let updatedTextView = itemsController.items.joined(separator: "\n") + textView.text = updatedTextView + } + + @IBAction func shouldReset(_ sender: Any) { + itemsController.resetItems() + textView.text = "" + } + + @IBAction func printList(_ sender: Any) { + if itemsController.items.isEmpty { + print("There are no items") + } else { + print(itemsController.items) + } + + } + + +} +