]> Zhao Yanbai Git Server - acecode.git/commitdiff
add foodtracker
authorAceVest <zhaoyanbai@126.com>
Sat, 19 Nov 2016 15:38:08 +0000 (23:38 +0800)
committerAceVest <zhaoyanbai@126.com>
Sat, 19 Nov 2016 15:38:08 +0000 (23:38 +0800)
35 files changed:
learn/AcePlay/AcePlay.playground/playground.xcworkspace/xcuserdata/Ace.xcuserdatad/UserInterfaceState.xcuserstate
learn/FoodTracker/FoodTracker.xcodeproj/project.pbxproj [new file with mode: 0644]
learn/FoodTracker/FoodTracker.xcodeproj/project.xcworkspace/contents.xcworkspacedata [new file with mode: 0644]
learn/FoodTracker/FoodTracker.xcodeproj/project.xcworkspace/xcuserdata/ace.xcuserdatad/UserInterfaceState.xcuserstate [new file with mode: 0644]
learn/FoodTracker/FoodTracker.xcodeproj/xcuserdata/ace.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist [new file with mode: 0644]
learn/FoodTracker/FoodTracker.xcodeproj/xcuserdata/ace.xcuserdatad/xcschemes/FoodTracker.xcscheme [new file with mode: 0644]
learn/FoodTracker/FoodTracker.xcodeproj/xcuserdata/ace.xcuserdatad/xcschemes/xcschememanagement.plist [new file with mode: 0644]
learn/FoodTracker/FoodTracker/AppDelegate.swift [new file with mode: 0644]
learn/FoodTracker/FoodTracker/Assets.xcassets/AppIcon.appiconset/Contents.json [new file with mode: 0644]
learn/FoodTracker/FoodTracker/Assets.xcassets/AppIcon.appiconset/appicon@3x.png [new file with mode: 0644]
learn/FoodTracker/FoodTracker/Assets.xcassets/Contents.json [new file with mode: 0644]
learn/FoodTracker/FoodTracker/Assets.xcassets/RatingImages/Contents.json [new file with mode: 0644]
learn/FoodTracker/FoodTracker/Assets.xcassets/RatingImages/emptyStar.imageset/5_emptyStar_2x.png [new file with mode: 0644]
learn/FoodTracker/FoodTracker/Assets.xcassets/RatingImages/emptyStar.imageset/Contents.json [new file with mode: 0644]
learn/FoodTracker/FoodTracker/Assets.xcassets/RatingImages/filledStar.imageset/5_filledStar_2x.png [new file with mode: 0644]
learn/FoodTracker/FoodTracker/Assets.xcassets/RatingImages/filledStar.imageset/Contents.json [new file with mode: 0644]
learn/FoodTracker/FoodTracker/Assets.xcassets/SampleImages/Contents.json [new file with mode: 0644]
learn/FoodTracker/FoodTracker/Assets.xcassets/SampleImages/meal1.imageset/Contents.json [new file with mode: 0644]
learn/FoodTracker/FoodTracker/Assets.xcassets/SampleImages/meal1.imageset/meal1.png [new file with mode: 0644]
learn/FoodTracker/FoodTracker/Assets.xcassets/SampleImages/meal2.imageset/Contents.json [new file with mode: 0644]
learn/FoodTracker/FoodTracker/Assets.xcassets/SampleImages/meal2.imageset/meal2.png [new file with mode: 0644]
learn/FoodTracker/FoodTracker/Assets.xcassets/SampleImages/meal3.imageset/Contents.json [new file with mode: 0644]
learn/FoodTracker/FoodTracker/Assets.xcassets/SampleImages/meal3.imageset/meal3.png [new file with mode: 0644]
learn/FoodTracker/FoodTracker/Assets.xcassets/defaultPhoto.imageset/Contents.json [new file with mode: 0644]
learn/FoodTracker/FoodTracker/Assets.xcassets/defaultPhoto.imageset/defaultphoto_2x.png [new file with mode: 0644]
learn/FoodTracker/FoodTracker/Base.lproj/LaunchScreen.storyboard [new file with mode: 0644]
learn/FoodTracker/FoodTracker/Base.lproj/Main.storyboard [new file with mode: 0644]
learn/FoodTracker/FoodTracker/Info.plist [new file with mode: 0644]
learn/FoodTracker/FoodTracker/Meal.swift [new file with mode: 0644]
learn/FoodTracker/FoodTracker/MealTableViewCell.swift [new file with mode: 0644]
learn/FoodTracker/FoodTracker/MealTableViewController.swift [new file with mode: 0644]
learn/FoodTracker/FoodTracker/MealViewController.swift [new file with mode: 0644]
learn/FoodTracker/FoodTracker/RatingControl.swift [new file with mode: 0644]
learn/FoodTracker/FoodTrackerTests/FoodTrackerTests.swift [new file with mode: 0644]
learn/FoodTracker/FoodTrackerTests/Info.plist [new file with mode: 0644]

index 83c223dd43a77d0ca64359149882678d75458905..dde461ff1d914a43b20e7ded157907d50ca6841a 100644 (file)
Binary files a/learn/AcePlay/AcePlay.playground/playground.xcworkspace/xcuserdata/Ace.xcuserdatad/UserInterfaceState.xcuserstate and b/learn/AcePlay/AcePlay.playground/playground.xcworkspace/xcuserdata/Ace.xcuserdatad/UserInterfaceState.xcuserstate differ
diff --git a/learn/FoodTracker/FoodTracker.xcodeproj/project.pbxproj b/learn/FoodTracker/FoodTracker.xcodeproj/project.pbxproj
new file mode 100644 (file)
index 0000000..f6a26d1
--- /dev/null
@@ -0,0 +1,447 @@
+// !$*UTF8*$!
+{
+       archiveVersion = 1;
+       classes = {
+       };
+       objectVersion = 46;
+       objects = {
+
+/* Begin PBXBuildFile section */
+               50B9071E1DCEFF5F00D6482E /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50B9071D1DCEFF5F00D6482E /* AppDelegate.swift */; };
+               50B907201DCEFF5F00D6482E /* MealViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50B9071F1DCEFF5F00D6482E /* MealViewController.swift */; };
+               50B907231DCEFF5F00D6482E /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 50B907211DCEFF5F00D6482E /* Main.storyboard */; };
+               50B907251DCEFF5F00D6482E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 50B907241DCEFF5F00D6482E /* Assets.xcassets */; };
+               50B907281DCEFF5F00D6482E /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 50B907261DCEFF5F00D6482E /* LaunchScreen.storyboard */; };
+               50B907331DCEFF5F00D6482E /* FoodTrackerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50B907321DCEFF5F00D6482E /* FoodTrackerTests.swift */; };
+               50B9073E1DD2255900D6482E /* RatingControl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50B9073D1DD2255900D6482E /* RatingControl.swift */; };
+               50B907401DD434C000D6482E /* Meal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50B9073F1DD434C000D6482E /* Meal.swift */; };
+               50B907411DD434C000D6482E /* Meal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50B9073F1DD434C000D6482E /* Meal.swift */; };
+               50B907431DD49D4600D6482E /* MealTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50B907421DD49D4600D6482E /* MealTableViewCell.swift */; };
+               50B907451DD6178100D6482E /* MealTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50B907441DD6178100D6482E /* MealTableViewController.swift */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+               50B9072F1DCEFF5F00D6482E /* PBXContainerItemProxy */ = {
+                       isa = PBXContainerItemProxy;
+                       containerPortal = 50B907121DCEFF5F00D6482E /* Project object */;
+                       proxyType = 1;
+                       remoteGlobalIDString = 50B907191DCEFF5F00D6482E;
+                       remoteInfo = FoodTracker;
+               };
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXFileReference section */
+               50B9071A1DCEFF5F00D6482E /* FoodTracker.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FoodTracker.app; sourceTree = BUILT_PRODUCTS_DIR; };
+               50B9071D1DCEFF5F00D6482E /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
+               50B9071F1DCEFF5F00D6482E /* MealViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MealViewController.swift; sourceTree = "<group>"; };
+               50B907221DCEFF5F00D6482E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
+               50B907241DCEFF5F00D6482E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
+               50B907271DCEFF5F00D6482E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
+               50B907291DCEFF5F00D6482E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+               50B9072E1DCEFF5F00D6482E /* FoodTrackerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FoodTrackerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
+               50B907321DCEFF5F00D6482E /* FoodTrackerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FoodTrackerTests.swift; sourceTree = "<group>"; };
+               50B907341DCEFF5F00D6482E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+               50B9073D1DD2255900D6482E /* RatingControl.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RatingControl.swift; sourceTree = "<group>"; };
+               50B9073F1DD434C000D6482E /* Meal.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Meal.swift; sourceTree = "<group>"; };
+               50B907421DD49D4600D6482E /* MealTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MealTableViewCell.swift; sourceTree = "<group>"; };
+               50B907441DD6178100D6482E /* MealTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MealTableViewController.swift; sourceTree = "<group>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+               50B907171DCEFF5F00D6482E /* Frameworks */ = {
+                       isa = PBXFrameworksBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               50B9072B1DCEFF5F00D6482E /* Frameworks */ = {
+                       isa = PBXFrameworksBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+               50B907111DCEFF5E00D6482E = {
+                       isa = PBXGroup;
+                       children = (
+                               50B9071C1DCEFF5F00D6482E /* FoodTracker */,
+                               50B907311DCEFF5F00D6482E /* FoodTrackerTests */,
+                               50B9071B1DCEFF5F00D6482E /* Products */,
+                       );
+                       sourceTree = "<group>";
+               };
+               50B9071B1DCEFF5F00D6482E /* Products */ = {
+                       isa = PBXGroup;
+                       children = (
+                               50B9071A1DCEFF5F00D6482E /* FoodTracker.app */,
+                               50B9072E1DCEFF5F00D6482E /* FoodTrackerTests.xctest */,
+                       );
+                       name = Products;
+                       sourceTree = "<group>";
+               };
+               50B9071C1DCEFF5F00D6482E /* FoodTracker */ = {
+                       isa = PBXGroup;
+                       children = (
+                               50B9071D1DCEFF5F00D6482E /* AppDelegate.swift */,
+                               50B9071F1DCEFF5F00D6482E /* MealViewController.swift */,
+                               50B907211DCEFF5F00D6482E /* Main.storyboard */,
+                               50B907421DD49D4600D6482E /* MealTableViewCell.swift */,
+                               50B9073F1DD434C000D6482E /* Meal.swift */,
+                               50B907241DCEFF5F00D6482E /* Assets.xcassets */,
+                               50B907261DCEFF5F00D6482E /* LaunchScreen.storyboard */,
+                               50B907441DD6178100D6482E /* MealTableViewController.swift */,
+                               50B907291DCEFF5F00D6482E /* Info.plist */,
+                               50B9073D1DD2255900D6482E /* RatingControl.swift */,
+                       );
+                       path = FoodTracker;
+                       sourceTree = "<group>";
+               };
+               50B907311DCEFF5F00D6482E /* FoodTrackerTests */ = {
+                       isa = PBXGroup;
+                       children = (
+                               50B907321DCEFF5F00D6482E /* FoodTrackerTests.swift */,
+                               50B907341DCEFF5F00D6482E /* Info.plist */,
+                       );
+                       path = FoodTrackerTests;
+                       sourceTree = "<group>";
+               };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+               50B907191DCEFF5F00D6482E /* FoodTracker */ = {
+                       isa = PBXNativeTarget;
+                       buildConfigurationList = 50B907371DCEFF5F00D6482E /* Build configuration list for PBXNativeTarget "FoodTracker" */;
+                       buildPhases = (
+                               50B907161DCEFF5F00D6482E /* Sources */,
+                               50B907171DCEFF5F00D6482E /* Frameworks */,
+                               50B907181DCEFF5F00D6482E /* Resources */,
+                       );
+                       buildRules = (
+                       );
+                       dependencies = (
+                       );
+                       name = FoodTracker;
+                       productName = FoodTracker;
+                       productReference = 50B9071A1DCEFF5F00D6482E /* FoodTracker.app */;
+                       productType = "com.apple.product-type.application";
+               };
+               50B9072D1DCEFF5F00D6482E /* FoodTrackerTests */ = {
+                       isa = PBXNativeTarget;
+                       buildConfigurationList = 50B9073A1DCEFF5F00D6482E /* Build configuration list for PBXNativeTarget "FoodTrackerTests" */;
+                       buildPhases = (
+                               50B9072A1DCEFF5F00D6482E /* Sources */,
+                               50B9072B1DCEFF5F00D6482E /* Frameworks */,
+                               50B9072C1DCEFF5F00D6482E /* Resources */,
+                       );
+                       buildRules = (
+                       );
+                       dependencies = (
+                               50B907301DCEFF5F00D6482E /* PBXTargetDependency */,
+                       );
+                       name = FoodTrackerTests;
+                       productName = FoodTrackerTests;
+                       productReference = 50B9072E1DCEFF5F00D6482E /* FoodTrackerTests.xctest */;
+                       productType = "com.apple.product-type.bundle.unit-test";
+               };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+               50B907121DCEFF5F00D6482E /* Project object */ = {
+                       isa = PBXProject;
+                       attributes = {
+                               LastSwiftUpdateCheck = 0810;
+                               LastUpgradeCheck = 0810;
+                               ORGANIZATIONNAME = Ace;
+                               TargetAttributes = {
+                                       50B907191DCEFF5F00D6482E = {
+                                               CreatedOnToolsVersion = 8.1;
+                                               DevelopmentTeam = VR7L9Q5L2E;
+                                               ProvisioningStyle = Automatic;
+                                       };
+                                       50B9072D1DCEFF5F00D6482E = {
+                                               CreatedOnToolsVersion = 8.1;
+                                               DevelopmentTeam = VR7L9Q5L2E;
+                                               ProvisioningStyle = Automatic;
+                                               TestTargetID = 50B907191DCEFF5F00D6482E;
+                                       };
+                               };
+                       };
+                       buildConfigurationList = 50B907151DCEFF5F00D6482E /* Build configuration list for PBXProject "FoodTracker" */;
+                       compatibilityVersion = "Xcode 3.2";
+                       developmentRegion = English;
+                       hasScannedForEncodings = 0;
+                       knownRegions = (
+                               en,
+                               Base,
+                       );
+                       mainGroup = 50B907111DCEFF5E00D6482E;
+                       productRefGroup = 50B9071B1DCEFF5F00D6482E /* Products */;
+                       projectDirPath = "";
+                       projectRoot = "";
+                       targets = (
+                               50B907191DCEFF5F00D6482E /* FoodTracker */,
+                               50B9072D1DCEFF5F00D6482E /* FoodTrackerTests */,
+                       );
+               };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+               50B907181DCEFF5F00D6482E /* Resources */ = {
+                       isa = PBXResourcesBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                               50B907281DCEFF5F00D6482E /* LaunchScreen.storyboard in Resources */,
+                               50B907251DCEFF5F00D6482E /* Assets.xcassets in Resources */,
+                               50B907231DCEFF5F00D6482E /* Main.storyboard in Resources */,
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               50B9072C1DCEFF5F00D6482E /* Resources */ = {
+                       isa = PBXResourcesBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+               50B907161DCEFF5F00D6482E /* Sources */ = {
+                       isa = PBXSourcesBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                               50B907401DD434C000D6482E /* Meal.swift in Sources */,
+                               50B907201DCEFF5F00D6482E /* MealViewController.swift in Sources */,
+                               50B9073E1DD2255900D6482E /* RatingControl.swift in Sources */,
+                               50B9071E1DCEFF5F00D6482E /* AppDelegate.swift in Sources */,
+                               50B907451DD6178100D6482E /* MealTableViewController.swift in Sources */,
+                               50B907431DD49D4600D6482E /* MealTableViewCell.swift in Sources */,
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               50B9072A1DCEFF5F00D6482E /* Sources */ = {
+                       isa = PBXSourcesBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                               50B907411DD434C000D6482E /* Meal.swift in Sources */,
+                               50B907331DCEFF5F00D6482E /* FoodTrackerTests.swift in Sources */,
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXTargetDependency section */
+               50B907301DCEFF5F00D6482E /* PBXTargetDependency */ = {
+                       isa = PBXTargetDependency;
+                       target = 50B907191DCEFF5F00D6482E /* FoodTracker */;
+                       targetProxy = 50B9072F1DCEFF5F00D6482E /* PBXContainerItemProxy */;
+               };
+/* End PBXTargetDependency section */
+
+/* Begin PBXVariantGroup section */
+               50B907211DCEFF5F00D6482E /* Main.storyboard */ = {
+                       isa = PBXVariantGroup;
+                       children = (
+                               50B907221DCEFF5F00D6482E /* Base */,
+                       );
+                       name = Main.storyboard;
+                       sourceTree = "<group>";
+               };
+               50B907261DCEFF5F00D6482E /* LaunchScreen.storyboard */ = {
+                       isa = PBXVariantGroup;
+                       children = (
+                               50B907271DCEFF5F00D6482E /* Base */,
+                       );
+                       name = LaunchScreen.storyboard;
+                       sourceTree = "<group>";
+               };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+               50B907351DCEFF5F00D6482E /* Debug */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               ALWAYS_SEARCH_USER_PATHS = NO;
+                               CLANG_ANALYZER_NONNULL = YES;
+                               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_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_OBJC_ROOT_CLASS = YES_ERROR;
+                               CLANG_WARN_SUSPICIOUS_MOVES = YES;
+                               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 = 10.1;
+                               MTL_ENABLE_DEBUG_INFO = YES;
+                               ONLY_ACTIVE_ARCH = YES;
+                               SDKROOT = iphoneos;
+                               SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
+                               SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+                               TARGETED_DEVICE_FAMILY = "1,2";
+                       };
+                       name = Debug;
+               };
+               50B907361DCEFF5F00D6482E /* Release */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               ALWAYS_SEARCH_USER_PATHS = NO;
+                               CLANG_ANALYZER_NONNULL = YES;
+                               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_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_OBJC_ROOT_CLASS = YES_ERROR;
+                               CLANG_WARN_SUSPICIOUS_MOVES = YES;
+                               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 = 10.1;
+                               MTL_ENABLE_DEBUG_INFO = NO;
+                               SDKROOT = iphoneos;
+                               SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
+                               TARGETED_DEVICE_FAMILY = "1,2";
+                               VALIDATE_PRODUCT = YES;
+                       };
+                       name = Release;
+               };
+               50B907381DCEFF5F00D6482E /* Debug */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+                               DEVELOPMENT_TEAM = VR7L9Q5L2E;
+                               INFOPLIST_FILE = FoodTracker/Info.plist;
+                               LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+                               PRODUCT_BUNDLE_IDENTIFIER = com.ace.FoodTracker;
+                               PRODUCT_NAME = "$(TARGET_NAME)";
+                               SWIFT_VERSION = 3.0;
+                       };
+                       name = Debug;
+               };
+               50B907391DCEFF5F00D6482E /* Release */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+                               DEVELOPMENT_TEAM = VR7L9Q5L2E;
+                               INFOPLIST_FILE = FoodTracker/Info.plist;
+                               LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+                               PRODUCT_BUNDLE_IDENTIFIER = com.ace.FoodTracker;
+                               PRODUCT_NAME = "$(TARGET_NAME)";
+                               SWIFT_VERSION = 3.0;
+                       };
+                       name = Release;
+               };
+               50B9073B1DCEFF5F00D6482E /* Debug */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
+                               BUNDLE_LOADER = "$(TEST_HOST)";
+                               DEVELOPMENT_TEAM = VR7L9Q5L2E;
+                               INFOPLIST_FILE = FoodTrackerTests/Info.plist;
+                               LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
+                               PRODUCT_BUNDLE_IDENTIFIER = com.ace.FoodTrackerTests;
+                               PRODUCT_NAME = "$(TARGET_NAME)";
+                               SWIFT_VERSION = 3.0;
+                               TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FoodTracker.app/FoodTracker";
+                       };
+                       name = Debug;
+               };
+               50B9073C1DCEFF5F00D6482E /* Release */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
+                               BUNDLE_LOADER = "$(TEST_HOST)";
+                               DEVELOPMENT_TEAM = VR7L9Q5L2E;
+                               INFOPLIST_FILE = FoodTrackerTests/Info.plist;
+                               LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
+                               PRODUCT_BUNDLE_IDENTIFIER = com.ace.FoodTrackerTests;
+                               PRODUCT_NAME = "$(TARGET_NAME)";
+                               SWIFT_VERSION = 3.0;
+                               TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FoodTracker.app/FoodTracker";
+                       };
+                       name = Release;
+               };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+               50B907151DCEFF5F00D6482E /* Build configuration list for PBXProject "FoodTracker" */ = {
+                       isa = XCConfigurationList;
+                       buildConfigurations = (
+                               50B907351DCEFF5F00D6482E /* Debug */,
+                               50B907361DCEFF5F00D6482E /* Release */,
+                       );
+                       defaultConfigurationIsVisible = 0;
+                       defaultConfigurationName = Release;
+               };
+               50B907371DCEFF5F00D6482E /* Build configuration list for PBXNativeTarget "FoodTracker" */ = {
+                       isa = XCConfigurationList;
+                       buildConfigurations = (
+                               50B907381DCEFF5F00D6482E /* Debug */,
+                               50B907391DCEFF5F00D6482E /* Release */,
+                       );
+                       defaultConfigurationIsVisible = 0;
+                       defaultConfigurationName = Release;
+               };
+               50B9073A1DCEFF5F00D6482E /* Build configuration list for PBXNativeTarget "FoodTrackerTests" */ = {
+                       isa = XCConfigurationList;
+                       buildConfigurations = (
+                               50B9073B1DCEFF5F00D6482E /* Debug */,
+                               50B9073C1DCEFF5F00D6482E /* Release */,
+                       );
+                       defaultConfigurationIsVisible = 0;
+                       defaultConfigurationName = Release;
+               };
+/* End XCConfigurationList section */
+       };
+       rootObject = 50B907121DCEFF5F00D6482E /* Project object */;
+}
diff --git a/learn/FoodTracker/FoodTracker.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/learn/FoodTracker/FoodTracker.xcodeproj/project.xcworkspace/contents.xcworkspacedata
new file mode 100644 (file)
index 0000000..112b993
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+   version = "1.0">
+   <FileRef
+      location = "self:FoodTracker.xcodeproj">
+   </FileRef>
+</Workspace>
diff --git a/learn/FoodTracker/FoodTracker.xcodeproj/project.xcworkspace/xcuserdata/ace.xcuserdatad/UserInterfaceState.xcuserstate b/learn/FoodTracker/FoodTracker.xcodeproj/project.xcworkspace/xcuserdata/ace.xcuserdatad/UserInterfaceState.xcuserstate
new file mode 100644 (file)
index 0000000..e455e34
Binary files /dev/null and b/learn/FoodTracker/FoodTracker.xcodeproj/project.xcworkspace/xcuserdata/ace.xcuserdatad/UserInterfaceState.xcuserstate differ
diff --git a/learn/FoodTracker/FoodTracker.xcodeproj/xcuserdata/ace.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/learn/FoodTracker/FoodTracker.xcodeproj/xcuserdata/ace.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
new file mode 100644 (file)
index 0000000..c4f1a7f
--- /dev/null
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Bucket
+   type = "1"
+   version = "2.0">
+   <Breakpoints>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "FoodTracker/Meal.swift"
+            timestampString = "501254141.957383"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "25"
+            endingLineNumber = "25"
+            landmarkName = "init(name:photo:rating:)"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "FoodTracker/Meal.swift"
+            timestampString = "501254144.548103"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "29"
+            endingLineNumber = "29"
+            landmarkName = "init(name:photo:rating:)"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "FoodTracker/MealTableViewController.swift"
+            timestampString = "501255263.098251"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "65"
+            endingLineNumber = "65"
+            landmarkName = "tableView(_:cellForRowAt:)"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "FoodTracker/MealTableViewController.swift"
+            timestampString = "501254709.616375"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "62"
+            endingLineNumber = "62"
+            landmarkName = "tableView(_:cellForRowAt:)"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "FoodTracker/MealTableViewController.swift"
+            timestampString = "501255263.098251"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "63"
+            endingLineNumber = "63"
+            landmarkName = "tableView(_:cellForRowAt:)"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "FoodTracker/MealTableViewController.swift"
+            timestampString = "501255263.098251"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "62"
+            endingLineNumber = "62"
+            landmarkName = "tableView(_:cellForRowAt:)"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+   </Breakpoints>
+</Bucket>
diff --git a/learn/FoodTracker/FoodTracker.xcodeproj/xcuserdata/ace.xcuserdatad/xcschemes/FoodTracker.xcscheme b/learn/FoodTracker/FoodTracker.xcodeproj/xcuserdata/ace.xcuserdatad/xcschemes/FoodTracker.xcscheme
new file mode 100644 (file)
index 0000000..1f51f81
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+   LastUpgradeVersion = "0810"
+   version = "1.3">
+   <BuildAction
+      parallelizeBuildables = "YES"
+      buildImplicitDependencies = "YES">
+      <BuildActionEntries>
+         <BuildActionEntry
+            buildForTesting = "YES"
+            buildForRunning = "YES"
+            buildForProfiling = "YES"
+            buildForArchiving = "YES"
+            buildForAnalyzing = "YES">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "50B907191DCEFF5F00D6482E"
+               BuildableName = "FoodTracker.app"
+               BlueprintName = "FoodTracker"
+               ReferencedContainer = "container:FoodTracker.xcodeproj">
+            </BuildableReference>
+         </BuildActionEntry>
+      </BuildActionEntries>
+   </BuildAction>
+   <TestAction
+      buildConfiguration = "Debug"
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      shouldUseLaunchSchemeArgsEnv = "YES">
+      <Testables>
+         <TestableReference
+            skipped = "NO">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "50B9072D1DCEFF5F00D6482E"
+               BuildableName = "FoodTrackerTests.xctest"
+               BlueprintName = "FoodTrackerTests"
+               ReferencedContainer = "container:FoodTracker.xcodeproj">
+            </BuildableReference>
+         </TestableReference>
+      </Testables>
+      <MacroExpansion>
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "50B907191DCEFF5F00D6482E"
+            BuildableName = "FoodTracker.app"
+            BlueprintName = "FoodTracker"
+            ReferencedContainer = "container:FoodTracker.xcodeproj">
+         </BuildableReference>
+      </MacroExpansion>
+      <AdditionalOptions>
+      </AdditionalOptions>
+   </TestAction>
+   <LaunchAction
+      buildConfiguration = "Debug"
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      launchStyle = "0"
+      useCustomWorkingDirectory = "NO"
+      ignoresPersistentStateOnLaunch = "NO"
+      debugDocumentVersioning = "YES"
+      debugServiceExtension = "internal"
+      allowLocationSimulation = "YES">
+      <BuildableProductRunnable
+         runnableDebuggingMode = "0">
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "50B907191DCEFF5F00D6482E"
+            BuildableName = "FoodTracker.app"
+            BlueprintName = "FoodTracker"
+            ReferencedContainer = "container:FoodTracker.xcodeproj">
+         </BuildableReference>
+      </BuildableProductRunnable>
+      <AdditionalOptions>
+      </AdditionalOptions>
+   </LaunchAction>
+   <ProfileAction
+      buildConfiguration = "Release"
+      shouldUseLaunchSchemeArgsEnv = "YES"
+      savedToolIdentifier = ""
+      useCustomWorkingDirectory = "NO"
+      debugDocumentVersioning = "YES">
+      <BuildableProductRunnable
+         runnableDebuggingMode = "0">
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "50B907191DCEFF5F00D6482E"
+            BuildableName = "FoodTracker.app"
+            BlueprintName = "FoodTracker"
+            ReferencedContainer = "container:FoodTracker.xcodeproj">
+         </BuildableReference>
+      </BuildableProductRunnable>
+   </ProfileAction>
+   <AnalyzeAction
+      buildConfiguration = "Debug">
+   </AnalyzeAction>
+   <ArchiveAction
+      buildConfiguration = "Release"
+      revealArchiveInOrganizer = "YES">
+   </ArchiveAction>
+</Scheme>
diff --git a/learn/FoodTracker/FoodTracker.xcodeproj/xcuserdata/ace.xcuserdatad/xcschemes/xcschememanagement.plist b/learn/FoodTracker/FoodTracker.xcodeproj/xcuserdata/ace.xcuserdatad/xcschemes/xcschememanagement.plist
new file mode 100644 (file)
index 0000000..824cf1d
--- /dev/null
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>SchemeUserState</key>
+       <dict>
+               <key>FoodTracker.xcscheme</key>
+               <dict>
+                       <key>orderHint</key>
+                       <integer>0</integer>
+               </dict>
+       </dict>
+       <key>SuppressBuildableAutocreation</key>
+       <dict>
+               <key>50B907191DCEFF5F00D6482E</key>
+               <dict>
+                       <key>primary</key>
+                       <true/>
+               </dict>
+               <key>50B9072D1DCEFF5F00D6482E</key>
+               <dict>
+                       <key>primary</key>
+                       <true/>
+               </dict>
+       </dict>
+</dict>
+</plist>
diff --git a/learn/FoodTracker/FoodTracker/AppDelegate.swift b/learn/FoodTracker/FoodTracker/AppDelegate.swift
new file mode 100644 (file)
index 0000000..fb6dff1
--- /dev/null
@@ -0,0 +1,46 @@
+//
+//  AppDelegate.swift
+//  FoodTracker
+//
+//  Created by Ace on 06/11/2016.
+//  Copyright © 2016 Ace. All rights reserved.
+//
+
+import UIKit
+
+@UIApplicationMain
+class AppDelegate: UIResponder, UIApplicationDelegate {
+
+    var window: UIWindow?
+
+
+    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
+        // Override point for customization after application launch.
+        return true
+    }
+
+    func applicationWillResignActive(_ application: UIApplication) {
+        // 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 invalidate graphics rendering callbacks. Games should use this method to pause the game.
+    }
+
+    func applicationDidEnterBackground(_ application: UIApplication) {
+        // 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.
+    }
+
+    func applicationWillEnterForeground(_ application: UIApplication) {
+        // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
+    }
+
+    func applicationDidBecomeActive(_ application: UIApplication) {
+        // 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.
+    }
+
+    func applicationWillTerminate(_ application: UIApplication) {
+        // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
+    }
+
+
+}
+
diff --git a/learn/FoodTracker/FoodTracker/Assets.xcassets/AppIcon.appiconset/Contents.json b/learn/FoodTracker/FoodTracker/Assets.xcassets/AppIcon.appiconset/Contents.json
new file mode 100644 (file)
index 0000000..e5217d5
--- /dev/null
@@ -0,0 +1,94 @@
+{
+  "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"
+    },
+    {
+      "size" : "60x60",
+      "idiom" : "iphone",
+      "filename" : "appicon@3x.png",
+      "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"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}
\ No newline at end of file
diff --git a/learn/FoodTracker/FoodTracker/Assets.xcassets/AppIcon.appiconset/appicon@3x.png b/learn/FoodTracker/FoodTracker/Assets.xcassets/AppIcon.appiconset/appicon@3x.png
new file mode 100644 (file)
index 0000000..922cb1e
Binary files /dev/null and b/learn/FoodTracker/FoodTracker/Assets.xcassets/AppIcon.appiconset/appicon@3x.png differ
diff --git a/learn/FoodTracker/FoodTracker/Assets.xcassets/Contents.json b/learn/FoodTracker/FoodTracker/Assets.xcassets/Contents.json
new file mode 100644 (file)
index 0000000..da4a164
--- /dev/null
@@ -0,0 +1,6 @@
+{
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}
\ No newline at end of file
diff --git a/learn/FoodTracker/FoodTracker/Assets.xcassets/RatingImages/Contents.json b/learn/FoodTracker/FoodTracker/Assets.xcassets/RatingImages/Contents.json
new file mode 100644 (file)
index 0000000..da4a164
--- /dev/null
@@ -0,0 +1,6 @@
+{
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}
\ No newline at end of file
diff --git a/learn/FoodTracker/FoodTracker/Assets.xcassets/RatingImages/emptyStar.imageset/5_emptyStar_2x.png b/learn/FoodTracker/FoodTracker/Assets.xcassets/RatingImages/emptyStar.imageset/5_emptyStar_2x.png
new file mode 100644 (file)
index 0000000..08d2203
Binary files /dev/null and b/learn/FoodTracker/FoodTracker/Assets.xcassets/RatingImages/emptyStar.imageset/5_emptyStar_2x.png differ
diff --git a/learn/FoodTracker/FoodTracker/Assets.xcassets/RatingImages/emptyStar.imageset/Contents.json b/learn/FoodTracker/FoodTracker/Assets.xcassets/RatingImages/emptyStar.imageset/Contents.json
new file mode 100644 (file)
index 0000000..2cf3eae
--- /dev/null
@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "5_emptyStar_2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}
\ No newline at end of file
diff --git a/learn/FoodTracker/FoodTracker/Assets.xcassets/RatingImages/filledStar.imageset/5_filledStar_2x.png b/learn/FoodTracker/FoodTracker/Assets.xcassets/RatingImages/filledStar.imageset/5_filledStar_2x.png
new file mode 100644 (file)
index 0000000..de24c53
Binary files /dev/null and b/learn/FoodTracker/FoodTracker/Assets.xcassets/RatingImages/filledStar.imageset/5_filledStar_2x.png differ
diff --git a/learn/FoodTracker/FoodTracker/Assets.xcassets/RatingImages/filledStar.imageset/Contents.json b/learn/FoodTracker/FoodTracker/Assets.xcassets/RatingImages/filledStar.imageset/Contents.json
new file mode 100644 (file)
index 0000000..0bcf0ad
--- /dev/null
@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "5_filledStar_2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}
\ No newline at end of file
diff --git a/learn/FoodTracker/FoodTracker/Assets.xcassets/SampleImages/Contents.json b/learn/FoodTracker/FoodTracker/Assets.xcassets/SampleImages/Contents.json
new file mode 100644 (file)
index 0000000..da4a164
--- /dev/null
@@ -0,0 +1,6 @@
+{
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}
\ No newline at end of file
diff --git a/learn/FoodTracker/FoodTracker/Assets.xcassets/SampleImages/meal1.imageset/Contents.json b/learn/FoodTracker/FoodTracker/Assets.xcassets/SampleImages/meal1.imageset/Contents.json
new file mode 100644 (file)
index 0000000..a06189d
--- /dev/null
@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "meal1.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}
\ No newline at end of file
diff --git a/learn/FoodTracker/FoodTracker/Assets.xcassets/SampleImages/meal1.imageset/meal1.png b/learn/FoodTracker/FoodTracker/Assets.xcassets/SampleImages/meal1.imageset/meal1.png
new file mode 100644 (file)
index 0000000..373957b
Binary files /dev/null and b/learn/FoodTracker/FoodTracker/Assets.xcassets/SampleImages/meal1.imageset/meal1.png differ
diff --git a/learn/FoodTracker/FoodTracker/Assets.xcassets/SampleImages/meal2.imageset/Contents.json b/learn/FoodTracker/FoodTracker/Assets.xcassets/SampleImages/meal2.imageset/Contents.json
new file mode 100644 (file)
index 0000000..877323f
--- /dev/null
@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "meal2.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}
\ No newline at end of file
diff --git a/learn/FoodTracker/FoodTracker/Assets.xcassets/SampleImages/meal2.imageset/meal2.png b/learn/FoodTracker/FoodTracker/Assets.xcassets/SampleImages/meal2.imageset/meal2.png
new file mode 100644 (file)
index 0000000..5c2f7f7
Binary files /dev/null and b/learn/FoodTracker/FoodTracker/Assets.xcassets/SampleImages/meal2.imageset/meal2.png differ
diff --git a/learn/FoodTracker/FoodTracker/Assets.xcassets/SampleImages/meal3.imageset/Contents.json b/learn/FoodTracker/FoodTracker/Assets.xcassets/SampleImages/meal3.imageset/Contents.json
new file mode 100644 (file)
index 0000000..f44dc0e
--- /dev/null
@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "meal3.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}
\ No newline at end of file
diff --git a/learn/FoodTracker/FoodTracker/Assets.xcassets/SampleImages/meal3.imageset/meal3.png b/learn/FoodTracker/FoodTracker/Assets.xcassets/SampleImages/meal3.imageset/meal3.png
new file mode 100644 (file)
index 0000000..f2de346
Binary files /dev/null and b/learn/FoodTracker/FoodTracker/Assets.xcassets/SampleImages/meal3.imageset/meal3.png differ
diff --git a/learn/FoodTracker/FoodTracker/Assets.xcassets/defaultPhoto.imageset/Contents.json b/learn/FoodTracker/FoodTracker/Assets.xcassets/defaultPhoto.imageset/Contents.json
new file mode 100644 (file)
index 0000000..64cc7f4
--- /dev/null
@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "defaultphoto_2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}
\ No newline at end of file
diff --git a/learn/FoodTracker/FoodTracker/Assets.xcassets/defaultPhoto.imageset/defaultphoto_2x.png b/learn/FoodTracker/FoodTracker/Assets.xcassets/defaultPhoto.imageset/defaultphoto_2x.png
new file mode 100644 (file)
index 0000000..0a17edc
Binary files /dev/null and b/learn/FoodTracker/FoodTracker/Assets.xcassets/defaultPhoto.imageset/defaultphoto_2x.png differ
diff --git a/learn/FoodTracker/FoodTracker/Base.lproj/LaunchScreen.storyboard b/learn/FoodTracker/FoodTracker/Base.lproj/LaunchScreen.storyboard
new file mode 100644 (file)
index 0000000..fdf3f97
--- /dev/null
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11134" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
+    <dependencies>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11106"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <scenes>
+        <!--View Controller-->
+        <scene sceneID="EHf-IW-A2E">
+            <objects>
+                <viewController id="01J-lp-oVM" sceneMemberID="viewController">
+                    <layoutGuides>
+                        <viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
+                        <viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
+                    </layoutGuides>
+                    <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
+                        <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                    </view>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="53" y="375"/>
+        </scene>
+    </scenes>
+</document>
diff --git a/learn/FoodTracker/FoodTracker/Base.lproj/Main.storyboard b/learn/FoodTracker/FoodTracker/Base.lproj/Main.storyboard
new file mode 100644 (file)
index 0000000..a4ada04
--- /dev/null
@@ -0,0 +1,204 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11542" systemVersion="16B2555" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="op1-Vi-WvV">
+    <device id="retina4_7" orientation="portrait">
+        <adaptation id="fullscreen"/>
+    </device>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11524"/>
+        <capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
+        <capability name="Constraints to layout margins" minToolsVersion="6.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <scenes>
+        <!--Your Meals-->
+        <scene sceneID="QqM-iw-ipT">
+            <objects>
+                <tableViewController id="JJJ-KE-b5n" customClass="MealTableViewController" customModule="FoodTracker" customModuleProvider="target" sceneMemberID="viewController">
+                    <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="90" sectionHeaderHeight="28" sectionFooterHeight="28" id="jO4-OI-kMY">
+                        <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                        <prototypes>
+                            <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="MealTableViewCell" rowHeight="90" id="MuZ-Jv-9cf" customClass="MealTableViewCell" customModule="FoodTracker" customModuleProvider="target">
+                                <rect key="frame" x="0.0" y="28" width="375" height="90"/>
+                                <autoresizingMask key="autoresizingMask"/>
+                                <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="MuZ-Jv-9cf" id="dfg-oy-3ma">
+                                    <rect key="frame" x="0.0" y="0.0" width="375" height="89"/>
+                                    <autoresizingMask key="autoresizingMask"/>
+                                    <subviews>
+                                        <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="defaultPhoto" translatesAutoresizingMaskIntoConstraints="NO" id="kat-56-OsR">
+                                            <rect key="frame" x="0.0" y="0.0" width="89" height="89"/>
+                                            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                        </imageView>
+                                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Czt-hS-8hu">
+                                            <rect key="frame" x="97" y="8" width="278" height="21"/>
+                                            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                            <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                            <nil key="textColor"/>
+                                            <nil key="highlightedColor"/>
+                                        </label>
+                                        <view userInteractionEnabled="NO" contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="4gd-6m-z00" customClass="RatingControl" customModule="FoodTracker" customModuleProvider="target">
+                                            <rect key="frame" x="97" y="37" width="240" height="44"/>
+                                            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                            <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                        </view>
+                                    </subviews>
+                                </tableViewCellContentView>
+                                <connections>
+                                    <outlet property="nameLabel" destination="Czt-hS-8hu" id="Vwl-cJ-2fW"/>
+                                    <outlet property="photoImageView" destination="kat-56-OsR" id="R9M-ad-ndk"/>
+                                    <outlet property="ratingControl" destination="4gd-6m-z00" id="IHx-Ih-ve9"/>
+                                </connections>
+                            </tableViewCell>
+                        </prototypes>
+                        <connections>
+                            <outlet property="dataSource" destination="JJJ-KE-b5n" id="tHq-BJ-Dnt"/>
+                            <outlet property="delegate" destination="JJJ-KE-b5n" id="IXI-bG-0ZG"/>
+                        </connections>
+                    </tableView>
+                    <navigationItem key="navigationItem" title="Your Meals" id="Bvh-Sf-i8Z">
+                        <barButtonItem key="rightBarButtonItem" systemItem="add" id="TTy-MM-nQy">
+                            <connections>
+                                <segue destination="3Ix-xQ-Ltm" kind="presentation" identifier="AddItem" id="31n-rg-uJs"/>
+                            </connections>
+                        </barButtonItem>
+                    </navigationItem>
+                </tableViewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="ZAv-y0-SZe" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="-64.799999999999997" y="122.78860569715144"/>
+        </scene>
+        <!--New Meal-->
+        <scene sceneID="tne-QT-ifu">
+            <objects>
+                <viewController id="BYZ-38-t0r" customClass="MealViewController" customModule="FoodTracker" customModuleProvider="target" sceneMemberID="viewController">
+                    <layoutGuides>
+                        <viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
+                        <viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
+                    </layoutGuides>
+                    <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
+                        <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <subviews>
+                            <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="center" spacing="12" translatesAutoresizingMaskIntoConstraints="NO" id="Ff8-Oh-HKO">
+                                <rect key="frame" x="16" y="87" width="343" height="493"/>
+                                <subviews>
+                                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Meal Name" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cS5-eh-tMr">
+                                        <rect key="frame" x="128.5" y="0.0" width="86.5" height="20.5"/>
+                                        <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                        <nil key="textColor"/>
+                                        <nil key="highlightedColor"/>
+                                    </label>
+                                    <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Enter meal name" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="LR2-Il-Hl0">
+                                        <rect key="frame" x="0.0" y="32.5" width="343" height="30"/>
+                                        <nil key="textColor"/>
+                                        <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                                        <textInputTraits key="textInputTraits" returnKeyType="done" enablesReturnKeyAutomatically="YES"/>
+                                    </textField>
+                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="xrE-R3-4Ay">
+                                        <rect key="frame" x="96" y="74.5" width="151" height="30"/>
+                                        <state key="normal" title="Set Default Label Text"/>
+                                        <connections>
+                                            <action selector="setDefaultLabelText:" destination="BYZ-38-t0r" eventType="touchUpInside" id="OPD-m4-yga"/>
+                                        </connections>
+                                    </button>
+                                    <imageView contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" placeholderIntrinsicWidth="320" placeholderIntrinsicHeight="320" image="defaultPhoto" translatesAutoresizingMaskIntoConstraints="NO" id="cS5-gD-gyg">
+                                        <rect key="frame" x="11.5" y="116.5" width="320" height="320"/>
+                                        <gestureRecognizers/>
+                                        <constraints>
+                                            <constraint firstAttribute="width" secondItem="cS5-gD-gyg" secondAttribute="height" multiplier="1:1" id="n2H-uW-ovd"/>
+                                        </constraints>
+                                        <connections>
+                                            <outletCollection property="gestureRecognizers" destination="sQj-ma-E5n" appends="YES" id="ATF-vG-V4r"/>
+                                        </connections>
+                                    </imageView>
+                                    <view contentMode="scaleToFill" placeholderIntrinsicWidth="240" placeholderIntrinsicHeight="44" translatesAutoresizingMaskIntoConstraints="NO" id="2Sh-dv-JYN" customClass="RatingControl" customModule="FoodTracker" customModuleProvider="target">
+                                        <rect key="frame" x="51.5" y="448.5" width="240" height="44"/>
+                                        <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                    </view>
+                                </subviews>
+                                <constraints>
+                                    <constraint firstItem="LR2-Il-Hl0" firstAttribute="leading" secondItem="Ff8-Oh-HKO" secondAttribute="leading" id="HUY-2v-ICl"/>
+                                    <constraint firstAttribute="trailing" secondItem="LR2-Il-Hl0" secondAttribute="trailing" id="Uda-lT-7QR"/>
+                                </constraints>
+                            </stackView>
+                        </subviews>
+                        <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                        <constraints>
+                            <constraint firstItem="Ff8-Oh-HKO" firstAttribute="top" secondItem="y3c-jy-aDJ" secondAttribute="bottom" constant="23" id="3kA-JS-yOx"/>
+                            <constraint firstItem="Ff8-Oh-HKO" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leadingMargin" id="UrQ-ES-Q30"/>
+                            <constraint firstAttribute="trailingMargin" secondItem="Ff8-Oh-HKO" secondAttribute="trailing" id="Zdd-B4-jQO"/>
+                        </constraints>
+                    </view>
+                    <navigationItem key="navigationItem" title="New Meal" id="BYT-Mg-qCK">
+                        <barButtonItem key="leftBarButtonItem" systemItem="cancel" id="d6U-YA-Gkw">
+                            <connections>
+                                <action selector="cancel:" destination="BYZ-38-t0r" id="CKm-vw-FJh"/>
+                            </connections>
+                        </barButtonItem>
+                        <barButtonItem key="rightBarButtonItem" systemItem="save" id="XyZ-15-X5f">
+                            <connections>
+                                <segue destination="fw8-eS-jka" kind="unwind" unwindAction="unwindToMealList:" id="upj-bq-iVO"/>
+                            </connections>
+                        </barButtonItem>
+                    </navigationItem>
+                    <connections>
+                        <outlet property="mealNameLabel" destination="cS5-eh-tMr" id="GRH-ns-6Y9"/>
+                        <outlet property="nameTextField" destination="LR2-Il-Hl0" id="y9a-Wq-Kcm"/>
+                        <outlet property="photoImageView" destination="cS5-gD-gyg" id="t3Z-3M-Xip"/>
+                        <outlet property="ratingControl" destination="2Sh-dv-JYN" id="iXg-7v-Ff3"/>
+                        <outlet property="saveButton" destination="XyZ-15-X5f" id="h9t-Aw-HsF"/>
+                    </connections>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
+                <exit id="fw8-eS-jka" userLabel="Exit" sceneMemberID="exit"/>
+                <tapGestureRecognizer id="sQj-ma-E5n">
+                    <connections>
+                        <action selector="selectImageFromPhotoLibrary:" destination="BYZ-38-t0r" id="Va8-D1-1SB"/>
+                    </connections>
+                </tapGestureRecognizer>
+            </objects>
+            <point key="canvasLocation" x="1720.8" y="122.78860569715144"/>
+        </scene>
+        <!--Navigation Controller-->
+        <scene sceneID="64I-3l-Y13">
+            <objects>
+                <navigationController automaticallyAdjustsScrollViewInsets="NO" id="op1-Vi-WvV" sceneMemberID="viewController">
+                    <toolbarItems/>
+                    <navigationBar key="navigationBar" contentMode="scaleToFill" id="9OQ-bP-57I">
+                        <rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
+                        <autoresizingMask key="autoresizingMask"/>
+                    </navigationBar>
+                    <nil name="viewControllers"/>
+                    <connections>
+                        <segue destination="JJJ-KE-b5n" kind="relationship" relationship="rootViewController" id="ZsO-L2-NUE"/>
+                    </connections>
+                </navigationController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="RGb-0Q-47J" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="-1004" y="122.78860569715144"/>
+        </scene>
+        <!--Navigation Controller-->
+        <scene sceneID="DkC-kY-2Cu">
+            <objects>
+                <navigationController automaticallyAdjustsScrollViewInsets="NO" id="3Ix-xQ-Ltm" sceneMemberID="viewController">
+                    <toolbarItems/>
+                    <navigationBar key="navigationBar" contentMode="scaleToFill" id="Thd-yZ-pMc">
+                        <rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
+                        <autoresizingMask key="autoresizingMask"/>
+                    </navigationBar>
+                    <nil name="viewControllers"/>
+                    <connections>
+                        <segue destination="BYZ-38-t0r" kind="relationship" relationship="rootViewController" id="gNH-ms-ctu"/>
+                    </connections>
+                </navigationController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="w23-8J-fZD" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="781.60000000000002" y="122.78860569715144"/>
+        </scene>
+    </scenes>
+    <resources>
+        <image name="defaultPhoto" width="320" height="320"/>
+    </resources>
+</document>
diff --git a/learn/FoodTracker/FoodTracker/Info.plist b/learn/FoodTracker/FoodTracker/Info.plist
new file mode 100644 (file)
index 0000000..06a999d
--- /dev/null
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>NSCameraUsageDescription</key>
+       <string>Camera</string>
+       <key>NSPhotoLibraryUsageDescription</key>
+       <string>i need your photo</string>
+       <key>CFBundleDevelopmentRegion</key>
+       <string>zh_CN</string>
+       <key>CFBundleExecutable</key>
+       <string>$(EXECUTABLE_NAME)</string>
+       <key>CFBundleIdentifier</key>
+       <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
+       <key>CFBundleInfoDictionaryVersion</key>
+       <string>6.0</string>
+       <key>CFBundleName</key>
+       <string>$(PRODUCT_NAME)</string>
+       <key>CFBundlePackageType</key>
+       <string>APPL</string>
+       <key>CFBundleShortVersionString</key>
+       <string>1.0</string>
+       <key>CFBundleVersion</key>
+       <string>1</string>
+       <key>LSRequiresIPhoneOS</key>
+       <true/>
+       <key>UILaunchStoryboardName</key>
+       <string>LaunchScreen</string>
+       <key>UIMainStoryboardFile</key>
+       <string>Main</string>
+       <key>UIRequiredDeviceCapabilities</key>
+       <array>
+               <string>armv7</string>
+       </array>
+       <key>UISupportedInterfaceOrientations</key>
+       <array>
+               <string>UIInterfaceOrientationPortrait</string>
+               <string>UIInterfaceOrientationLandscapeLeft</string>
+               <string>UIInterfaceOrientationLandscapeRight</string>
+       </array>
+       <key>UISupportedInterfaceOrientations~ipad</key>
+       <array>
+               <string>UIInterfaceOrientationPortrait</string>
+               <string>UIInterfaceOrientationPortraitUpsideDown</string>
+               <string>UIInterfaceOrientationLandscapeLeft</string>
+               <string>UIInterfaceOrientationLandscapeRight</string>
+       </array>
+</dict>
+</plist>
diff --git a/learn/FoodTracker/FoodTracker/Meal.swift b/learn/FoodTracker/FoodTracker/Meal.swift
new file mode 100644 (file)
index 0000000..aec1361
--- /dev/null
@@ -0,0 +1,37 @@
+//
+//  Meal.swift
+//  FoodTracker
+//
+//  Created by Ace on 10/11/2016.
+//  Copyright © 2016 Ace. All rights reserved.
+//
+
+import UIKit
+
+class Meal {
+    
+    // MARK: Properties
+    var name: String
+    
+    var photo: UIImage?
+    
+    var rating: Int
+    
+    
+    // MARK: Initializtion
+    
+    init?(name: String, photo: UIImage?, rating: Int) {
+        guard !name.isEmpty else {
+            return nil
+        }
+        
+        guard rating >= 0 else {
+            return nil
+        }
+        
+        self.name = name
+        self.photo = photo
+        self.rating = rating
+    }
+    
+}
diff --git a/learn/FoodTracker/FoodTracker/MealTableViewCell.swift b/learn/FoodTracker/FoodTracker/MealTableViewCell.swift
new file mode 100644 (file)
index 0000000..4847f51
--- /dev/null
@@ -0,0 +1,29 @@
+//
+//  MealTableViewCell.swift
+//  FoodTracker
+//
+//  Created by Ace on 10/11/2016.
+//  Copyright © 2016 Ace. All rights reserved.
+//
+
+import UIKit
+
+class MealTableViewCell: UITableViewCell {
+    
+    // MARK: Properties
+    @IBOutlet weak var nameLabel: UILabel!
+    @IBOutlet weak var photoImageView: UIImageView!
+    @IBOutlet weak var ratingControl: RatingControl!
+
+    override func awakeFromNib() {
+        super.awakeFromNib()
+        // Initialization code
+    }
+
+    override func setSelected(_ selected: Bool, animated: Bool) {
+        super.setSelected(selected, animated: animated)
+
+        // Configure the view for the selected state
+    }
+
+}
diff --git a/learn/FoodTracker/FoodTracker/MealTableViewController.swift b/learn/FoodTracker/FoodTracker/MealTableViewController.swift
new file mode 100644 (file)
index 0000000..2991d61
--- /dev/null
@@ -0,0 +1,132 @@
+//
+//  MealTableViewController.swift
+//  FoodTracker
+//
+//  Created by Ace on 11/11/2016.
+//  Copyright © 2016 Ace. All rights reserved.
+//
+
+import UIKit
+
+class MealTableViewController: UITableViewController {
+    
+    // MARK: Properties
+    var meals = [Meal]()
+
+    override func viewDidLoad() {
+        super.viewDidLoad()
+
+        // Uncomment the following line to preserve selection between presentations
+        // self.clearsSelectionOnViewWillAppear = false
+
+        // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
+        // self.navigationItem.rightBarButtonItem = self.editButtonItem()
+        
+        loadSampleMeals()
+    }
+    
+    func loadSampleMeals() {
+        let photo1 = UIImage(named: "meal1")
+        let meal1 = Meal(name: "Caprese Salad", photo: photo1, rating: 4)!
+        
+        
+        let photo2 = UIImage(named: "meal2")
+        let meal2 = Meal(name: "Chicken and Potatoes", photo: photo2, rating: 5)!
+        
+        let photo3 = UIImage(named: "meal3")
+        let meal3 = Meal(name: "Pasta with Meatballs", photo: photo3, rating: 3)!
+        
+        meals += [meal1, meal2, meal3]
+        
+    }
+
+    override func didReceiveMemoryWarning() {
+        super.didReceiveMemoryWarning()
+        // Dispose of any resources that can be recreated.
+    }
+
+    // MARK: - Table view data source
+
+    override func numberOfSections(in tableView: UITableView) -> Int {
+        // #warning Incomplete implementation, return the number of sections
+        return 1
+    }
+
+    override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
+        // #warning Incomplete implementation, return the number of rows
+        return meals.count
+    }
+
+    
+    override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
+        let cellIdentifier = "MealTableViewCell"
+        let cell = tableView.dequeueReusableCell(withIdentifier: cellIdentifier, for: indexPath) as! MealTableViewCell
+        
+        let meal = meals[indexPath.row]
+        
+        cell.nameLabel.text = meal.name
+        cell.photoImageView.image = meal.photo
+        cell.ratingControl.rating = meal.rating
+
+        // Configure the cell...
+
+        return cell
+    }
+    
+
+    /*
+    // Override to support conditional editing of the table view.
+    override func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
+        // Return false if you do not want the specified item to be editable.
+        return true
+    }
+    */
+
+    /*
+    // Override to support editing the table view.
+    override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) {
+        if editingStyle == .delete {
+            // Delete the row from the data source
+            tableView.deleteRows(at: [indexPath], with: .fade)
+        } else if editingStyle == .insert {
+            // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
+        }    
+    }
+    */
+
+    /*
+    // Override to support rearranging the table view.
+    override func tableView(_ tableView: UITableView, moveRowAt fromIndexPath: IndexPath, to: IndexPath) {
+
+    }
+    */
+
+    /*
+    // Override to support conditional rearranging of the table view.
+    override func tableView(_ tableView: UITableView, canMoveRowAt indexPath: IndexPath) -> Bool {
+        // Return false if you do not want the item to be re-orderable.
+        return true
+    }
+    */
+
+    /*
+    // MARK: - Navigation
+
+    // In a storyboard-based application, you will often want to do a little preparation before navigation
+    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
+        // Get the new view controller using segue.destinationViewController.
+        // Pass the selected object to the new view controller.
+    }
+    */
+    
+    
+    @IBAction func unwindToMealList(_ sender: UIStoryboardSegue) {
+        if let sourceViewController = sender.source as? MealViewController, let meal = sourceViewController.meal {
+            let newIndexPath = IndexPath(row: meals.count, section: 0)
+            meals.append(meal)
+            tableView.insertRows(at: [newIndexPath], with: .bottom)
+            
+        }
+    }
+
+}
diff --git a/learn/FoodTracker/FoodTracker/MealViewController.swift b/learn/FoodTracker/FoodTracker/MealViewController.swift
new file mode 100644 (file)
index 0000000..73d8a86
--- /dev/null
@@ -0,0 +1,113 @@
+//
+//  ViewController.swift
+//  FoodTracker
+//
+//  Created by Ace on 06/11/2016.
+//  Copyright © 2016 Ace. All rights reserved.
+//
+
+import UIKit
+
+class MealViewController: UIViewController, UITextFieldDelegate, UIImagePickerControllerDelegate, UINavigationControllerDelegate {
+    
+    // MARK: Properties
+    @IBOutlet weak var nameTextField: UITextField!
+    @IBOutlet weak var mealNameLabel: UILabel!
+    @IBOutlet weak var photoImageView: UIImageView!
+    @IBOutlet weak var ratingControl: RatingControl!
+    @IBOutlet weak var saveButton: UIBarButtonItem!
+    
+    var meal: Meal?
+
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        // Do any additional setup after loading the view, typically from a nib.
+        
+        nameTextField.delegate = self
+        
+        checkValidMealName()
+        
+    }
+
+    override func didReceiveMemoryWarning() {
+        super.didReceiveMemoryWarning()
+        // Dispose of any resources that can be recreated.
+    }
+
+    // MARK: UITextFieldDelegate
+    func textFieldShouldReturn(_ textField: UITextField) -> Bool {
+        // Hide Keyboard
+        textField.resignFirstResponder()
+        return true;
+    }
+    
+    func textFieldDidBeginEditing(_ textField: UITextField) {
+        saveButton.isEnabled = false
+    }
+    func checkValidMealName() {
+        let name = nameTextField.text ?? ""
+         
+        saveButton.isEnabled = !name.isEmpty
+    }
+    
+    func textFieldDidEndEditing(_ textField: UITextField) {
+        checkValidMealName()
+        navigationItem.title = textField.text
+        mealNameLabel.text = textField.text
+    }
+    
+    
+    // MARK: UIImagePickerControllerDelegate
+    
+    func imagePickerControllerDidCancel(_ picker: UIImagePickerController) {
+        dismiss(animated: true, completion: nil)
+    }
+    
+    func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
+        
+        let selectedImage = info[UIImagePickerControllerOriginalImage] as! UIImage
+        
+        photoImageView.image = selectedImage
+        
+        dismiss(animated: true, completion: nil)
+    }
+
+    
+    // MARK: Navigation
+    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
+        if let barButton = sender as? UIBarButtonItem {
+            if saveButton === barButton {
+                let name = nameTextField.text ?? ""
+                let photo = photoImageView.image
+                let rating = ratingControl.rating
+                
+                meal = Meal(name: name, photo: photo, rating: rating)
+            }
+        }
+    }
+    
+    @IBAction func cancel(_ sender: UIBarButtonItem) {
+        dismiss(animated: true, completion: nil)
+    }
+    
+    
+    // MARK: Actions
+
+    @IBAction func selectImageFromPhotoLibrary(_ sender: UITapGestureRecognizer) {
+
+        nameTextField.resignFirstResponder()
+
+        let imagePickerController = UIImagePickerController()
+
+        imagePickerController.sourceType = .photoLibrary
+
+        imagePickerController.delegate = self
+
+        present(imagePickerController, animated: true, completion: nil)
+    }
+    
+    @IBAction func setDefaultLabelText(_ sender: UIButton) {
+        mealNameLabel.text = "Default Text"
+    }
+}
+
diff --git a/learn/FoodTracker/FoodTracker/RatingControl.swift b/learn/FoodTracker/FoodTracker/RatingControl.swift
new file mode 100644 (file)
index 0000000..906cd95
--- /dev/null
@@ -0,0 +1,99 @@
+//
+//  RatingControl.swift
+//  FoodTracker
+//
+//  Created by Ace on 08/11/2016.
+//  Copyright © 2016 Ace. All rights reserved.
+//
+
+import UIKit
+
+class RatingControl: UIView {
+
+    /*
+    // Only override draw() if you perform custom drawing.
+    // An empty implementation adversely affects performance during animation.
+    override func draw(_ rect: CGRect) {
+        // Drawing code
+    }
+    */
+    
+    // MARK: Initialization
+    
+    var spacing = 5
+    var stars = 5
+    
+    var rating = 0 {
+        didSet {
+            setNeedsLayout()
+        }
+    }
+    var ratingButtons = [UIButton]()
+    
+    
+    required init?(coder aDecoder: NSCoder) {
+        super.init(coder: aDecoder)
+
+/*
+        for _ in 0..<stars {
+            //let button = UIButton(frame: CGRect(x: inx*(44+spacing), y: 0, width: 44, height: 44))
+            let button = UIButton(frame: CGRect(x: 0, y: 0, width: 44, height: 44))
+            button.backgroundColor = UIColor.red
+            button.addTarget(self, action: #selector(RatingControl.ratingButtonTapped(_:)), for: .touchDown)
+            ratingButtons.append(button)
+            addSubview(button)
+        }
+*/
+        
+        let emptyStarImage = UIImage(named: "emptyStar")
+        let filledStarImage = UIImage(named: "filledStar")
+        
+        for _ in 0..<5 {
+            let button = UIButton()
+            button.setImage(emptyStarImage, for: .normal)
+            button.setImage(filledStarImage, for: .selected)
+            button.setImage(filledStarImage, for: [.highlighted, .selected])
+            button.adjustsImageWhenHighlighted = false
+            button.addTarget(self, action: #selector(RatingControl.ratingButtonTapped(_:)), for: .touchDown)
+            ratingButtons.append(button)
+            addSubview(button)
+        }
+    }
+    
+    override func layoutSubviews() {
+        let buttonSize = Int(frame.size.height)
+        var buttonFrame = CGRect(x: 0, y: 0, width: buttonSize, height: buttonSize)
+        
+        for (index, button) in ratingButtons.enumerated() {
+            buttonFrame.origin.x = CGFloat(index * (buttonSize + spacing))
+            button.frame = buttonFrame
+        }
+        
+        updateButtonSelectionStates()
+    }
+    
+    override var intrinsicContentSize : CGSize {
+        let buttonSize = Int(frame.size.height)
+        let width = (buttonSize + spacing) * stars
+        
+        return CGSize(width: width, height: buttonSize)
+    }
+
+    
+    // MARK: Button Action
+    func ratingButtonTapped(_ button: UIButton) {
+        //print("Button Pressed")
+        
+        rating = ratingButtons.index(of: button)! + 1
+        
+        
+        updateButtonSelectionStates()
+    }
+    
+    
+    func updateButtonSelectionStates() {
+        for (index, button) in ratingButtons.enumerated() {
+            button.isSelected = index < rating
+        }
+    }
+}
diff --git a/learn/FoodTracker/FoodTrackerTests/FoodTrackerTests.swift b/learn/FoodTracker/FoodTrackerTests/FoodTrackerTests.swift
new file mode 100644 (file)
index 0000000..ddfed7a
--- /dev/null
@@ -0,0 +1,52 @@
+//
+//  FoodTrackerTests.swift
+//  FoodTrackerTests
+//
+//  Created by Ace on 06/11/2016.
+//  Copyright © 2016 Ace. All rights reserved.
+//
+
+import UIKit
+import XCTest
+@testable import FoodTracker
+
+class FoodTrackerTests: XCTestCase {
+    
+/*
+    override func setUp() {
+        super.setUp()
+        // Put setup code here. This method is called before the invocation of each test method in the class.
+    }
+    
+    override func tearDown() {
+        // Put teardown code here. This method is called after the invocation of each test method in the class.
+        super.tearDown()
+    }
+    
+    func testExample() {
+        // This is an example of a functional test case.
+        // Use XCTAssert and related functions to verify your tests produce the correct results.
+    }
+    
+    func testPerformanceExample() {
+        // This is an example of a performance test case.
+        self.measure {
+            // Put the code you want to measure the time of here.
+        }
+    }
+ */
+    
+    // MARK: FoodTracker Tests
+    func testMealInitialization() {
+        let potentialItem = Meal(name: "Newest Meal", photo: nil, rating: 5)
+        XCTAssertNotNil(potentialItem)
+        
+        let noName = Meal(name: "", photo: nil, rating: 0)
+        XCTAssertNil(noName, "Empty name is invalid")
+        
+        
+        let badRating = Meal(name: "BadRatingNumber", photo: nil, rating: -1)
+        XCTAssertNil(badRating, "Negative ratings are invalid, be positive")
+    }
+    
+}
diff --git a/learn/FoodTracker/FoodTrackerTests/Info.plist b/learn/FoodTracker/FoodTrackerTests/Info.plist
new file mode 100644 (file)
index 0000000..6c6c23c
--- /dev/null
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>CFBundleDevelopmentRegion</key>
+       <string>en</string>
+       <key>CFBundleExecutable</key>
+       <string>$(EXECUTABLE_NAME)</string>
+       <key>CFBundleIdentifier</key>
+       <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
+       <key>CFBundleInfoDictionaryVersion</key>
+       <string>6.0</string>
+       <key>CFBundleName</key>
+       <string>$(PRODUCT_NAME)</string>
+       <key>CFBundlePackageType</key>
+       <string>BNDL</string>
+       <key>CFBundleShortVersionString</key>
+       <string>1.0</string>
+       <key>CFBundleVersion</key>
+       <string>1</string>
+</dict>
+</plist>