From eb653326d9396e1a5583c7cc759cea56ecba5589 Mon Sep 17 00:00:00 2001 From: Blandine RUMEAU Date: Thu, 25 Feb 2016 19:32:20 +0000 Subject: [PATCH 1/3] The Fibonnaci Number: Done --- .gitignore | 41 +++ Farmdrop.xcodeproj/project.pbxproj | 298 ++++++++++++++++++ Farmdrop/AppDelegate.h | 17 + Farmdrop/AppDelegate.m | 45 +++ .../AppIcon.appiconset/Contents.json | 44 +++ .../AppIcon.appiconset/Icon-40@2x.png | Bin 0 -> 218 bytes .../AppIcon.appiconset/Icon-40@3x.png | Bin 0 -> 290 bytes .../AppIcon.appiconset/Icon-60@2x.png | Bin 0 -> 290 bytes .../AppIcon.appiconset/Icon-60@3x.png | Bin 0 -> 442 bytes .../AppIcon.appiconset/Icon-Small@2x.png | Bin 0 -> 183 bytes .../AppIcon.appiconset/Icon-Small@3x.png | Bin 0 -> 240 bytes Farmdrop/Assets.xcassets/Contents.json | 6 + Farmdrop/Base.lproj/LaunchScreen.storyboard | 56 ++++ Farmdrop/Base.lproj/Main.storyboard | 62 ++++ Farmdrop/Info.plist | 44 +++ Farmdrop/ViewController.h | 14 + Farmdrop/ViewController.m | 81 +++++ Farmdrop/main.m | 16 + 18 files changed, 724 insertions(+) create mode 100644 .gitignore create mode 100644 Farmdrop.xcodeproj/project.pbxproj create mode 100644 Farmdrop/AppDelegate.h create mode 100644 Farmdrop/AppDelegate.m create mode 100644 Farmdrop/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 Farmdrop/Assets.xcassets/AppIcon.appiconset/Icon-40@2x.png create mode 100644 Farmdrop/Assets.xcassets/AppIcon.appiconset/Icon-40@3x.png create mode 100644 Farmdrop/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png create mode 100644 Farmdrop/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png create mode 100644 Farmdrop/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png create mode 100644 Farmdrop/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png create mode 100644 Farmdrop/Assets.xcassets/Contents.json create mode 100644 Farmdrop/Base.lproj/LaunchScreen.storyboard create mode 100644 Farmdrop/Base.lproj/Main.storyboard create mode 100644 Farmdrop/Info.plist create mode 100644 Farmdrop/ViewController.h create mode 100644 Farmdrop/ViewController.m create mode 100644 Farmdrop/main.m diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8f25351 --- /dev/null +++ b/.gitignore @@ -0,0 +1,41 @@ +# Xcode # +######### + +build/* +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +project.xcworkspace +xcuserdata +profile +*.moved-aside +Products/ +lib/ +*.xcscmblueprint + +# Mac OSX # +########### + +.DS_Store +# Thumbnails +._* +# Files that might appear on external disk +.Spotlight-V100 +.Trashes + +# Windows # +########### + +# Windows image file caches +Thumbs.db +# Folder config file +Desktop.ini + +# Build Folder # +################ +build/ diff --git a/Farmdrop.xcodeproj/project.pbxproj b/Farmdrop.xcodeproj/project.pbxproj new file mode 100644 index 0000000..63d4023 --- /dev/null +++ b/Farmdrop.xcodeproj/project.pbxproj @@ -0,0 +1,298 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 2C267E911C7F5FFD0028BEE6 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 2C267E901C7F5FFD0028BEE6 /* AppDelegate.m */; }; + 2C267E971C7F5FFD0028BEE6 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2C267E951C7F5FFD0028BEE6 /* Main.storyboard */; }; + 2C267E991C7F5FFD0028BEE6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2C267E981C7F5FFD0028BEE6 /* Assets.xcassets */; }; + 2C267E9C1C7F5FFD0028BEE6 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2C267E9A1C7F5FFD0028BEE6 /* LaunchScreen.storyboard */; }; + 2CA254B11C7F6AED005E428F /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2CA254B01C7F6AED005E428F /* ViewController.m */; }; + 2CBFBE0D1C7F7A35000DDFD5 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 2CBFBE0C1C7F7A35000DDFD5 /* main.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 2C267E891C7F5FFD0028BEE6 /* Farmdrop.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Farmdrop.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 2C267E8F1C7F5FFD0028BEE6 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 2C267E901C7F5FFD0028BEE6 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 2C267E961C7F5FFD0028BEE6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 2C267E981C7F5FFD0028BEE6 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 2C267E9B1C7F5FFD0028BEE6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 2C267E9D1C7F5FFD0028BEE6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 2CA254AF1C7F6AED005E428F /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 2CA254B01C7F6AED005E428F /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 2CBFBE0C1C7F7A35000DDFD5 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 2C267E861C7F5FFC0028BEE6 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 2C267E801C7F5FFC0028BEE6 = { + isa = PBXGroup; + children = ( + 2C267E8B1C7F5FFD0028BEE6 /* Farmdrop */, + 2C267E8A1C7F5FFD0028BEE6 /* Products */, + ); + sourceTree = ""; + }; + 2C267E8A1C7F5FFD0028BEE6 /* Products */ = { + isa = PBXGroup; + children = ( + 2C267E891C7F5FFD0028BEE6 /* Farmdrop.app */, + ); + name = Products; + sourceTree = ""; + }; + 2C267E8B1C7F5FFD0028BEE6 /* Farmdrop */ = { + isa = PBXGroup; + children = ( + 2CBFBE0C1C7F7A35000DDFD5 /* main.m */, + 2C267E8F1C7F5FFD0028BEE6 /* AppDelegate.h */, + 2C267E901C7F5FFD0028BEE6 /* AppDelegate.m */, + 2C267E9A1C7F5FFD0028BEE6 /* LaunchScreen.storyboard */, + 2C267E951C7F5FFD0028BEE6 /* Main.storyboard */, + 2CA254AF1C7F6AED005E428F /* ViewController.h */, + 2CA254B01C7F6AED005E428F /* ViewController.m */, + 2C267E981C7F5FFD0028BEE6 /* Assets.xcassets */, + 2C267E9D1C7F5FFD0028BEE6 /* Info.plist */, + ); + path = Farmdrop; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 2C267E881C7F5FFC0028BEE6 /* Farmdrop */ = { + isa = PBXNativeTarget; + buildConfigurationList = 2C267EAB1C7F5FFE0028BEE6 /* Build configuration list for PBXNativeTarget "Farmdrop" */; + buildPhases = ( + 2C267E851C7F5FFC0028BEE6 /* Sources */, + 2C267E861C7F5FFC0028BEE6 /* Frameworks */, + 2C267E871C7F5FFC0028BEE6 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Farmdrop; + productName = Farmdrop; + productReference = 2C267E891C7F5FFD0028BEE6 /* Farmdrop.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 2C267E811C7F5FFC0028BEE6 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0720; + ORGANIZATIONNAME = blandinerumeau; + TargetAttributes = { + 2C267E881C7F5FFC0028BEE6 = { + CreatedOnToolsVersion = 7.2.1; + }; + }; + }; + buildConfigurationList = 2C267E841C7F5FFC0028BEE6 /* Build configuration list for PBXProject "Farmdrop" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 2C267E801C7F5FFC0028BEE6; + productRefGroup = 2C267E8A1C7F5FFD0028BEE6 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 2C267E881C7F5FFC0028BEE6 /* Farmdrop */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 2C267E871C7F5FFC0028BEE6 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2C267E9C1C7F5FFD0028BEE6 /* LaunchScreen.storyboard in Resources */, + 2C267E991C7F5FFD0028BEE6 /* Assets.xcassets in Resources */, + 2C267E971C7F5FFD0028BEE6 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 2C267E851C7F5FFC0028BEE6 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2CA254B11C7F6AED005E428F /* ViewController.m in Sources */, + 2CBFBE0D1C7F7A35000DDFD5 /* main.m in Sources */, + 2C267E911C7F5FFD0028BEE6 /* AppDelegate.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 2C267E951C7F5FFD0028BEE6 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 2C267E961C7F5FFD0028BEE6 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 2C267E9A1C7F5FFD0028BEE6 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 2C267E9B1C7F5FFD0028BEE6 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 2C267EA91C7F5FFE0028BEE6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + 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 = 9.2; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 2C267EAA1C7F5FFE0028BEE6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "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 = gnu99; + 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 = 9.2; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 2C267EAC1C7F5FFE0028BEE6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = Farmdrop/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.blandinerumeau.Farmdrop; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 2C267EAD1C7F5FFE0028BEE6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = Farmdrop/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.blandinerumeau.Farmdrop; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 2C267E841C7F5FFC0028BEE6 /* Build configuration list for PBXProject "Farmdrop" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2C267EA91C7F5FFE0028BEE6 /* Debug */, + 2C267EAA1C7F5FFE0028BEE6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 2C267EAB1C7F5FFE0028BEE6 /* Build configuration list for PBXNativeTarget "Farmdrop" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2C267EAC1C7F5FFE0028BEE6 /* Debug */, + 2C267EAD1C7F5FFE0028BEE6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 2C267E811C7F5FFC0028BEE6 /* Project object */; +} diff --git a/Farmdrop/AppDelegate.h b/Farmdrop/AppDelegate.h new file mode 100644 index 0000000..6519284 --- /dev/null +++ b/Farmdrop/AppDelegate.h @@ -0,0 +1,17 @@ +// +// AppDelegate.h +// Farmdrop +// +// Created by Blandine Rumeau on 25/02/2016. +// Copyright © 2016 blandinerumeau. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + + +@end + diff --git a/Farmdrop/AppDelegate.m b/Farmdrop/AppDelegate.m new file mode 100644 index 0000000..d9eaf6b --- /dev/null +++ b/Farmdrop/AppDelegate.m @@ -0,0 +1,45 @@ +// +// AppDelegate.m +// Farmdrop +// +// Created by Blandine Rumeau on 25/02/2016. +// Copyright © 2016 blandinerumeau. All rights reserved. +// + +#import "AppDelegate.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + // Override point for customization after application launch. + return YES; +} + +- (void)applicationWillResignActive:(UIApplication *)application { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. +} + +- (void)applicationDidEnterBackground:(UIApplication *)application { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. +} + +- (void)applicationWillEnterForeground:(UIApplication *)application { + // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. +} + +- (void)applicationDidBecomeActive:(UIApplication *)application { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. +} + +- (void)applicationWillTerminate:(UIApplication *)application { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. +} + +@end diff --git a/Farmdrop/Assets.xcassets/AppIcon.appiconset/Contents.json b/Farmdrop/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..7b28cc5 --- /dev/null +++ b/Farmdrop/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,44 @@ +{ + "images" : [ + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-Small@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-Small@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-60@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Farmdrop/Assets.xcassets/AppIcon.appiconset/Icon-40@2x.png b/Farmdrop/Assets.xcassets/AppIcon.appiconset/Icon-40@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..05e84f6417a65fb853443f7d94572982ac9f0791 GIT binary patch literal 218 zcmeAS@N?(olHy`uVBq!ia0vp^0U*r51SA=YQ-1*|wj^(N7l!{JxM1({$v_d#0*}aI z1_o|n5N2eUHAey{$X?><>&pIsNm4+UWB;^nkj`{Z7srr_TW`-ZGBOx&FfaIdFU)wh mt)9t(s-jcgEv-}n|2MWwX1v|^($fWKC4;A{pUXO@geCyLhfeSS literal 0 HcmV?d00001 diff --git a/Farmdrop/Assets.xcassets/AppIcon.appiconset/Icon-40@3x.png b/Farmdrop/Assets.xcassets/AppIcon.appiconset/Icon-40@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..adaf13da87176a7f2db9c1faa89dc7393f5e08ca GIT binary patch literal 290 zcmeAS@N?(olHy`uVBq!ia0vp^6(G#P1SGeyEo=o+Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPNlca#Iu<2(fF`&?TPZ!6Kid%0l7&0<2urL^W3G+46 zt=PtKdfo#EO#xl0i;G;9qf8dLcDrrKaOoE7&A8Yh1`-w21&Jz0fkc5)KvAF+P?V+` bUet3txie`$*tb;+=yV28S3j3^P6x`7I;J! zGca%qgD@k*tT_@uLG}_)Usv`AOp*e+%EDSjyBHW4-923#Ln>~)z2qp!z`(-b_$AEO zjJ4)(nev^OZ!B}Xn9ej>8n8b*ATxuxIDrqyL9n301QirFpqgO74l@g8FouF>3=qp; z3KIAbEQoy=3eGShITEZI>|7*$7z$=E6LdSe0vv9CaGFW$8`EOnX*yehq0Hdv>gTe~ HDWM4fRKS>e literal 0 HcmV?d00001 diff --git a/Farmdrop/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png b/Farmdrop/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..3a1fd8366e3d7a37a5d1f333337fc389a4e69526 GIT binary patch literal 183 zcmeAS@N?(olHy`uVBq!ia0vp^Rv^s51SIor-mM2xY)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPNlca#IPV>}!ZJ>~gr;B4q#=W=a7qH)b6>n72GkY4eZ;u_(2YoOpm_|Qu6{1-oD!MA$DnRsn@-JzX3_DsH{K;K<0pz`|niWnb1N x&xhMxBhtGA6Am`9a*OFiY@m?QfWwrELW7@-FE77{Z~;1m!PC{xWt~$(6984=Nd*7^ literal 0 HcmV?d00001 diff --git a/Farmdrop/Assets.xcassets/Contents.json b/Farmdrop/Assets.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/Farmdrop/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Farmdrop/Base.lproj/LaunchScreen.storyboard b/Farmdrop/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..d82da0b --- /dev/null +++ b/Farmdrop/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Farmdrop/Base.lproj/Main.storyboard b/Farmdrop/Base.lproj/Main.storyboard new file mode 100644 index 0000000..f8c8df9 --- /dev/null +++ b/Farmdrop/Base.lproj/Main.storyboard @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Farmdrop/Info.plist b/Farmdrop/Info.plist new file mode 100644 index 0000000..10d0e20 --- /dev/null +++ b/Farmdrop/Info.plist @@ -0,0 +1,44 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 201602251920 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UIStatusBarStyle + UIStatusBarStyleLightContent + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeRight + UIInterfaceOrientationLandscapeLeft + + UIViewControllerBasedStatusBarAppearance + + + diff --git a/Farmdrop/ViewController.h b/Farmdrop/ViewController.h new file mode 100644 index 0000000..3ed4c47 --- /dev/null +++ b/Farmdrop/ViewController.h @@ -0,0 +1,14 @@ +// +// ViewController.h +// Farmdrop +// +// Created by Blandine Rumeau on 25/02/2016. +// Copyright © 2016 blandinerumeau. All rights reserved. +// + +#import + +@interface ViewController : UITableViewController + +@end + diff --git a/Farmdrop/ViewController.m b/Farmdrop/ViewController.m new file mode 100644 index 0000000..c11c11f --- /dev/null +++ b/Farmdrop/ViewController.m @@ -0,0 +1,81 @@ +// +// ViewController.m +// Farmdrop +// +// Created by Blandine Rumeau on 25/02/2016. +// Copyright © 2016 blandinerumeau. All rights reserved. +// + +#import "ViewController.h" + +#define MAX_N_POSSIBLE_ON_AN_IPHONE_WITH_UNSIGNED_INTEGERS 93 + +@interface ViewController () + @property (nonatomic, strong) NSMutableArray *fnList; +@end + +@implementation ViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + self.fnList = [NSMutableArray new]; +} + +#pragma mark - Fibonacci method + ++ (void)fibonacciNumberForNumber:(NSUInteger)n completion:(void (^)(NSUInteger fn))completion { + + NSUInteger first = 0; + NSUInteger second = 1; + NSUInteger tmp = 0; + + while (n--) { + tmp = first + second; + first = second; + second = tmp; + } + if (completion) { + completion(first); + } +} + +#pragma mark - UItableViewDataSource + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + return MAX_N_POSSIBLE_ON_AN_IPHONE_WITH_UNSIGNED_INTEGERS; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + + NSInteger index = indexPath.row; + + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"]; + cell.tag = index; + + __block NSString *string = nil; + + // Try to retrieve the Fibonacci number in the fnList + if (self.fnList.count > index) { + cell.textLabel.text = [self.fnList objectAtIndex:index]; + } + // If not found, we have to calculate it before storage it in the fnList + else { + [[self class] fibonacciNumberForNumber:index completion:^(NSUInteger fn) { + + dispatch_async(dispatch_get_main_queue(), ^{ + + // Just check the cell tag to put the result in the good cell + if (cell.tag == index) { + + string = [NSString stringWithFormat:@"%ld", fn]; + cell.textLabel.text = string; + [self.fnList addObject:string]; + } + }); + }]; + } + + return cell; +} + +@end diff --git a/Farmdrop/main.m b/Farmdrop/main.m new file mode 100644 index 0000000..cebd3cc --- /dev/null +++ b/Farmdrop/main.m @@ -0,0 +1,16 @@ +// +// main.m +// Farmdrop +// +// Created by Blandine Rumeau on 25/02/2016. +// Copyright © 2016 blandinerumeau. All rights reserved. +// + +#import +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} From 89396285802d2201253f80dfc2aaa646a8c1e235 Mon Sep 17 00:00:00 2001 From: Blandine RUMEAU Date: Thu, 25 Feb 2016 19:39:05 +0000 Subject: [PATCH 2/3] README file modification --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 92789ff..956f0e4 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,13 @@ +Hi guys, + +Here is my job. +Thank you for this coding challenge, it was very interesting and I had fun to work on it. +Feel free to contact me if you need any information on my project. + +Cheers, +Blandine + + # ios-code-test We'd like you to create a very simple app: From 13e436aa006111bd6a53b131c4a8c6149d928bfa Mon Sep 17 00:00:00 2001 From: Blandine RUMEAU Date: Fri, 26 Feb 2016 08:58:09 +0000 Subject: [PATCH 3/3] add information in README file --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 956f0e4..69e7676 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ Hi guys, Here is my job. +I set the max n possible on an iPhone with unsigned integers "manually", to 93. Thank you for this coding challenge, it was very interesting and I had fun to work on it. Feel free to contact me if you need any information on my project.