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 0000000..05e84f6 Binary files /dev/null and b/Farmdrop/Assets.xcassets/AppIcon.appiconset/Icon-40@2x.png differ 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 0000000..adaf13d Binary files /dev/null and b/Farmdrop/Assets.xcassets/AppIcon.appiconset/Icon-40@3x.png differ diff --git a/Farmdrop/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png b/Farmdrop/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png new file mode 100644 index 0000000..b8daf31 Binary files /dev/null and b/Farmdrop/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png differ diff --git a/Farmdrop/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png b/Farmdrop/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png new file mode 100644 index 0000000..3605ece Binary files /dev/null and b/Farmdrop/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png differ 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 0000000..3a1fd83 Binary files /dev/null and b/Farmdrop/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png differ diff --git a/Farmdrop/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png b/Farmdrop/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png new file mode 100644 index 0000000..d6a0d3b Binary files /dev/null and b/Farmdrop/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png differ 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])); + } +} diff --git a/README.md b/README.md index 92789ff..69e7676 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,14 @@ +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. + +Cheers, +Blandine + + # ios-code-test We'd like you to create a very simple app: