diff --git "a/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker.xcodeproj/project.pbxproj" "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker.xcodeproj/project.pbxproj" new file mode 100644 index 00000000..4961d042 --- /dev/null +++ "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker.xcodeproj/project.pbxproj" @@ -0,0 +1,413 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 672285DE1C4158B400FD87D2 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 672285DD1C4158B400FD87D2 /* Assets.xcassets */; }; + 6730DAD61C398A1E00C15FBC /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6730DAD51C398A1E00C15FBC /* AppDelegate.swift */; }; + 6730DAE01C398A1E00C15FBC /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6730DADE1C398A1E00C15FBC /* LaunchScreen.storyboard */; }; + 6730DAEB1C398A1E00C15FBC /* BookTrackerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6730DAEA1C398A1E00C15FBC /* BookTrackerTests.swift */; }; + 6730DB031C3A2BF300C15FBC /* BookViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6730DB021C3A2BF300C15FBC /* BookViewController.swift */; }; + 6730DB051C3A2C7F00C15FBC /* BookTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6730DB041C3A2C7F00C15FBC /* BookTableViewController.swift */; }; + 6730DB091C3A2C8700C15FBC /* Book.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6730DB061C3A2C8700C15FBC /* Book.swift */; }; + 6730DB0A1C3A2C8700C15FBC /* BookTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6730DB071C3A2C8700C15FBC /* BookTableViewCell.swift */; }; + 6730DB0B1C3A2C8700C15FBC /* RatingControl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6730DB081C3A2C8700C15FBC /* RatingControl.swift */; }; + 6730DB0D1C3A2CD000C15FBC /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6730DB0C1C3A2CD000C15FBC /* Main.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 6730DAE71C398A1E00C15FBC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 6730DACA1C398A1E00C15FBC /* Project object */; + proxyType = 1; + remoteGlobalIDString = 6730DAD11C398A1E00C15FBC; + remoteInfo = BookTracker; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 672285DD1C4158B400FD87D2 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 6730DAD21C398A1E00C15FBC /* BookTracker.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BookTracker.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 6730DAD51C398A1E00C15FBC /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 6730DADF1C398A1E00C15FBC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 6730DAE11C398A1E00C15FBC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 6730DAE61C398A1E00C15FBC /* BookTrackerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BookTrackerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 6730DAEA1C398A1E00C15FBC /* BookTrackerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BookTrackerTests.swift; sourceTree = ""; }; + 6730DAEC1C398A1E00C15FBC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 6730DB021C3A2BF300C15FBC /* BookViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BookViewController.swift; sourceTree = ""; }; + 6730DB041C3A2C7F00C15FBC /* BookTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BookTableViewController.swift; sourceTree = ""; }; + 6730DB061C3A2C8700C15FBC /* Book.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Book.swift; sourceTree = ""; }; + 6730DB071C3A2C8700C15FBC /* BookTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BookTableViewCell.swift; sourceTree = ""; }; + 6730DB081C3A2C8700C15FBC /* RatingControl.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RatingControl.swift; sourceTree = ""; }; + 6730DB0C1C3A2CD000C15FBC /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 6730DACF1C398A1E00C15FBC /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6730DAE31C398A1E00C15FBC /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 6730DAC91C398A1E00C15FBC = { + isa = PBXGroup; + children = ( + 6730DAD41C398A1E00C15FBC /* BookTracker */, + 6730DAE91C398A1E00C15FBC /* BookTrackerTests */, + 6730DAD31C398A1E00C15FBC /* Products */, + ); + sourceTree = ""; + }; + 6730DAD31C398A1E00C15FBC /* Products */ = { + isa = PBXGroup; + children = ( + 6730DAD21C398A1E00C15FBC /* BookTracker.app */, + 6730DAE61C398A1E00C15FBC /* BookTrackerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 6730DAD41C398A1E00C15FBC /* BookTracker */ = { + isa = PBXGroup; + children = ( + 6730DAD51C398A1E00C15FBC /* AppDelegate.swift */, + 6730DB021C3A2BF300C15FBC /* BookViewController.swift */, + 6730DB0C1C3A2CD000C15FBC /* Main.storyboard */, + 672285DD1C4158B400FD87D2 /* Assets.xcassets */, + 6730DB041C3A2C7F00C15FBC /* BookTableViewController.swift */, + 6730DB061C3A2C8700C15FBC /* Book.swift */, + 6730DB071C3A2C8700C15FBC /* BookTableViewCell.swift */, + 6730DB081C3A2C8700C15FBC /* RatingControl.swift */, + 6730DADE1C398A1E00C15FBC /* LaunchScreen.storyboard */, + 6730DAE11C398A1E00C15FBC /* Info.plist */, + ); + path = BookTracker; + sourceTree = ""; + }; + 6730DAE91C398A1E00C15FBC /* BookTrackerTests */ = { + isa = PBXGroup; + children = ( + 6730DAEA1C398A1E00C15FBC /* BookTrackerTests.swift */, + 6730DAEC1C398A1E00C15FBC /* Info.plist */, + ); + path = BookTrackerTests; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 6730DAD11C398A1E00C15FBC /* BookTracker */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6730DAEF1C398A1E00C15FBC /* Build configuration list for PBXNativeTarget "BookTracker" */; + buildPhases = ( + 6730DACE1C398A1E00C15FBC /* Sources */, + 6730DACF1C398A1E00C15FBC /* Frameworks */, + 6730DAD01C398A1E00C15FBC /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = BookTracker; + productName = BookTracker; + productReference = 6730DAD21C398A1E00C15FBC /* BookTracker.app */; + productType = "com.apple.product-type.application"; + }; + 6730DAE51C398A1E00C15FBC /* BookTrackerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6730DAF21C398A1E00C15FBC /* Build configuration list for PBXNativeTarget "BookTrackerTests" */; + buildPhases = ( + 6730DAE21C398A1E00C15FBC /* Sources */, + 6730DAE31C398A1E00C15FBC /* Frameworks */, + 6730DAE41C398A1E00C15FBC /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 6730DAE81C398A1E00C15FBC /* PBXTargetDependency */, + ); + name = BookTrackerTests; + productName = BookTrackerTests; + productReference = 6730DAE61C398A1E00C15FBC /* BookTrackerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 6730DACA1C398A1E00C15FBC /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0720; + LastUpgradeCheck = 0720; + ORGANIZATIONNAME = zhukun; + TargetAttributes = { + 6730DAD11C398A1E00C15FBC = { + CreatedOnToolsVersion = 7.2; + }; + 6730DAE51C398A1E00C15FBC = { + CreatedOnToolsVersion = 7.2; + TestTargetID = 6730DAD11C398A1E00C15FBC; + }; + }; + }; + buildConfigurationList = 6730DACD1C398A1E00C15FBC /* Build configuration list for PBXProject "BookTracker" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 6730DAC91C398A1E00C15FBC; + productRefGroup = 6730DAD31C398A1E00C15FBC /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 6730DAD11C398A1E00C15FBC /* BookTracker */, + 6730DAE51C398A1E00C15FBC /* BookTrackerTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 6730DAD01C398A1E00C15FBC /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6730DB0D1C3A2CD000C15FBC /* Main.storyboard in Resources */, + 6730DAE01C398A1E00C15FBC /* LaunchScreen.storyboard in Resources */, + 672285DE1C4158B400FD87D2 /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6730DAE41C398A1E00C15FBC /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 6730DACE1C398A1E00C15FBC /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6730DB091C3A2C8700C15FBC /* Book.swift in Sources */, + 6730DAD61C398A1E00C15FBC /* AppDelegate.swift in Sources */, + 6730DB051C3A2C7F00C15FBC /* BookTableViewController.swift in Sources */, + 6730DB0A1C3A2C8700C15FBC /* BookTableViewCell.swift in Sources */, + 6730DB0B1C3A2C8700C15FBC /* RatingControl.swift in Sources */, + 6730DB031C3A2BF300C15FBC /* BookViewController.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6730DAE21C398A1E00C15FBC /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6730DAEB1C398A1E00C15FBC /* BookTrackerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 6730DAE81C398A1E00C15FBC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 6730DAD11C398A1E00C15FBC /* BookTracker */; + targetProxy = 6730DAE71C398A1E00C15FBC /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 6730DADE1C398A1E00C15FBC /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 6730DADF1C398A1E00C15FBC /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 6730DAED1C398A1E00C15FBC /* 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; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 6730DAEE1C398A1E00C15FBC /* 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; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 6730DAF01C398A1E00C15FBC /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = BookTracker/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.zhukun.BookTracker; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 6730DAF11C398A1E00C15FBC /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = BookTracker/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.zhukun.BookTracker; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 6730DAF31C398A1E00C15FBC /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + INFOPLIST_FILE = BookTrackerTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.zhukun.BookTrackerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/BookTracker.app/BookTracker"; + }; + name = Debug; + }; + 6730DAF41C398A1E00C15FBC /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + INFOPLIST_FILE = BookTrackerTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.zhukun.BookTrackerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/BookTracker.app/BookTracker"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 6730DACD1C398A1E00C15FBC /* Build configuration list for PBXProject "BookTracker" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6730DAED1C398A1E00C15FBC /* Debug */, + 6730DAEE1C398A1E00C15FBC /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6730DAEF1C398A1E00C15FBC /* Build configuration list for PBXNativeTarget "BookTracker" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6730DAF01C398A1E00C15FBC /* Debug */, + 6730DAF11C398A1E00C15FBC /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6730DAF21C398A1E00C15FBC /* Build configuration list for PBXNativeTarget "BookTrackerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6730DAF31C398A1E00C15FBC /* Debug */, + 6730DAF41C398A1E00C15FBC /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 6730DACA1C398A1E00C15FBC /* Project object */; +} diff --git "a/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker.xcodeproj/project.xcworkspace/contents.xcworkspacedata" "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker.xcodeproj/project.xcworkspace/contents.xcworkspacedata" new file mode 100644 index 00000000..872b3720 --- /dev/null +++ "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker.xcodeproj/project.xcworkspace/contents.xcworkspacedata" @@ -0,0 +1,7 @@ + + + + + diff --git "a/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/AppDelegate.swift" "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/AppDelegate.swift" new file mode 100644 index 00000000..5644637b --- /dev/null +++ "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/AppDelegate.swift" @@ -0,0 +1,46 @@ +// +// AppDelegate.swift +// BookTracker +// +// Created by 朱坤 on 15/12/27. +// Copyright © 2015年 zhukun. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> 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 throttle down OpenGL ES frame rates. 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 inactive 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/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/AppIcon.appiconset/Contents.json" "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/AppIcon.appiconset/Contents.json" new file mode 100644 index 00000000..eeea76c2 --- /dev/null +++ "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/AppIcon.appiconset/Contents.json" @@ -0,0 +1,73 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "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/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/Contents.json" "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/Contents.json" new file mode 100644 index 00000000..da4a164c --- /dev/null +++ "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/Contents.json" @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git "a/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/Rating Images/Contents.json" "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/Rating Images/Contents.json" new file mode 100644 index 00000000..da4a164c --- /dev/null +++ "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/Rating Images/Contents.json" @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git "a/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/Rating Images/emptyStar.imageset/Contents.json" "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/Rating Images/emptyStar.imageset/Contents.json" new file mode 100644 index 00000000..f779632f --- /dev/null +++ "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/Rating Images/emptyStar.imageset/Contents.json" @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "emptyStar.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git "a/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/Rating Images/emptyStar.imageset/emptyStar.png" "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/Rating Images/emptyStar.imageset/emptyStar.png" new file mode 100644 index 00000000..b465ae65 Binary files /dev/null and "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/Rating Images/emptyStar.imageset/emptyStar.png" differ diff --git "a/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/Rating Images/filledStar.imageset/Contents.json" "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/Rating Images/filledStar.imageset/Contents.json" new file mode 100644 index 00000000..6e283a34 --- /dev/null +++ "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/Rating Images/filledStar.imageset/Contents.json" @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "filledStar.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git "a/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/Rating Images/filledStar.imageset/filledStar.png" "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/Rating Images/filledStar.imageset/filledStar.png" new file mode 100644 index 00000000..10d67e94 Binary files /dev/null and "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/Rating Images/filledStar.imageset/filledStar.png" differ diff --git "a/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/Sample Images/Contents.json" "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/Sample Images/Contents.json" new file mode 100644 index 00000000..da4a164c --- /dev/null +++ "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/Sample Images/Contents.json" @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git "a/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/Sample Images/book1.imageset/Contents.json" "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/Sample Images/book1.imageset/Contents.json" new file mode 100644 index 00000000..784161b9 --- /dev/null +++ "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/Sample Images/book1.imageset/Contents.json" @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "rBEhU1JgnwgIAAAAAAJx6QF6lj0AAER-QGFkaAAAnIB428.jpg", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git "a/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/Sample Images/book1.imageset/rBEhU1JgnwgIAAAAAAJx6QF6lj0AAER-QGFkaAAAnIB428.jpg" "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/Sample Images/book1.imageset/rBEhU1JgnwgIAAAAAAJx6QF6lj0AAER-QGFkaAAAnIB428.jpg" new file mode 100644 index 00000000..b13a443b Binary files /dev/null and "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/Sample Images/book1.imageset/rBEhU1JgnwgIAAAAAAJx6QF6lj0AAER-QGFkaAAAnIB428.jpg" differ diff --git "a/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/Sample Images/book2.imageset/Contents.json" "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/Sample Images/book2.imageset/Contents.json" new file mode 100644 index 00000000..44ec1d1d --- /dev/null +++ "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/Sample Images/book2.imageset/Contents.json" @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "s28339291.jpg", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git "a/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/Sample Images/book2.imageset/s28339291.jpg" "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/Sample Images/book2.imageset/s28339291.jpg" new file mode 100644 index 00000000..0e0dc709 Binary files /dev/null and "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/Sample Images/book2.imageset/s28339291.jpg" differ diff --git "a/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/Sample Images/book3.imageset/562202b7N8b78cf66.jpg" "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/Sample Images/book3.imageset/562202b7N8b78cf66.jpg" new file mode 100644 index 00000000..1442f113 Binary files /dev/null and "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/Sample Images/book3.imageset/562202b7N8b78cf66.jpg" differ diff --git "a/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/Sample Images/book3.imageset/Contents.json" "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/Sample Images/book3.imageset/Contents.json" new file mode 100644 index 00000000..acfd70c3 --- /dev/null +++ "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/Sample Images/book3.imageset/Contents.json" @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "562202b7N8b78cf66.jpg", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git "a/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/defaultPhoto.imageset/Contents.json" "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/defaultPhoto.imageset/Contents.json" new file mode 100644 index 00000000..b04bff95 --- /dev/null +++ "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/defaultPhoto.imageset/Contents.json" @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "defaultPhoto.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git "a/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/defaultPhoto.imageset/defaultPhoto.png" "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/defaultPhoto.imageset/defaultPhoto.png" new file mode 100644 index 00000000..52816519 Binary files /dev/null and "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Assets.xcassets/defaultPhoto.imageset/defaultPhoto.png" differ diff --git "a/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Base.lproj/LaunchScreen.storyboard" "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Base.lproj/LaunchScreen.storyboard" new file mode 100644 index 00000000..c9b75643 --- /dev/null +++ "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Base.lproj/LaunchScreen.storyboard" @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git "a/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Base.lproj/Main 00-57-33-321.storyboard" "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Base.lproj/Main 00-57-33-321.storyboard" new file mode 100644 index 00000000..3a2a49ba --- /dev/null +++ "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Base.lproj/Main 00-57-33-321.storyboard" @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git "a/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Book.swift" "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Book.swift" new file mode 100644 index 00000000..ffc2eb4c --- /dev/null +++ "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Book.swift" @@ -0,0 +1,30 @@ +// +// Book.swift +// BookTracker +// +// Created by 朱坤 on 16/1/3. +// Copyright © 2016年 zhukun. All rights reserved. +// + +import UIKit + +class Book{ + + var name :String + var photo: UIImage? + var rating :Int + + init?(name:String,photo:UIImage?,rating:Int){ + self.name = name + self.photo = photo + self.rating = rating + + // Initialization should fail if there is no name or if the rating is negative. + if name.isEmpty || rating < 0 { + return nil + } + } + + + +} diff --git "a/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/BookTableViewCell.swift" "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/BookTableViewCell.swift" new file mode 100644 index 00000000..3cf860f7 --- /dev/null +++ "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/BookTableViewCell.swift" @@ -0,0 +1,29 @@ +// +// BookTableViewCell.swift +// BookTracker +// +// Created by 朱坤 on 16/1/3. +// Copyright © 2016年 zhukun. All rights reserved. +// + +import UIKit + +class BookTableViewCell: 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/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/BookTableViewController.swift" "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/BookTableViewController.swift" new file mode 100644 index 00000000..f45bfee3 --- /dev/null +++ "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/BookTableViewController.swift" @@ -0,0 +1,125 @@ +// +// BookTableViewController.swift +// BookTracker +// +// Created by 朱坤 on 16/1/3. +// Copyright © 2016年 zhukun. All rights reserved. +// + +import UIKit + +class BookTableViewController: UITableViewController { + //MARK: Properties + var books = [Book]() + + override func viewDidLoad() { + super.viewDidLoad() + + // Load the sample data. + loadSampleBooks() + } + + func loadSampleBooks(){ + let photo1 = UIImage(named: "book1")! + let book1 = Book(name: "把时间当做朋友", photo: photo1, rating: 4)! + + let photo2 = UIImage(named: "book2")! + let book2 = Book(name: "Mactalk跨越边界", photo: photo2, rating: 5)! + + let photo3 = UIImage(named: "book3")! + let book3 = Book(name: "App研发录", photo: photo3, rating: 3)! + books+=[book1, book2, book3] + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + // MARK: - Table view data source + + override func numberOfSectionsInTableView(tableView: UITableView) -> Int { + return 1 + } + + override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return books.count + } + + + override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { + // Table view cells are reused and should be dequeued using a cell identifier. + let cellIdentifier = "BookTableViewCell" + + let cell = tableView.dequeueReusableCellWithIdentifier(cellIdentifier, forIndexPath: indexPath) as! BookTableViewCell + + // Fetches the appropriate meal for the data source layout. + let book = books[indexPath.row] + + cell.nameLabel.text = book.name + cell.photoImageView.image = book.photo + cell.ratingControl.rating = book.rating + + + return cell + } + + + /* + // Override to support conditional editing of the table view. + override func tableView(tableView: UITableView, canEditRowAtIndexPath indexPath: NSIndexPath) -> 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, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) { + if editingStyle == .Delete { + // Delete the row from the data source + tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: .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, moveRowAtIndexPath fromIndexPath: NSIndexPath, toIndexPath: NSIndexPath) { + + } + */ + + /* + // Override to support conditional rearranging of the table view. + override func tableView(tableView: UITableView, canMoveRowAtIndexPath indexPath: NSIndexPath) -> 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 prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { + // 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.sourceViewController as? BookViewController, book = sourceViewController.book { + + // Add a new meal. + let newIndexPath = NSIndexPath(forRow: books.count, inSection: 0) + books.append(book) + tableView.insertRowsAtIndexPaths([newIndexPath], withRowAnimation: .Bottom) + + } + + + } + +} diff --git "a/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/BookViewController.swift" "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/BookViewController.swift" new file mode 100644 index 00000000..1af52f7a --- /dev/null +++ "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/BookViewController.swift" @@ -0,0 +1,117 @@ +// +// BookViewController.swift +// BookTracker +// +// Created by 朱坤 on 15/12/27. +// Copyright © 2015年 zhukun. All rights reserved. +// + +import UIKit + +class BookViewController: UIViewController, UITextFieldDelegate, UIImagePickerControllerDelegate, UINavigationControllerDelegate { + + //MARK: properties + @IBOutlet weak var nameTextField: UITextField! + @IBOutlet weak var photoImageView: UIImageView! + @IBOutlet weak var ratingControl: RatingControl! + @IBOutlet weak var saveButton: UIBarButtonItem! + + /* + This value is either passed by `MealTableViewController` in `prepareForSegue(_:sender:)` + or constructed as part of adding a new meal. + */ + var book: Book? + + + override func viewDidLoad() { + super.viewDidLoad() + + //Handle the text field’s user input through delegate callbacks. + nameTextField.delegate = self + + // Enable the Save button only if the text field has a valid Meal name. + checkValidMealName() + + } + + //MARK: UITextFieldDelegate + func textFieldShouldReturn(textField: UITextField) -> Bool { + //Hide the keyboard + nameTextField.resignFirstResponder() + return true + } + + func textFieldDidBeginEditing(textField: UITextField) { + // Disable the Save button while editing. + saveButton.enabled = false + } + + + func textFieldDidEndEditing(textField: UITextField) { + + checkValidMealName() + navigationItem.title = textField.text + } + + func checkValidMealName() { + // Disable the Save button if the text field is empty. + let text = nameTextField.text ?? "" + saveButton.enabled = !text.isEmpty + } + + + //MARK: ImagePickerControllerDelegate + func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : AnyObject]){ + + let selectedImage = info[UIImagePickerControllerOriginalImage] as! UIImage + + photoImageView.image = selectedImage + + dismissViewControllerAnimated(true, completion: nil) + + } + + func imagePickerControllerDidCancel(picker: UIImagePickerController){ + + dismissViewControllerAnimated(true, completion: nil) + } + + //MARK: Action + + @IBAction func selectPhotoFromLib(sender: UITapGestureRecognizer) { + nameTextField.resignFirstResponder() + let imagePickerController = UIImagePickerController() + imagePickerController.sourceType = .PhotoLibrary + imagePickerController.delegate = self + presentViewController(imagePickerController, animated: true + , completion: nil) + + } + + + + + // MARK: Navigation + + @IBAction func cancel(sender: UIBarButtonItem) { + dismissViewControllerAnimated(true, completion: nil) + } + + // This method lets you configure a view controller before it's presented. + override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { + + if saveButton === sender { + let name = nameTextField.text ?? "" + let photo = photoImageView.image + let rating = ratingControl.rating + + // Set the meal to be passed to MealTableViewController after the unwind segue. + book = Book(name: name, photo: photo, rating: rating) + } + + } + + + +} + diff --git "a/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Info.plist" "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Info.plist" new file mode 100644 index 00000000..40c6215d --- /dev/null +++ "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Info.plist" @@ -0,0 +1,47 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git "a/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Main.storyboard" "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Main.storyboard" new file mode 100644 index 00000000..ac88a6b5 --- /dev/null +++ "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/Main.storyboard" @@ -0,0 +1,182 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git "a/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/RatingControl.swift" "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/RatingControl.swift" new file mode 100644 index 00000000..1b98a607 --- /dev/null +++ "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTracker/RatingControl.swift" @@ -0,0 +1,79 @@ +// +// RatingControl.swift +// BookTracker +// +// Created by 朱坤 on 15/12/27. +// Copyright © 2015年 zhukun. All rights reserved. +// + +import UIKit + +class RatingControl: UIView { + + //MARK: Properties + var rating = 0 { + didSet{ + //setNeedsLayout() + } + } + var spacing = 5; + var stars = 5 + + var ratingButtons = [UIButton]() + + //MARK: Initialization + required init?(coder aDecoder: NSCoder) { + super.init(coder: aDecoder) + + let emptyStarImage = UIImage(named: "emptyStar") + let filledImage = UIImage(named: "filledStar") + + + for _ in 0.. CGSize { + return CGSize(width: 240, height: 44) + } + + //MARK: Button Action + + func ratingButtonTapped(button: UIButton){ + rating = ratingButtons.indexOf(button)! + 1 + + updateButtonSelectionStates() + } + + func updateButtonSelectionStates() { + + for(index, button ) in ratingButtons.enumerate(){ + button.selected = index < rating + } + } +} diff --git "a/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTrackerTests/BookTrackerTests.swift" "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTrackerTests/BookTrackerTests.swift" new file mode 100644 index 00000000..2a81cb23 --- /dev/null +++ "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTrackerTests/BookTrackerTests.swift" @@ -0,0 +1,36 @@ +// +// BookTrackerTests.swift +// BookTrackerTests +// +// Created by 朱坤 on 16/1/4. +// Copyright © 2016年 zhukun. All rights reserved. +// + +import XCTest +@testable import BookTracker + +class BookTrackerTests: 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.measureBlock { + // Put the code you want to measure the time of here. + } + } + +} diff --git "a/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTrackerTests/Info.plist" "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTrackerTests/Info.plist" new file mode 100644 index 00000000..ba72822e --- /dev/null +++ "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/BookTrackerTests/Info.plist" @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git "a/21551012\346\234\261\345\235\244\345\235\244/final_homework/\345\274\200\345\217\221\346\226\207\346\241\243.pdf" "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/\345\274\200\345\217\221\346\226\207\346\241\243.pdf" new file mode 100644 index 00000000..7de6d32b Binary files /dev/null and "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/\345\274\200\345\217\221\346\226\207\346\241\243.pdf" differ diff --git "a/21551012\346\234\261\345\235\244\345\235\244/final_homework/\346\274\224\347\244\272\346\226\207\347\250\277.key" "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/\346\274\224\347\244\272\346\226\207\347\250\277.key" new file mode 100644 index 00000000..30a71ec6 Binary files /dev/null and "b/21551012\346\234\261\345\235\244\345\235\244/final_homework/\346\274\224\347\244\272\346\226\207\347\250\277.key" differ diff --git "a/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_Chess.xcodeproj/project.pbxproj" "b/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_Chess.xcodeproj/project.pbxproj" new file mode 100644 index 00000000..2dcf9c9b --- /dev/null +++ "b/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_Chess.xcodeproj/project.pbxproj" @@ -0,0 +1,639 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 181CD4591C390EB200EE30E5 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 181CD4581C390EB200EE30E5 /* main.m */; }; + 181CD45C1C390EB200EE30E5 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 181CD45B1C390EB200EE30E5 /* AppDelegate.m */; }; + 181CD45F1C390EB200EE30E5 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 181CD45E1C390EB200EE30E5 /* ViewController.m */; }; + 181CD4621C390EB200EE30E5 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 181CD4601C390EB200EE30E5 /* Main.storyboard */; }; + 181CD4641C390EB200EE30E5 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 181CD4631C390EB200EE30E5 /* Assets.xcassets */; }; + 181CD4671C390EB200EE30E5 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 181CD4651C390EB200EE30E5 /* LaunchScreen.storyboard */; }; + 181CD4721C390EB200EE30E5 /* Game_ChessTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 181CD4711C390EB200EE30E5 /* Game_ChessTests.m */; }; + 181CD47D1C390EB200EE30E5 /* Game_ChessUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 181CD47C1C390EB200EE30E5 /* Game_ChessUITests.m */; }; + 18DECFEF1C390F540025BC58 /* WXHGameAreaView.m in Sources */ = {isa = PBXBuildFile; fileRef = 18DECFEE1C390F540025BC58 /* WXHGameAreaView.m */; settings = {ASSET_TAGS = (); }; }; + 18DED00A1C390FA00025BC58 /* WXHNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 18DECFF11C390FA00025BC58 /* WXHNode.m */; settings = {ASSET_TAGS = (); }; }; + 18DED00B1C390FA00025BC58 /* WXHParent.m in Sources */ = {isa = PBXBuildFile; fileRef = 18DECFF41C390FA00025BC58 /* WXHParent.m */; settings = {ASSET_TAGS = (); }; }; + 18DED00C1C390FA00025BC58 /* WXHUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 18DECFF61C390FA00025BC58 /* WXHUtils.m */; settings = {ASSET_TAGS = (); }; }; + 18DED00D1C390FA00025BC58 /* WXHPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 18DECFFB1C390FA00025BC58 /* WXHPlayer.m */; settings = {ASSET_TAGS = (); }; }; + 18DED00E1C390FA00025BC58 /* WXHAIComputer.m in Sources */ = {isa = PBXBuildFile; fileRef = 18DECFFD1C390FA00025BC58 /* WXHAIComputer.m */; settings = {ASSET_TAGS = (); }; }; + 18DED00F1C390FA00025BC58 /* WXHMainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 18DED0001C390FA00025BC58 /* WXHMainViewController.m */; settings = {ASSET_TAGS = (); }; }; + 18DED0101C390FA00025BC58 /* WXHMainViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 18DED0011C390FA00025BC58 /* WXHMainViewController.xib */; settings = {ASSET_TAGS = (); }; }; + 18DED0111C390FA00025BC58 /* WXHGameViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 18DED0031C390FA00025BC58 /* WXHGameViewController.m */; settings = {ASSET_TAGS = (); }; }; + 18DED0121C390FA00025BC58 /* WXHGameViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 18DED0041C390FA00025BC58 /* WXHGameViewController.xib */; settings = {ASSET_TAGS = (); }; }; + 18DED0131C390FA00025BC58 /* WXHGameSettingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 18DED0061C390FA00025BC58 /* WXHGameSettingViewController.m */; settings = {ASSET_TAGS = (); }; }; + 18DED0141C390FA00025BC58 /* WXHGameSettingViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 18DED0071C390FA00025BC58 /* WXHGameSettingViewController.xib */; settings = {ASSET_TAGS = (); }; }; + 18DED0161C3917F30025BC58 /* sound.wav in Resources */ = {isa = PBXBuildFile; fileRef = 18DED0151C3917F30025BC58 /* sound.wav */; settings = {ASSET_TAGS = (); }; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 181CD46E1C390EB200EE30E5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 181CD44C1C390EB200EE30E5 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 181CD4531C390EB200EE30E5; + remoteInfo = Game_Chess; + }; + 181CD4791C390EB200EE30E5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 181CD44C1C390EB200EE30E5 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 181CD4531C390EB200EE30E5; + remoteInfo = Game_Chess; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 181CD4541C390EB200EE30E5 /* Game_Chess.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Game_Chess.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 181CD4581C390EB200EE30E5 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 181CD45A1C390EB200EE30E5 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 181CD45B1C390EB200EE30E5 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 181CD45D1C390EB200EE30E5 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 181CD45E1C390EB200EE30E5 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 181CD4611C390EB200EE30E5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 181CD4631C390EB200EE30E5 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 181CD4661C390EB200EE30E5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 181CD4681C390EB200EE30E5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 181CD46D1C390EB200EE30E5 /* Game_ChessTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Game_ChessTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 181CD4711C390EB200EE30E5 /* Game_ChessTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Game_ChessTests.m; sourceTree = ""; }; + 181CD4731C390EB200EE30E5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 181CD4781C390EB200EE30E5 /* Game_ChessUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Game_ChessUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 181CD47C1C390EB200EE30E5 /* Game_ChessUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Game_ChessUITests.m; sourceTree = ""; }; + 181CD47E1C390EB200EE30E5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 18DECFED1C390F540025BC58 /* WXHGameAreaView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXHGameAreaView.h; sourceTree = ""; }; + 18DECFEE1C390F540025BC58 /* WXHGameAreaView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXHGameAreaView.m; sourceTree = ""; }; + 18DECFF01C390FA00025BC58 /* WXHNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXHNode.h; sourceTree = ""; }; + 18DECFF11C390FA00025BC58 /* WXHNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXHNode.m; sourceTree = ""; }; + 18DECFF31C390FA00025BC58 /* WXHParent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXHParent.h; sourceTree = ""; }; + 18DECFF41C390FA00025BC58 /* WXHParent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXHParent.m; sourceTree = ""; }; + 18DECFF51C390FA00025BC58 /* WXHUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXHUtils.h; sourceTree = ""; }; + 18DECFF61C390FA00025BC58 /* WXHUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXHUtils.m; sourceTree = ""; }; + 18DECFF71C390FA00025BC58 /* WXHDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXHDefines.h; sourceTree = ""; }; + 18DECFF81C390FA00025BC58 /* WXHEnum.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXHEnum.h; sourceTree = ""; }; + 18DECFF91C390FA00025BC58 /* WXHDefine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXHDefine.h; sourceTree = ""; }; + 18DECFFA1C390FA00025BC58 /* WXHPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXHPlayer.h; sourceTree = ""; }; + 18DECFFB1C390FA00025BC58 /* WXHPlayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXHPlayer.m; sourceTree = ""; }; + 18DECFFC1C390FA00025BC58 /* WXHAIComputer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXHAIComputer.h; sourceTree = ""; }; + 18DECFFD1C390FA00025BC58 /* WXHAIComputer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXHAIComputer.m; sourceTree = ""; }; + 18DECFFF1C390FA00025BC58 /* WXHMainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXHMainViewController.h; sourceTree = ""; }; + 18DED0001C390FA00025BC58 /* WXHMainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXHMainViewController.m; sourceTree = ""; }; + 18DED0011C390FA00025BC58 /* WXHMainViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = WXHMainViewController.xib; sourceTree = ""; }; + 18DED0021C390FA00025BC58 /* WXHGameViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXHGameViewController.h; sourceTree = ""; }; + 18DED0031C390FA00025BC58 /* WXHGameViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXHGameViewController.m; sourceTree = ""; }; + 18DED0041C390FA00025BC58 /* WXHGameViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = WXHGameViewController.xib; sourceTree = ""; }; + 18DED0051C390FA00025BC58 /* WXHGameSettingViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXHGameSettingViewController.h; sourceTree = ""; }; + 18DED0061C390FA00025BC58 /* WXHGameSettingViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXHGameSettingViewController.m; sourceTree = ""; }; + 18DED0071C390FA00025BC58 /* WXHGameSettingViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = WXHGameSettingViewController.xib; sourceTree = ""; }; + 18DED0151C3917F30025BC58 /* sound.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = sound.wav; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 181CD4511C390EB200EE30E5 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 181CD46A1C390EB200EE30E5 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 181CD4751C390EB200EE30E5 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 181CD44B1C390EB200EE30E5 = { + isa = PBXGroup; + children = ( + 181CD4561C390EB200EE30E5 /* Game_Chess */, + 181CD4701C390EB200EE30E5 /* Game_ChessTests */, + 181CD47B1C390EB200EE30E5 /* Game_ChessUITests */, + 181CD4551C390EB200EE30E5 /* Products */, + ); + sourceTree = ""; + }; + 181CD4551C390EB200EE30E5 /* Products */ = { + isa = PBXGroup; + children = ( + 181CD4541C390EB200EE30E5 /* Game_Chess.app */, + 181CD46D1C390EB200EE30E5 /* Game_ChessTests.xctest */, + 181CD4781C390EB200EE30E5 /* Game_ChessUITests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 181CD4561C390EB200EE30E5 /* Game_Chess */ = { + isa = PBXGroup; + children = ( + 18DED0091C390FA00025BC58 /* Classes */, + 18DECFE91C390F1A0025BC58 /* Views */, + 181CD45A1C390EB200EE30E5 /* AppDelegate.h */, + 181CD45B1C390EB200EE30E5 /* AppDelegate.m */, + 181CD45D1C390EB200EE30E5 /* ViewController.h */, + 181CD45E1C390EB200EE30E5 /* ViewController.m */, + 181CD4601C390EB200EE30E5 /* Main.storyboard */, + 181CD4631C390EB200EE30E5 /* Assets.xcassets */, + 181CD4651C390EB200EE30E5 /* LaunchScreen.storyboard */, + 181CD4681C390EB200EE30E5 /* Info.plist */, + 181CD4571C390EB200EE30E5 /* Supporting Files */, + ); + path = Game_Chess; + sourceTree = ""; + }; + 181CD4571C390EB200EE30E5 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 181CD4581C390EB200EE30E5 /* main.m */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 181CD4701C390EB200EE30E5 /* Game_ChessTests */ = { + isa = PBXGroup; + children = ( + 181CD4711C390EB200EE30E5 /* Game_ChessTests.m */, + 181CD4731C390EB200EE30E5 /* Info.plist */, + ); + path = Game_ChessTests; + sourceTree = ""; + }; + 181CD47B1C390EB200EE30E5 /* Game_ChessUITests */ = { + isa = PBXGroup; + children = ( + 181CD47C1C390EB200EE30E5 /* Game_ChessUITests.m */, + 181CD47E1C390EB200EE30E5 /* Info.plist */, + ); + path = Game_ChessUITests; + sourceTree = ""; + }; + 18DECFE91C390F1A0025BC58 /* Views */ = { + isa = PBXGroup; + children = ( + 18DECFED1C390F540025BC58 /* WXHGameAreaView.h */, + 18DECFEE1C390F540025BC58 /* WXHGameAreaView.m */, + 18DED0151C3917F30025BC58 /* sound.wav */, + ); + name = Views; + sourceTree = ""; + }; + 18DECFF21C390FA00025BC58 /* Models */ = { + isa = PBXGroup; + children = ( + 18DECFF01C390FA00025BC58 /* WXHNode.h */, + 18DECFF11C390FA00025BC58 /* WXHNode.m */, + ); + name = Models; + sourceTree = ""; + }; + 18DECFFE1C390FA00025BC58 /* Tools */ = { + isa = PBXGroup; + children = ( + 18DECFF31C390FA00025BC58 /* WXHParent.h */, + 18DECFF41C390FA00025BC58 /* WXHParent.m */, + 18DECFF51C390FA00025BC58 /* WXHUtils.h */, + 18DECFF61C390FA00025BC58 /* WXHUtils.m */, + 18DECFF71C390FA00025BC58 /* WXHDefines.h */, + 18DECFF81C390FA00025BC58 /* WXHEnum.h */, + 18DECFF91C390FA00025BC58 /* WXHDefine.h */, + 18DECFFA1C390FA00025BC58 /* WXHPlayer.h */, + 18DECFFB1C390FA00025BC58 /* WXHPlayer.m */, + 18DECFFC1C390FA00025BC58 /* WXHAIComputer.h */, + 18DECFFD1C390FA00025BC58 /* WXHAIComputer.m */, + ); + name = Tools; + sourceTree = ""; + }; + 18DED0081C390FA00025BC58 /* Controllers */ = { + isa = PBXGroup; + children = ( + 18DECFFF1C390FA00025BC58 /* WXHMainViewController.h */, + 18DED0001C390FA00025BC58 /* WXHMainViewController.m */, + 18DED0011C390FA00025BC58 /* WXHMainViewController.xib */, + 18DED0021C390FA00025BC58 /* WXHGameViewController.h */, + 18DED0031C390FA00025BC58 /* WXHGameViewController.m */, + 18DED0041C390FA00025BC58 /* WXHGameViewController.xib */, + 18DED0051C390FA00025BC58 /* WXHGameSettingViewController.h */, + 18DED0061C390FA00025BC58 /* WXHGameSettingViewController.m */, + 18DED0071C390FA00025BC58 /* WXHGameSettingViewController.xib */, + ); + name = Controllers; + sourceTree = ""; + }; + 18DED0091C390FA00025BC58 /* Classes */ = { + isa = PBXGroup; + children = ( + 18DECFF21C390FA00025BC58 /* Models */, + 18DECFFE1C390FA00025BC58 /* Tools */, + 18DED0081C390FA00025BC58 /* Controllers */, + ); + name = Classes; + path = ../../Game_WQ/Game_WQ; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 181CD4531C390EB200EE30E5 /* Game_Chess */ = { + isa = PBXNativeTarget; + buildConfigurationList = 181CD4811C390EB200EE30E5 /* Build configuration list for PBXNativeTarget "Game_Chess" */; + buildPhases = ( + 181CD4501C390EB200EE30E5 /* Sources */, + 181CD4511C390EB200EE30E5 /* Frameworks */, + 181CD4521C390EB200EE30E5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Game_Chess; + productName = Game_Chess; + productReference = 181CD4541C390EB200EE30E5 /* Game_Chess.app */; + productType = "com.apple.product-type.application"; + }; + 181CD46C1C390EB200EE30E5 /* Game_ChessTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 181CD4841C390EB200EE30E5 /* Build configuration list for PBXNativeTarget "Game_ChessTests" */; + buildPhases = ( + 181CD4691C390EB200EE30E5 /* Sources */, + 181CD46A1C390EB200EE30E5 /* Frameworks */, + 181CD46B1C390EB200EE30E5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 181CD46F1C390EB200EE30E5 /* PBXTargetDependency */, + ); + name = Game_ChessTests; + productName = Game_ChessTests; + productReference = 181CD46D1C390EB200EE30E5 /* Game_ChessTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 181CD4771C390EB200EE30E5 /* Game_ChessUITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 181CD4871C390EB200EE30E5 /* Build configuration list for PBXNativeTarget "Game_ChessUITests" */; + buildPhases = ( + 181CD4741C390EB200EE30E5 /* Sources */, + 181CD4751C390EB200EE30E5 /* Frameworks */, + 181CD4761C390EB200EE30E5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 181CD47A1C390EB200EE30E5 /* PBXTargetDependency */, + ); + name = Game_ChessUITests; + productName = Game_ChessUITests; + productReference = 181CD4781C390EB200EE30E5 /* Game_ChessUITests.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 181CD44C1C390EB200EE30E5 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0700; + ORGANIZATIONNAME = wxh; + TargetAttributes = { + 181CD4531C390EB200EE30E5 = { + CreatedOnToolsVersion = 7.0.1; + }; + 181CD46C1C390EB200EE30E5 = { + CreatedOnToolsVersion = 7.0.1; + TestTargetID = 181CD4531C390EB200EE30E5; + }; + 181CD4771C390EB200EE30E5 = { + CreatedOnToolsVersion = 7.0.1; + TestTargetID = 181CD4531C390EB200EE30E5; + }; + }; + }; + buildConfigurationList = 181CD44F1C390EB200EE30E5 /* Build configuration list for PBXProject "Game_Chess" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 181CD44B1C390EB200EE30E5; + productRefGroup = 181CD4551C390EB200EE30E5 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 181CD4531C390EB200EE30E5 /* Game_Chess */, + 181CD46C1C390EB200EE30E5 /* Game_ChessTests */, + 181CD4771C390EB200EE30E5 /* Game_ChessUITests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 181CD4521C390EB200EE30E5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 181CD4671C390EB200EE30E5 /* LaunchScreen.storyboard in Resources */, + 18DED0101C390FA00025BC58 /* WXHMainViewController.xib in Resources */, + 18DED0161C3917F30025BC58 /* sound.wav in Resources */, + 181CD4641C390EB200EE30E5 /* Assets.xcassets in Resources */, + 18DED0121C390FA00025BC58 /* WXHGameViewController.xib in Resources */, + 18DED0141C390FA00025BC58 /* WXHGameSettingViewController.xib in Resources */, + 181CD4621C390EB200EE30E5 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 181CD46B1C390EB200EE30E5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 181CD4761C390EB200EE30E5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 181CD4501C390EB200EE30E5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 18DED00A1C390FA00025BC58 /* WXHNode.m in Sources */, + 18DED00B1C390FA00025BC58 /* WXHParent.m in Sources */, + 18DED00D1C390FA00025BC58 /* WXHPlayer.m in Sources */, + 181CD45F1C390EB200EE30E5 /* ViewController.m in Sources */, + 18DED00E1C390FA00025BC58 /* WXHAIComputer.m in Sources */, + 18DECFEF1C390F540025BC58 /* WXHGameAreaView.m in Sources */, + 18DED00C1C390FA00025BC58 /* WXHUtils.m in Sources */, + 18DED0111C390FA00025BC58 /* WXHGameViewController.m in Sources */, + 18DED00F1C390FA00025BC58 /* WXHMainViewController.m in Sources */, + 181CD45C1C390EB200EE30E5 /* AppDelegate.m in Sources */, + 181CD4591C390EB200EE30E5 /* main.m in Sources */, + 18DED0131C390FA00025BC58 /* WXHGameSettingViewController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 181CD4691C390EB200EE30E5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 181CD4721C390EB200EE30E5 /* Game_ChessTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 181CD4741C390EB200EE30E5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 181CD47D1C390EB200EE30E5 /* Game_ChessUITests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 181CD46F1C390EB200EE30E5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 181CD4531C390EB200EE30E5 /* Game_Chess */; + targetProxy = 181CD46E1C390EB200EE30E5 /* PBXContainerItemProxy */; + }; + 181CD47A1C390EB200EE30E5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 181CD4531C390EB200EE30E5 /* Game_Chess */; + targetProxy = 181CD4791C390EB200EE30E5 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 181CD4601C390EB200EE30E5 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 181CD4611C390EB200EE30E5 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 181CD4651C390EB200EE30E5 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 181CD4661C390EB200EE30E5 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 181CD47F1C390EB200EE30E5 /* 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.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 181CD4801C390EB200EE30E5 /* 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.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 181CD4821C390EB200EE30E5 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = Game_Chess/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "wxh.Game-Chess"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 181CD4831C390EB200EE30E5 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = Game_Chess/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "wxh.Game-Chess"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 181CD4851C390EB200EE30E5 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + INFOPLIST_FILE = Game_ChessTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "wxh.Game-ChessTests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Game_Chess.app/Game_Chess"; + }; + name = Debug; + }; + 181CD4861C390EB200EE30E5 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + INFOPLIST_FILE = Game_ChessTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "wxh.Game-ChessTests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Game_Chess.app/Game_Chess"; + }; + name = Release; + }; + 181CD4881C390EB200EE30E5 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Game_ChessUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "wxh.Game-ChessUITests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_TARGET_NAME = Game_Chess; + USES_XCTRUNNER = YES; + }; + name = Debug; + }; + 181CD4891C390EB200EE30E5 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Game_ChessUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "wxh.Game-ChessUITests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_TARGET_NAME = Game_Chess; + USES_XCTRUNNER = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 181CD44F1C390EB200EE30E5 /* Build configuration list for PBXProject "Game_Chess" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 181CD47F1C390EB200EE30E5 /* Debug */, + 181CD4801C390EB200EE30E5 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 181CD4811C390EB200EE30E5 /* Build configuration list for PBXNativeTarget "Game_Chess" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 181CD4821C390EB200EE30E5 /* Debug */, + 181CD4831C390EB200EE30E5 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 181CD4841C390EB200EE30E5 /* Build configuration list for PBXNativeTarget "Game_ChessTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 181CD4851C390EB200EE30E5 /* Debug */, + 181CD4861C390EB200EE30E5 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 181CD4871C390EB200EE30E5 /* Build configuration list for PBXNativeTarget "Game_ChessUITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 181CD4881C390EB200EE30E5 /* Debug */, + 181CD4891C390EB200EE30E5 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 181CD44C1C390EB200EE30E5 /* Project object */; +} diff --git "a/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_Chess.xcodeproj/project.xcworkspace/contents.xcworkspacedata" "b/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_Chess.xcodeproj/project.xcworkspace/contents.xcworkspacedata" new file mode 100644 index 00000000..96db5e2e --- /dev/null +++ "b/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_Chess.xcodeproj/project.xcworkspace/contents.xcworkspacedata" @@ -0,0 +1,7 @@ + + + + + diff --git "a/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_Chess/AppDelegate.h" "b/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_Chess/AppDelegate.h" new file mode 100644 index 00000000..9ec17fec --- /dev/null +++ "b/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_Chess/AppDelegate.h" @@ -0,0 +1,17 @@ +// +// AppDelegate.h +// Game_Chess +// +// Created by apple on 16/1/3. +// Copyright © 2016年 wxh. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + + +@end + diff --git "a/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_Chess/AppDelegate.m" "b/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_Chess/AppDelegate.m" new file mode 100644 index 00000000..562a1c58 --- /dev/null +++ "b/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_Chess/AppDelegate.m" @@ -0,0 +1,58 @@ +// +// AppDelegate.m +// Game_Chess +// +// Created by apple on 16/1/3. +// Copyright © 2016年 wxh. All rights reserved. +// + +#import "AppDelegate.h" +#import "WXHMainViewController.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + // Override point for customization after application launch. + + self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; + + WXHMainViewController *mainVC = [[WXHMainViewController alloc]initWithNibName:@"WXHMainViewController" bundle:nil]; + // NSLog(@"===%@",mainVC); + UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:mainVC]; + self.window.rootViewController = nav; + + self.window.backgroundColor = [UIColor redColor]; + NSLog(@"%@",self.window.rootViewController); + [self.window makeKeyAndVisible]; + + 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/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_Chess/Assets.xcassets/AppIcon.appiconset/Contents.json" "b/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_Chess/Assets.xcassets/AppIcon.appiconset/Contents.json" new file mode 100644 index 00000000..118c98f7 --- /dev/null +++ "b/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_Chess/Assets.xcassets/AppIcon.appiconset/Contents.json" @@ -0,0 +1,38 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git "a/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_Chess/Base.lproj/LaunchScreen.storyboard" "b/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_Chess/Base.lproj/LaunchScreen.storyboard" new file mode 100644 index 00000000..2e721e18 --- /dev/null +++ "b/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_Chess/Base.lproj/LaunchScreen.storyboard" @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git "a/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_Chess/Base.lproj/Main.storyboard" "b/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_Chess/Base.lproj/Main.storyboard" new file mode 100644 index 00000000..0acde6e7 --- /dev/null +++ "b/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_Chess/Base.lproj/Main.storyboard" @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git "a/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_Chess/Info.plist" "b/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_Chess/Info.plist" new file mode 100644 index 00000000..6905cc67 --- /dev/null +++ "b/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_Chess/Info.plist" @@ -0,0 +1,40 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git "a/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_Chess/ViewController.h" "b/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_Chess/ViewController.h" new file mode 100644 index 00000000..767b3775 --- /dev/null +++ "b/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_Chess/ViewController.h" @@ -0,0 +1,15 @@ +// +// ViewController.h +// Game_Chess +// +// Created by apple on 16/1/3. +// Copyright © 2016年 wxh. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + + +@end + diff --git "a/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_Chess/ViewController.m" "b/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_Chess/ViewController.m" new file mode 100644 index 00000000..13d6b85c --- /dev/null +++ "b/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_Chess/ViewController.m" @@ -0,0 +1,27 @@ +// +// ViewController.m +// Game_Chess +// +// Created by apple on 16/1/3. +// Copyright © 2016年 wxh. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +@end diff --git "a/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_Chess/WXHGameAreaView.h" "b/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_Chess/WXHGameAreaView.h" new file mode 100644 index 00000000..b6ab6b3e --- /dev/null +++ "b/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_Chess/WXHGameAreaView.h" @@ -0,0 +1,18 @@ +// +// WXHGameAreaView.h +// Game_Chess +// +// Created by apple on 16/1/3. +// Copyright © 2016年 wxh. All rights reserved. +// + +#import +#import "WXHParent.h" +@interface WXHGameAreaView : UIView + +@property (nonatomic,assign) GAMESTATE gameState; + +- (void)onInitNodesWithPlayer:(WXHParent*)player; +- (void)onCalculateNodeNum; +- (void)onJudgeWinForPlayer:(WXHParent*)player OtherPlayer:(WXHParent*)OtherPlayer; +@end diff --git "a/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_Chess/WXHGameAreaView.m" "b/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_Chess/WXHGameAreaView.m" new file mode 100644 index 00000000..c57442ab --- /dev/null +++ "b/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_Chess/WXHGameAreaView.m" @@ -0,0 +1,172 @@ +// +// WXHGameAreaView.m +// Game_Chess +// +// Created by apple on 16/1/3. +// Copyright © 2016年 wxh. All rights reserved. +// + + +#import "WXHGameAreaView.h" +#import "WXHNode.h" +#import "WXHDefine.h" +#import "WXHEnum.h" +#import "WXHUtils.h" + +#define kNodeWidth (kScreenWidth - 40) / 8 + + +@implementation WXHGameAreaView +{ + int blackNum; + int whiteNum; + + UILabel *blackLabel; + UILabel *whiteLabel; + +} + +- (id)initWithFrame:(CGRect)frame +{ + self = [super initWithFrame:frame]; + if (self) { + // Initialization code + + } + return self; +} + +- (void)awakeFromNib +{ + blackLabel =(UILabel*)[self viewWithTag:-1000]; + whiteLabel =(UILabel*)[self viewWithTag:-1001]; + [self onCreateNodes]; +} + +// 监听棋子点击 +- (void)onNodeClick:(WXHNode*)node +{ + + NSLog(@"testttttt"); + [[NSNotificationCenter defaultCenter]postNotificationName:WXHPlayerDownNodeNotification object:node]; + NSLog(@"test== %s",__func__); +} + +// 创建棋子到棋盘上 +- (void)onCreateNodes +{ + int k=0; + for (int i=0; i whiteNum) { + _gameState = GAMEOVER; + kAlert(kBlackWin); + return; + } + if (whiteNum > blackNum) { + _gameState = GAMEOVER; + kAlert(kWhiteWin); + return; + } + if (whiteNum == blackNum) { + _gameState = GAMEOVER; + kAlert(kDoubleWin); + return; + } + + } +} + + +// Only override drawRect: if you perform custom drawing. +// An empty implementation adversely affects performance during animation. +- (void)drawRect:(CGRect)rect +{ + // Drawing code + [super drawRect:rect]; + + //画棋盘 + CGContextRef ctx = UIGraphicsGetCurrentContext(); + for (int i=0; i<=kSize; i++) { //画横线 + CGContextSetLineWidth(ctx, (i == 0 || i==kSize)?5:2.0); + CGContextSetStrokeColorWithColor(ctx, [[UIColor purpleColor] CGColor]); + CGContextMoveToPoint(ctx, 10,10+kNodeWidth*i); + CGContextAddLineToPoint(ctx, 10+kNodeWidth*kSize, 10+kNodeWidth*i); + CGContextStrokePath(ctx); + } + + + for (int i=0; i<=kSize; i++) { //画竖线 + CGContextSetLineWidth(ctx, (i == 0 || i==kSize)?5:2.0); + CGContextSetStrokeColorWithColor(ctx, [[UIColor purpleColor] CGColor]); + CGContextMoveToPoint(ctx, 10+kNodeWidth*i,10); + CGContextAddLineToPoint(ctx, 10+kNodeWidth*i, 10+kNodeWidth*kSize); + CGContextStrokePath(ctx); + } + +} + +@end diff --git "a/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_Chess/main.m" "b/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_Chess/main.m" new file mode 100644 index 00000000..3d3e187c --- /dev/null +++ "b/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_Chess/main.m" @@ -0,0 +1,16 @@ +// +// main.m +// Game_Chess +// +// Created by apple on 16/1/3. +// Copyright © 2016年 wxh. 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/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_Chess/sound.wav" "b/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_Chess/sound.wav" new file mode 100644 index 00000000..5642f4ff Binary files /dev/null and "b/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_Chess/sound.wav" differ diff --git "a/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_ChessTests/Game_ChessTests.m" "b/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_ChessTests/Game_ChessTests.m" new file mode 100644 index 00000000..5cee5d20 --- /dev/null +++ "b/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_ChessTests/Game_ChessTests.m" @@ -0,0 +1,39 @@ +// +// Game_ChessTests.m +// Game_ChessTests +// +// Created by apple on 16/1/3. +// Copyright © 2016年 wxh. All rights reserved. +// + +#import + +@interface Game_ChessTests : XCTestCase + +@end + +@implementation Game_ChessTests + +- (void)setUp { + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown { + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct results. +} + +- (void)testPerformanceExample { + // This is an example of a performance test case. + [self measureBlock:^{ + // Put the code you want to measure the time of here. + }]; +} + +@end diff --git "a/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_ChessTests/Info.plist" "b/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_ChessTests/Info.plist" new file mode 100644 index 00000000..ba72822e --- /dev/null +++ "b/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_ChessTests/Info.plist" @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git "a/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_ChessUITests/Game_ChessUITests.m" "b/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_ChessUITests/Game_ChessUITests.m" new file mode 100644 index 00000000..ddee3c99 --- /dev/null +++ "b/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_ChessUITests/Game_ChessUITests.m" @@ -0,0 +1,40 @@ +// +// Game_ChessUITests.m +// Game_ChessUITests +// +// Created by apple on 16/1/3. +// Copyright © 2016年 wxh. All rights reserved. +// + +#import + +@interface Game_ChessUITests : XCTestCase + +@end + +@implementation Game_ChessUITests + +- (void)setUp { + [super setUp]; + + // Put setup code here. This method is called before the invocation of each test method in the class. + + // In UI tests it is usually best to stop immediately when a failure occurs. + self.continueAfterFailure = NO; + // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. + [[[XCUIApplication alloc] init] launch]; + + // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. +} + +- (void)tearDown { + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample { + // Use recording to get started writing UI tests. + // Use XCTAssert and related functions to verify your tests produce the correct results. +} + +@end diff --git "a/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_ChessUITests/Info.plist" "b/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_ChessUITests/Info.plist" new file mode 100644 index 00000000..ba72822e --- /dev/null +++ "b/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/Game_Chess/Game_ChessUITests/Info.plist" @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git "a/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/\345\233\264\346\243\213.docx" "b/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/\345\233\264\346\243\213.docx" new file mode 100644 index 00000000..7b8ce678 Binary files /dev/null and "b/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/\345\233\264\346\243\213.docx" differ diff --git "a/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/\345\233\264\346\243\213PPT.pptx" "b/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/\345\233\264\346\243\213PPT.pptx" new file mode 100644 index 00000000..431f303c Binary files /dev/null and "b/21551073-\347\216\213\346\231\223\347\272\242/IOS\345\244\247\344\275\234\344\270\232/\345\233\264\346\243\213PPT.pptx" differ