diff --git b/Generala.xcodeproj/project.pbxproj a/Generala.xcodeproj/project.pbxproj new file mode 100644 index 0000000..39e10e0 --- /dev/null +++ a/Generala.xcodeproj/project.pbxproj @@ -0,0 +1,345 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + B1D28AB024443694007223B4 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1D28AAF24443694007223B4 /* AppDelegate.swift */; }; + B1D28AB224443694007223B4 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1D28AB124443694007223B4 /* SceneDelegate.swift */; }; + B1D28AB424443694007223B4 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1D28AB324443694007223B4 /* ViewController.swift */; }; + B1D28AB724443694007223B4 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B1D28AB524443694007223B4 /* Main.storyboard */; }; + B1D28AB924443697007223B4 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B1D28AB824443697007223B4 /* Assets.xcassets */; }; + B1D28ABC24443697007223B4 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B1D28ABA24443697007223B4 /* LaunchScreen.storyboard */; }; + B1D28AC4244436B3007223B4 /* Generala.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1D28AC3244436B3007223B4 /* Generala.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + B1D28AAC24443694007223B4 /* Generala.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Generala.app; sourceTree = BUILT_PRODUCTS_DIR; }; + B1D28AAF24443694007223B4 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + B1D28AB124443694007223B4 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + B1D28AB324443694007223B4 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + B1D28AB624443694007223B4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + B1D28AB824443697007223B4 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + B1D28ABB24443697007223B4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + B1D28ABD24443697007223B4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + B1D28AC3244436B3007223B4 /* Generala.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Generala.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + B1D28AA924443694007223B4 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + B1D28AA324443694007223B4 = { + isa = PBXGroup; + children = ( + B1D28AAE24443694007223B4 /* Generala */, + B1D28AAD24443694007223B4 /* Products */, + ); + sourceTree = ""; + }; + B1D28AAD24443694007223B4 /* Products */ = { + isa = PBXGroup; + children = ( + B1D28AAC24443694007223B4 /* Generala.app */, + ); + name = Products; + sourceTree = ""; + }; + B1D28AAE24443694007223B4 /* Generala */ = { + isa = PBXGroup; + children = ( + B1D28AAF24443694007223B4 /* AppDelegate.swift */, + B1D28AB124443694007223B4 /* SceneDelegate.swift */, + B1D28AB324443694007223B4 /* ViewController.swift */, + B1D28AB524443694007223B4 /* Main.storyboard */, + B1D28AB824443697007223B4 /* Assets.xcassets */, + B1D28ABA24443697007223B4 /* LaunchScreen.storyboard */, + B1D28ABD24443697007223B4 /* Info.plist */, + B1D28AC3244436B3007223B4 /* Generala.swift */, + ); + path = Generala; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + B1D28AAB24443694007223B4 /* Generala */ = { + isa = PBXNativeTarget; + buildConfigurationList = B1D28AC024443697007223B4 /* Build configuration list for PBXNativeTarget "Generala" */; + buildPhases = ( + B1D28AA824443694007223B4 /* Sources */, + B1D28AA924443694007223B4 /* Frameworks */, + B1D28AAA24443694007223B4 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Generala; + productName = Generala; + productReference = B1D28AAC24443694007223B4 /* Generala.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + B1D28AA424443694007223B4 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1110; + LastUpgradeCheck = 1110; + ORGANIZATIONNAME = "Nicolas Gauna"; + TargetAttributes = { + B1D28AAB24443694007223B4 = { + CreatedOnToolsVersion = 11.1; + }; + }; + }; + buildConfigurationList = B1D28AA724443694007223B4 /* Build configuration list for PBXProject "Generala" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = B1D28AA324443694007223B4; + productRefGroup = B1D28AAD24443694007223B4 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + B1D28AAB24443694007223B4 /* Generala */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + B1D28AAA24443694007223B4 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B1D28ABC24443697007223B4 /* LaunchScreen.storyboard in Resources */, + B1D28AB924443697007223B4 /* Assets.xcassets in Resources */, + B1D28AB724443694007223B4 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + B1D28AA824443694007223B4 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B1D28AC4244436B3007223B4 /* Generala.swift in Sources */, + B1D28AB424443694007223B4 /* ViewController.swift in Sources */, + B1D28AB024443694007223B4 /* AppDelegate.swift in Sources */, + B1D28AB224443694007223B4 /* SceneDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + B1D28AB524443694007223B4 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + B1D28AB624443694007223B4 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + B1D28ABA24443697007223B4 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + B1D28ABB24443697007223B4 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + B1D28ABE24443697007223B4 /* 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; + 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 = 13.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; + }; + B1D28ABF24443697007223B4 /* 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; + 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 = 13.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; + }; + B1D28AC124443697007223B4 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = Generala/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.gauna.Generala; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + B1D28AC224443697007223B4 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = Generala/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.gauna.Generala; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + B1D28AA724443694007223B4 /* Build configuration list for PBXProject "Generala" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B1D28ABE24443697007223B4 /* Debug */, + B1D28ABF24443697007223B4 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + B1D28AC024443697007223B4 /* Build configuration list for PBXNativeTarget "Generala" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B1D28AC124443697007223B4 /* Debug */, + B1D28AC224443697007223B4 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = B1D28AA424443694007223B4 /* Project object */; +} diff --git b/Generala.xcodeproj/project.xcworkspace/contents.xcworkspacedata a/Generala.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..f839f8a --- /dev/null +++ a/Generala.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git b/Generala.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist a/Generala.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ a/Generala.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git b/Generala.xcodeproj/project.xcworkspace/xcuserdata/nicolasgauna.xcuserdatad/UserInterfaceState.xcuserstate a/Generala.xcodeproj/project.xcworkspace/xcuserdata/nicolasgauna.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..52d62fe Binary files /dev/null and a/Generala.xcodeproj/project.xcworkspace/xcuserdata/nicolasgauna.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git b/Generala.xcodeproj/xcuserdata/nicolasgauna.xcuserdatad/xcschemes/xcschememanagement.plist a/Generala.xcodeproj/xcuserdata/nicolasgauna.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..e5da5d5 --- /dev/null +++ a/Generala.xcodeproj/xcuserdata/nicolasgauna.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + Generala.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git b/Generala/AppDelegate.swift a/Generala/AppDelegate.swift new file mode 100644 index 0000000..ee8d32b --- /dev/null +++ a/Generala/AppDelegate.swift @@ -0,0 +1,37 @@ +// +// AppDelegate.swift +// Generala +// +// Created by Nicolas Gauna on 4/13/20. +// Copyright © 2020 Nicolas Gauna. All rights reserved. +// + +import UIKit + +@UIApplicationMain +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 b/Generala/Assets.xcassets/1.imageset/1.png a/Generala/Assets.xcassets/1.imageset/1.png new file mode 100644 index 0000000..6e54713 Binary files /dev/null and a/Generala/Assets.xcassets/1.imageset/1.png differ diff --git b/Generala/Assets.xcassets/1.imageset/Contents.json a/Generala/Assets.xcassets/1.imageset/Contents.json new file mode 100644 index 0000000..4f00234 --- /dev/null +++ a/Generala/Assets.xcassets/1.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "1.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git b/Generala/Assets.xcassets/2.imageset/2.png a/Generala/Assets.xcassets/2.imageset/2.png new file mode 100644 index 0000000..bf17056 Binary files /dev/null and a/Generala/Assets.xcassets/2.imageset/2.png differ diff --git b/Generala/Assets.xcassets/2.imageset/Contents.json a/Generala/Assets.xcassets/2.imageset/Contents.json new file mode 100644 index 0000000..e203b28 --- /dev/null +++ a/Generala/Assets.xcassets/2.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "2.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git b/Generala/Assets.xcassets/3.imageset/3.png a/Generala/Assets.xcassets/3.imageset/3.png new file mode 100644 index 0000000..61fa487 Binary files /dev/null and a/Generala/Assets.xcassets/3.imageset/3.png differ diff --git b/Generala/Assets.xcassets/3.imageset/Contents.json a/Generala/Assets.xcassets/3.imageset/Contents.json new file mode 100644 index 0000000..e455e3b --- /dev/null +++ a/Generala/Assets.xcassets/3.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "3.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git b/Generala/Assets.xcassets/4.imageset/4.png a/Generala/Assets.xcassets/4.imageset/4.png new file mode 100644 index 0000000..6c95ac1 Binary files /dev/null and a/Generala/Assets.xcassets/4.imageset/4.png differ diff --git b/Generala/Assets.xcassets/4.imageset/Contents.json a/Generala/Assets.xcassets/4.imageset/Contents.json new file mode 100644 index 0000000..3f98e82 --- /dev/null +++ a/Generala/Assets.xcassets/4.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "4.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git b/Generala/Assets.xcassets/5.imageset/5.png a/Generala/Assets.xcassets/5.imageset/5.png new file mode 100644 index 0000000..dff7f65 Binary files /dev/null and a/Generala/Assets.xcassets/5.imageset/5.png differ diff --git b/Generala/Assets.xcassets/5.imageset/Contents.json a/Generala/Assets.xcassets/5.imageset/Contents.json new file mode 100644 index 0000000..689e0d0 --- /dev/null +++ a/Generala/Assets.xcassets/5.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "5.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git b/Generala/Assets.xcassets/6.imageset/6.png a/Generala/Assets.xcassets/6.imageset/6.png new file mode 100644 index 0000000..5d3202a Binary files /dev/null and a/Generala/Assets.xcassets/6.imageset/6.png differ diff --git b/Generala/Assets.xcassets/6.imageset/Contents.json a/Generala/Assets.xcassets/6.imageset/Contents.json new file mode 100644 index 0000000..155d54e --- /dev/null +++ a/Generala/Assets.xcassets/6.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "6.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git b/Generala/Assets.xcassets/AppIcon.appiconset/Contents.json a/Generala/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..d8db8d6 --- /dev/null +++ a/Generala/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 b/Generala/Assets.xcassets/Contents.json a/Generala/Assets.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ a/Generala/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git b/Generala/Base.lproj/LaunchScreen.storyboard a/Generala/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..865e932 --- /dev/null +++ a/Generala/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git b/Generala/Base.lproj/Main.storyboard a/Generala/Base.lproj/Main.storyboard new file mode 100644 index 0000000..ba7af90 --- /dev/null +++ a/Generala/Base.lproj/Main.storyboard @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git b/Generala/Generala.swift a/Generala/Generala.swift new file mode 100644 index 0000000..af37b71 --- /dev/null +++ a/Generala/Generala.swift @@ -0,0 +1,111 @@ +// +// Generala.swift +// Generala +// +// Created by Nicolas Gauna on 4/13/20. +// Copyright © 2020 Nicolas Gauna. All rights reserved. +// + +import Foundation +class Generala { //Esta es mi clase Generala + var jugadaResultante : String = "" + + func jugada(dados:String) -> String{ + if(generala(dadosTirados: dados)){ jugadaResultante = "generala"} + if(poker(dadosTirados: dados)){ jugadaResultante = "poker"} + if(full(dadosTirados: dados)){ jugadaResultante = "full"} + if(escalera(dadosTirados: dados)){ jugadaResultante = "escalera" } + if(invalido(dadosTirados: dados)){ jugadaResultante = "invalido"} + if(jugadaResultante == ""){jugadaResultante = "Nada"} + return jugadaResultante + } + + + func generala (dadosTirados:String) -> Bool{ + //1. GENERALA + //Todos los dados, con el mismo valor. Ejemplo: 55555 + switch dadosTirados { + case "11111", "22222", "33333", "44444", "55555", "66666" : //Si es igual a uno de estos casos + return true //retornamos true + default: + return false //Si no es igual retornamos false + } + } + + func poker(dadosTirados:String) -> Bool{ + //2. PÓKER + //Cuatro dados con el mismo valor. Ejemplo: 55553 + var bool : Bool = false + var vec : [Int] = [0,0,0,0,0,0,0] + for caracter in dadosTirados{ + switch caracter { + case "1" : vec[1] += 1 + case "2" : vec[2] += 1 + case "3" : vec[3] += 1 + case "4" : vec[4] += 1 + case "5" : vec[5] += 1 + case "6" : vec[6] += 1 + default : vec[0] += 1 + } + } + for i in 1...6{ + if (vec[i] == 4) { bool = true } + } + return bool + } + + func full(dadosTirados:String) -> Bool{ + //3. FULL + //Tres dados con el mismo valor y los otros dos, de un mismo valor + //Ejemplo: 55533 + var bool : Bool = false + var temp : Int + var vec : [Int] = [0,0,0,0,0,0,0] + for caracter in dadosTirados{ + switch caracter { + case "1" : vec[1] += 1 + case "2" : vec[2] += 1 + case "3" : vec[3] += 1 + case "4" : vec[4] += 1 + case "5" : vec[5] += 1 + case "6" : vec[6] += 1 + default : vec[0] += 1 + } + } + for i in 1...6{ + if (vec[i] == 3) { + temp = i + for a in 1...6{ + if (vec[a] == 2 && vec[a] != temp) { bool = true } + } + } + } + + return bool + + } + func escalera(dadosTirados:String) -> Bool{ + //4. ESCALERA + //Los dados, en secuencia: + // a) 12345 + // b) 23456 + // c) 34561 + let dado = String(dadosTirados.sorted()) + switch dado { + case "12345", "23456", "34561", "45612","56123", "61234" : + return true + default: + return false + } + } + + func invalido(dadosTirados:String) -> Bool{ + //6. INVALIDO + //Hay algún valor inválido en los dados ingresados. + var bool : Bool = false + for caracter in dadosTirados{ + if (caracter > "6") { bool = true } else {bool = false} + } + return bool + } +} diff --git b/Generala/Info.plist a/Generala/Info.plist new file mode 100644 index 0000000..2a3483c --- /dev/null +++ a/Generala/Info.plist @@ -0,0 +1,64 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + UISceneStoryboardFile + Main + + + + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git b/Generala/SceneDelegate.swift a/Generala/SceneDelegate.swift new file mode 100644 index 0000000..1180532 --- /dev/null +++ a/Generala/SceneDelegate.swift @@ -0,0 +1,53 @@ +// +// SceneDelegate.swift +// Generala +// +// Created by Nicolas Gauna on 4/13/20. +// Copyright © 2020 Nicolas Gauna. All rights reserved. +// + +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 neccessarily 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 b/Generala/ViewController.swift a/Generala/ViewController.swift new file mode 100644 index 0000000..11a5b86 --- /dev/null +++ a/Generala/ViewController.swift @@ -0,0 +1,82 @@ +// +// ViewController.swift +// Generala +// +// Created by Nicolas Gauna on 4/13/20. +// Copyright © 2020 Nicolas Gauna. All rights reserved. +// + +import UIKit + +class ViewController: UIViewController { + + @IBOutlet weak var imgView1: UIImageView! + @IBOutlet weak var imgView2: UIImageView! + @IBOutlet weak var imgView3: UIImageView! + @IBOutlet weak var imgView4: UIImageView! + @IBOutlet weak var imgView5: UIImageView! + + @IBOutlet weak var lblResultado: UILabel! + @IBOutlet weak var txtFieldDado: UITextField! + var resultadoDado: String = "" + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view. + + } + func aleatorio()->String{ + var rand = 0 + while (rand == 0) { + rand = Int(arc4random_uniform(6)) // numero random en base a 10 + //let rand2 = Int(arc4random()) // numero random + } + return String(rand) + } + + @IBAction func generala(_ sender: Any) { + var numerosParaLasImagenes = ["","","","",""] + if (txtFieldDado.text == "" || txtFieldDado.text == resultadoDado){ + txtFieldDado.text = "" + for i in 0...4{ + let numeroAleatorio = aleatorio() + txtFieldDado.text?.append(numeroAleatorio) + numerosParaLasImagenes[i] = numeroAleatorio + } + } else { + var cont = 0 + var cont2 = ["","","","",""] + if(txtFieldDado.text!.count > 5 || txtFieldDado.text!.count < 5){ + lblResultado.text = "" + return + } + for caracter in txtFieldDado.text!{ + cont2[cont] = String(caracter) + + cont += 1 + } + for i in 0...4{ numerosParaLasImagenes[i] = cont2[i]} + + + } + + imgView1.image = UIImage(named: "\(numerosParaLasImagenes[0]).jpg") + imgView2.image = UIImage(named: "\(numerosParaLasImagenes[1]).jpg") + imgView3.image = UIImage(named: "\(numerosParaLasImagenes[2]).jpg") + imgView4.image = UIImage(named: "\(numerosParaLasImagenes[3]).jpg") + imgView5.image = UIImage(named: "\(numerosParaLasImagenes[4]).jpg") + + resultadoDado = String(txtFieldDado.text!) + let generala = Generala() + let tipoJugada = generala.jugada(dados: resultadoDado) + lblResultado.text = tipoJugada + print("\(resultadoDado) - \(tipoJugada)") + + + } + + + + +} + diff --git b/generala.pdf a/generala.pdf new file mode 100644 index 0000000..1dc1d01 Binary files /dev/null and a/generala.pdf differ