diff --git "a/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2.xcodeproj/project.pbxproj" "b/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2.xcodeproj/project.pbxproj" new file mode 100755 index 0000000..c621a52 --- /dev/null +++ "b/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2.xcodeproj/project.pbxproj" @@ -0,0 +1,333 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 68884DFC1DB4E8C200BFA355 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 68884DFB1DB4E8C200BFA355 /* main.m */; }; + 68884DFF1DB4E8C200BFA355 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 68884DFE1DB4E8C200BFA355 /* AppDelegate.m */; }; + 68884E021DB4E8C200BFA355 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 68884E011DB4E8C200BFA355 /* ViewController.m */; }; + 68884E051DB4E8C200BFA355 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 68884E031DB4E8C200BFA355 /* Main.storyboard */; }; + 68884E071DB4E8C200BFA355 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 68884E061DB4E8C200BFA355 /* Assets.xcassets */; }; + 68884E0A1DB4E8C200BFA355 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 68884E081DB4E8C200BFA355 /* LaunchScreen.storyboard */; }; + 68884E121DB4EB5700BFA355 /* MONACO.TTF in Resources */ = {isa = PBXBuildFile; fileRef = 68884E111DB4EB5700BFA355 /* MONACO.TTF */; }; + 68884E441DB4F40100BFA355 /* CalView.m in Sources */ = {isa = PBXBuildFile; fileRef = 68884E431DB4F40100BFA355 /* CalView.m */; }; + 68884E471DB4F62B00BFA355 /* SLCal.m in Sources */ = {isa = PBXBuildFile; fileRef = 68884E461DB4F62B00BFA355 /* SLCal.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 68884DF71DB4E8C200BFA355 /* Cal2.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Cal2.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 68884DFB1DB4E8C200BFA355 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 68884DFD1DB4E8C200BFA355 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 68884DFE1DB4E8C200BFA355 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 68884E001DB4E8C200BFA355 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 68884E011DB4E8C200BFA355 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 68884E041DB4E8C200BFA355 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 68884E061DB4E8C200BFA355 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 68884E091DB4E8C200BFA355 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 68884E0B1DB4E8C200BFA355 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 68884E111DB4EB5700BFA355 /* MONACO.TTF */ = {isa = PBXFileReference; lastKnownFileType = file; path = MONACO.TTF; sourceTree = ""; }; + 68884E421DB4F40100BFA355 /* CalView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CalView.h; sourceTree = ""; }; + 68884E431DB4F40100BFA355 /* CalView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CalView.m; sourceTree = ""; }; + 68884E451DB4F62B00BFA355 /* SLCal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SLCal.h; sourceTree = ""; }; + 68884E461DB4F62B00BFA355 /* SLCal.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SLCal.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 68884DF41DB4E8C200BFA355 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 68884DEE1DB4E8C200BFA355 = { + isa = PBXGroup; + children = ( + 68884DF91DB4E8C200BFA355 /* Cal2 */, + 68884DF81DB4E8C200BFA355 /* Products */, + ); + sourceTree = ""; + }; + 68884DF81DB4E8C200BFA355 /* Products */ = { + isa = PBXGroup; + children = ( + 68884DF71DB4E8C200BFA355 /* Cal2.app */, + ); + name = Products; + sourceTree = ""; + }; + 68884DF91DB4E8C200BFA355 /* Cal2 */ = { + isa = PBXGroup; + children = ( + 68884E451DB4F62B00BFA355 /* SLCal.h */, + 68884E461DB4F62B00BFA355 /* SLCal.m */, + 68884E421DB4F40100BFA355 /* CalView.h */, + 68884E431DB4F40100BFA355 /* CalView.m */, + 68884DFD1DB4E8C200BFA355 /* AppDelegate.h */, + 68884DFE1DB4E8C200BFA355 /* AppDelegate.m */, + 68884E001DB4E8C200BFA355 /* ViewController.h */, + 68884E011DB4E8C200BFA355 /* ViewController.m */, + 68884E031DB4E8C200BFA355 /* Main.storyboard */, + 68884E061DB4E8C200BFA355 /* Assets.xcassets */, + 68884E081DB4E8C200BFA355 /* LaunchScreen.storyboard */, + 68884E0B1DB4E8C200BFA355 /* Info.plist */, + 68884DFA1DB4E8C200BFA355 /* Supporting Files */, + ); + path = Cal2; + sourceTree = ""; + }; + 68884DFA1DB4E8C200BFA355 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 68884E111DB4EB5700BFA355 /* MONACO.TTF */, + 68884DFB1DB4E8C200BFA355 /* main.m */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 68884DF61DB4E8C200BFA355 /* Cal2 */ = { + isa = PBXNativeTarget; + buildConfigurationList = 68884E0E1DB4E8C200BFA355 /* Build configuration list for PBXNativeTarget "Cal2" */; + buildPhases = ( + 68884DF31DB4E8C200BFA355 /* Sources */, + 68884DF41DB4E8C200BFA355 /* Frameworks */, + 68884DF51DB4E8C200BFA355 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Cal2; + productName = Cal2; + productReference = 68884DF71DB4E8C200BFA355 /* Cal2.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 68884DEF1DB4E8C200BFA355 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0810; + ORGANIZATIONNAME = zju; + TargetAttributes = { + 68884DF61DB4E8C200BFA355 = { + CreatedOnToolsVersion = 8.1; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = 68884DF21DB4E8C200BFA355 /* Build configuration list for PBXProject "Cal2" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 68884DEE1DB4E8C200BFA355; + productRefGroup = 68884DF81DB4E8C200BFA355 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 68884DF61DB4E8C200BFA355 /* Cal2 */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 68884DF51DB4E8C200BFA355 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 68884E0A1DB4E8C200BFA355 /* LaunchScreen.storyboard in Resources */, + 68884E071DB4E8C200BFA355 /* Assets.xcassets in Resources */, + 68884E051DB4E8C200BFA355 /* Main.storyboard in Resources */, + 68884E121DB4EB5700BFA355 /* MONACO.TTF in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 68884DF31DB4E8C200BFA355 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 68884E471DB4F62B00BFA355 /* SLCal.m in Sources */, + 68884E021DB4E8C200BFA355 /* ViewController.m in Sources */, + 68884DFF1DB4E8C200BFA355 /* AppDelegate.m in Sources */, + 68884DFC1DB4E8C200BFA355 /* main.m in Sources */, + 68884E441DB4F40100BFA355 /* CalView.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 68884E031DB4E8C200BFA355 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 68884E041DB4E8C200BFA355 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 68884E081DB4E8C200BFA355 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 68884E091DB4E8C200BFA355 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 68884E0C1DB4E8C200BFA355 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.2; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 68884E0D1DB4E8C200BFA355 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.2; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 68884E0F1DB4E8C200BFA355 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = Cal2/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.zju.Cal2; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 68884E101DB4E8C200BFA355 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = Cal2/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.zju.Cal2; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 68884DF21DB4E8C200BFA355 /* Build configuration list for PBXProject "Cal2" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 68884E0C1DB4E8C200BFA355 /* Debug */, + 68884E0D1DB4E8C200BFA355 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 68884E0E1DB4E8C200BFA355 /* Build configuration list for PBXNativeTarget "Cal2" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 68884E0F1DB4E8C200BFA355 /* Debug */, + 68884E101DB4E8C200BFA355 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 68884DEF1DB4E8C200BFA355 /* Project object */; +} diff --git "a/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2/AppDelegate.h" "b/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2/AppDelegate.h" new file mode 100755 index 0000000..81c8957 --- /dev/null +++ "b/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2/AppDelegate.h" @@ -0,0 +1,17 @@ +// +// AppDelegate.h +// Cal2 +// +// Created by 刘凯敏 on 17/10/2016. +// Copyright © 2016 刘凯敏. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + + +@end + diff --git "a/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2/AppDelegate.m" "b/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2/AppDelegate.m" new file mode 100755 index 0000000..a0da158 --- /dev/null +++ "b/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2/AppDelegate.m" @@ -0,0 +1,51 @@ +// +// AppDelegate.m +// Cal2 +// +// Created by 刘凯敏 on 17/10/2016. +// Copyright © 2016 刘凯敏. All rights reserved. +// + +#import "AppDelegate.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + // Override point for customization after application launch. + return YES; +} + + +- (void)applicationWillResignActive:(UIApplication *)application { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. 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 active 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/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2/Assets.xcassets/AppIcon.appiconset/Contents.json" "b/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2/Assets.xcassets/AppIcon.appiconset/Contents.json" new file mode 100755 index 0000000..b8236c6 --- /dev/null +++ "b/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2/Assets.xcassets/AppIcon.appiconset/Contents.json" @@ -0,0 +1,48 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git "a/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2/Base.lproj/LaunchScreen.storyboard" "b/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2/Base.lproj/LaunchScreen.storyboard" new file mode 100755 index 0000000..fdf3f97 --- /dev/null +++ "b/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2/Base.lproj/LaunchScreen.storyboard" @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git "a/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2/Base.lproj/Main.storyboard" "b/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2/Base.lproj/Main.storyboard" new file mode 100755 index 0000000..a010e6d --- /dev/null +++ "b/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2/Base.lproj/Main.storyboard" @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git "a/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2/CalView.h" "b/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2/CalView.h" new file mode 100755 index 0000000..edfae41 --- /dev/null +++ "b/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2/CalView.h" @@ -0,0 +1,13 @@ +// +// CalView.h +// Cal2 +// +// Created by 刘凯敏 on 17/10/2016. +// Copyright © 2016 刘凯敏. All rights reserved. +// + +#import + +@interface CalView : UIView + +@end diff --git "a/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2/CalView.m" "b/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2/CalView.m" new file mode 100755 index 0000000..794d6fd --- /dev/null +++ "b/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2/CalView.m" @@ -0,0 +1,42 @@ +// +// CalView.m +// Cal2 +// +// Created by 刘凯敏 on 17/10/2016. +// Copyright © 2016 刘凯敏. All rights reserved. +// + +#import "CalView.h" +#import "SLCal.h" + +@interface CalView () + +@property (nonatomic, copy) NSString *dateStr; +@property (nonatomic, strong) NSDictionary *attrs; + +@end + +@implementation CalView + +- (void)awakeFromNib { + [super awakeFromNib]; + NSMutableDictionary *attrs = @{}.mutableCopy; + self.attrs = attrs; + attrs[NSForegroundColorAttributeName] = [UIColor blackColor]; + attrs[NSFontAttributeName] = [UIFont fontWithName:@"Monaco" size:14.0f]; + CGRect frame = self.frame; + self.dateStr = [SLCal calendarWithArgc:1 argv:NULL]; + frame.size = [self.dateStr sizeWithAttributes:attrs]; + self.frame = frame; +} + +- (void)drawRect:(CGRect)rect { + [self.dateStr drawInRect:self.bounds withAttributes:self.attrs]; +} + +- (void)layoutSubviews { + [super layoutSubviews]; + self.center = self.superview.center; +} + +@end diff --git "a/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2/Info.plist" "b/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2/Info.plist" new file mode 100755 index 0000000..7e849f3 --- /dev/null +++ "b/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2/Info.plist" @@ -0,0 +1,42 @@ + + + + + UIAppFonts + + MONACO.TTF + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git "a/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2/MONACO.TTF" "b/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2/MONACO.TTF" new file mode 100755 index 0000000..57217b3 Binary files /dev/null and "b/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2/MONACO.TTF" differ diff --git "a/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2/SLCal.h" "b/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2/SLCal.h" new file mode 100755 index 0000000..333e5b3 --- /dev/null +++ "b/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2/SLCal.h" @@ -0,0 +1,15 @@ +// +// SLCal.h +// Cal_Lichao +// +// Created by 刘凯敏 on 1/10/2016. +// Copyright © 2016 刘凯敏. All rights reserved. +// + +#import + +@interface SLCal : NSObject + ++ (NSString *)calendarWithArgc:(int)argc argv:(const char **)argv; + +@end diff --git "a/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2/SLCal.m" "b/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2/SLCal.m" new file mode 100755 index 0000000..4b9decb --- /dev/null +++ "b/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2/SLCal.m" @@ -0,0 +1,164 @@ +// +// SLCal.m +// Cal_Lichao +// +// Created by 刘凯敏 on 1/10/2016. +// Copyright © 2016 刘凯敏. All rights reserved. +// + +#import "SLCal.h" + +@implementation SLCal + ++ (NSString *)calendarWithArgc:(int)argc argv:(const char **)argv { + switch (argc) { + case 1: + return [self calendarForDate:[NSDate date]]; + break; + case 2: {// 年份 + int y = atoi(argv[1]); + return [self calendarForYear:y]; + break; + } + case 3: { + int m = atoi(argv[1]); + int y = atoi(argv[2]); + NSDateFormatter *formatter = [NSDateFormatter new]; + formatter.dateFormat = @"yyyy-MM"; + NSDate *date = [formatter dateFromString:[NSString stringWithFormat:@"%04d-%02d",y,m]]; + return [self calendarForDate:date]; + break; + } + default: + break; + } + return nil; +} + ++ (NSString *)calendarForDate:(NSDate *)date { + NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian]; + // 计算该月天数 + NSRange range = [calendar rangeOfUnit:NSCalendarUnitDay inUnit:NSCalendarUnitMonth forDate:date]; + NSInteger dayLen = range.length; + // 生成这个月的第一天date对象 + NSDateFormatter *formatter = [NSDateFormatter new]; + formatter.dateFormat = @"yyyy MM"; + NSDateComponents *components = [calendar components:NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay | NSCalendarUnitWeekday fromDate:date]; + NSString *firstDayStr = [NSString stringWithFormat:@"%04d %02d",(int)components.year, (int)components.month]; + NSDate *firstDay = [formatter dateFromString:firstDayStr]; + NSString *title = [formatter stringFromDate:date]; + components = [calendar components:NSCalendarUnitWeekday fromDate:firstDay]; + int weekDay = (int)components.weekday - 1; + // 开始处理输出 + NSMutableString *ret = @"".mutableCopy; + [ret appendFormat:@" %@\nSu Mo Tu We Th Fr Sa\n", title]; + int currentDay = 1; + int lineCount = 0; + while (weekDay > 0) { + weekDay--; + lineCount++; + [ret appendFormat:@" "]; + } + BOOL first = YES; + while (lineCount < 7) { + if (first) { + first = NO; + [ret appendFormat:@"%2d", currentDay]; + } else { + [ret appendFormat:@" %2d", currentDay]; + } + currentDay++; + lineCount++; + } + lineCount = 0; + [ret appendFormat:@"\n"]; + while (currentDay <= dayLen) { + if (lineCount == 0) { + [ret appendFormat:@"%2d", currentDay]; + }else { + [ret appendFormat:@" %2d", currentDay]; + } + lineCount++; + currentDay++; + if (lineCount == 7) { + lineCount = 0; + [ret appendFormat:@"\n"]; + } + } + return ret; +} + ++ (NSString *)calendarForYear:(int)year { + NSMutableString *ret = @"".mutableCopy; + NSDateFormatter *formatter = [NSDateFormatter new]; + formatter.dateFormat = @"yyyy MM"; + NSMutableArray *comps = @[].mutableCopy; + for (int i = 1; i <= 12; i++) { + NSString *dateStr = [NSString stringWithFormat:@"%04d %02d",year, i]; + NSDate *date = [formatter dateFromString:dateStr]; + [comps addObject:[self calendarForDate:date]]; + } + // 每三个月占一大行,每一小行都是这三个月的一小行拼接起来的 + // 一共3*4=12个月,因此循环4次 + for (int line = 0; line < 4; line++){ + // 对于每一行,取3个月的输出,按行拼接 + NSMutableArray *> *calLines = @[].mutableCopy; + NSInteger maxLineCount = 0; + for (int i = line * 3; i < line * 3 + 3; i++) { + // 按照回车符分割行 + NSArray *lines = [comps[i] componentsSeparatedByString:@"\n"]; + NSMutableArray *lines_temp = lines.mutableCopy; + NSString *lastLine = [lines_temp lastObject]; + if (lastLine.length == 0) [lines_temp removeLastObject]; + for (NSInteger i = 1; i < lines_temp.count; i++) { + NSString *str = lines_temp[i]; + NSInteger len = str.length; + while (len < 20) { + str = [str stringByAppendingString:@" "]; + len++; + } + lines_temp[i] = str; + } + lines = lines_temp; + [calLines addObject:lines]; + if (lines.count > maxLineCount) { + maxLineCount = lines.count; + } + } + // 开始按照整行输出 + NSMutableString *line = @"".mutableCopy; + // 对于这3个月每个月的每一行 + for (int l = 0; l < maxLineCount; l++) { + BOOL first = YES; + for (int m = 0; m < 3; m++) { + NSArray *lines = calLines[m]; + if (l < lines.count) { + if (first) { + first = NO; + [line appendFormat:@"%@", lines[l]]; + } else { + if (l == 0) { // 标题行,缩进更多 + [line appendFormat:@" %@", lines[l]]; + } else { + NSString *lineToAppend = lines[l]; + [line appendFormat:@" %@", lineToAppend]; + if (lineToAppend.length < 20) { + NSInteger delta = 20 - lineToAppend.length; + while(delta--) { + [line appendString:@" "]; + } + } + } + } + } else { + [line appendString:@" "]; + } + } + [line appendString:@"\n"]; + } + [ret appendFormat:@"%@\n", line]; + } + return ret; +} + +@end diff --git "a/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2/ViewController.h" "b/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2/ViewController.h" new file mode 100755 index 0000000..efd9862 --- /dev/null +++ "b/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2/ViewController.h" @@ -0,0 +1,15 @@ +// +// ViewController.h +// Cal2 +// +// Created by 刘凯敏 on 17/10/2016. +// Copyright © 2016 刘凯敏. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + + +@end + diff --git "a/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2/ViewController.m" "b/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2/ViewController.m" new file mode 100755 index 0000000..0adfe8c --- /dev/null +++ "b/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2/ViewController.m" @@ -0,0 +1,21 @@ +// +// ViewController.m +// Cal2 +// +// Created by 刘凯敏 on 17/10/2016. +// Copyright © 2016 刘凯敏. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad { + [super viewDidLoad]; +} + +@end diff --git "a/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2/main.m" "b/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2/main.m" new file mode 100755 index 0000000..3f50028 --- /dev/null +++ "b/21651074\345\210\230\345\207\257\346\225\217/project02/Cal2/main.m" @@ -0,0 +1,16 @@ +// +// main.m +// Cal2 +// +// Created by 刘凯敏 on 17/10/2016. +// Copyright © 2016 刘凯敏. 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/21651074\345\210\230\345\207\257\346\225\217/project03/taskList.xcodeproj/project.pbxproj" "b/21651074\345\210\230\345\207\257\346\225\217/project03/taskList.xcodeproj/project.pbxproj" new file mode 100755 index 0000000..c76802c --- /dev/null +++ "b/21651074\345\210\230\345\207\257\346\225\217/project03/taskList.xcodeproj/project.pbxproj" @@ -0,0 +1,346 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 484A5E811DB89CEC00F65EAA /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 484A5E801DB89CEC00F65EAA /* main.m */; }; + 484A5E841DB89CEC00F65EAA /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 484A5E831DB89CEC00F65EAA /* AppDelegate.m */; }; + 484A5E8A1DB89CEC00F65EAA /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 484A5E881DB89CEC00F65EAA /* Main.storyboard */; }; + 484A5E8C1DB89CEC00F65EAA /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 484A5E8B1DB89CEC00F65EAA /* Assets.xcassets */; }; + 484A5E8F1DB89CEC00F65EAA /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 484A5E8D1DB89CEC00F65EAA /* LaunchScreen.storyboard */; }; + 48E4E7F91DB9DE460084A32F /* LJHtaskViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 48E4E7F81DB9DE460084A32F /* LJHtaskViewController.m */; }; + 48E9B8A41DBE39C30055783C /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 48E9B8A31DBE39C30055783C /* QuartzCore.framework */; }; + 48EE43E11DB8BCFB005628F1 /* LJHtaskTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 48EE43DF1DB8BCFB005628F1 /* LJHtaskTableViewCell.m */; }; + 48EE43E21DB8BCFB005628F1 /* LJHtaskTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 48EE43E01DB8BCFB005628F1 /* LJHtaskTableViewCell.xib */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 484A5E7C1DB89CEC00F65EAA /* taskList.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = taskList.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 484A5E801DB89CEC00F65EAA /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 484A5E821DB89CEC00F65EAA /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 484A5E831DB89CEC00F65EAA /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 484A5E891DB89CEC00F65EAA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 484A5E8B1DB89CEC00F65EAA /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 484A5E8E1DB89CEC00F65EAA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 484A5E901DB89CEC00F65EAA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 48E4E7F71DB9DE460084A32F /* LJHtaskViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LJHtaskViewController.h; sourceTree = ""; }; + 48E4E7F81DB9DE460084A32F /* LJHtaskViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LJHtaskViewController.m; sourceTree = ""; }; + 48E9B8A31DBE39C30055783C /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; + 48EE43DE1DB8BCFB005628F1 /* LJHtaskTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LJHtaskTableViewCell.h; sourceTree = ""; }; + 48EE43DF1DB8BCFB005628F1 /* LJHtaskTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LJHtaskTableViewCell.m; sourceTree = ""; }; + 48EE43E01DB8BCFB005628F1 /* LJHtaskTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = LJHtaskTableViewCell.xib; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 484A5E791DB89CEC00F65EAA /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 48E9B8A41DBE39C30055783C /* QuartzCore.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 484A5E731DB89CEC00F65EAA = { + isa = PBXGroup; + children = ( + 484A5E7E1DB89CEC00F65EAA /* taskList */, + 484A5E7D1DB89CEC00F65EAA /* Products */, + 48E9B89C1DBE38350055783C /* Frameworks */, + ); + sourceTree = ""; + }; + 484A5E7D1DB89CEC00F65EAA /* Products */ = { + isa = PBXGroup; + children = ( + 484A5E7C1DB89CEC00F65EAA /* taskList.app */, + ); + name = Products; + sourceTree = ""; + }; + 484A5E7E1DB89CEC00F65EAA /* taskList */ = { + isa = PBXGroup; + children = ( + 48E4E7F71DB9DE460084A32F /* LJHtaskViewController.h */, + 48E4E7F81DB9DE460084A32F /* LJHtaskViewController.m */, + 484A5E821DB89CEC00F65EAA /* AppDelegate.h */, + 484A5E831DB89CEC00F65EAA /* AppDelegate.m */, + 484A5E881DB89CEC00F65EAA /* Main.storyboard */, + 484A5E8B1DB89CEC00F65EAA /* Assets.xcassets */, + 484A5E8D1DB89CEC00F65EAA /* LaunchScreen.storyboard */, + 484A5E901DB89CEC00F65EAA /* Info.plist */, + 48EE43DE1DB8BCFB005628F1 /* LJHtaskTableViewCell.h */, + 48EE43DF1DB8BCFB005628F1 /* LJHtaskTableViewCell.m */, + 48EE43E01DB8BCFB005628F1 /* LJHtaskTableViewCell.xib */, + 484A5E7F1DB89CEC00F65EAA /* Supporting Files */, + ); + path = taskList; + sourceTree = ""; + }; + 484A5E7F1DB89CEC00F65EAA /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 484A5E801DB89CEC00F65EAA /* main.m */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 48E9B89C1DBE38350055783C /* Frameworks */ = { + isa = PBXGroup; + children = ( + 48E9B8A31DBE39C30055783C /* QuartzCore.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 484A5E7B1DB89CEC00F65EAA /* taskList */ = { + isa = PBXNativeTarget; + buildConfigurationList = 484A5E931DB89CEC00F65EAA /* Build configuration list for PBXNativeTarget "taskList" */; + buildPhases = ( + 484A5E781DB89CEC00F65EAA /* Sources */, + 484A5E791DB89CEC00F65EAA /* Frameworks */, + 484A5E7A1DB89CEC00F65EAA /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = taskList; + productName = taskList; + productReference = 484A5E7C1DB89CEC00F65EAA /* taskList.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 484A5E741DB89CEC00F65EAA /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0800; + ORGANIZATIONNAME = "李江浩"; + TargetAttributes = { + 484A5E7B1DB89CEC00F65EAA = { + CreatedOnToolsVersion = 8.0; + DevelopmentTeam = R9YBSZ4EG3; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = 484A5E771DB89CEC00F65EAA /* Build configuration list for PBXProject "taskList" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 484A5E731DB89CEC00F65EAA; + productRefGroup = 484A5E7D1DB89CEC00F65EAA /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 484A5E7B1DB89CEC00F65EAA /* taskList */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 484A5E7A1DB89CEC00F65EAA /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 484A5E8F1DB89CEC00F65EAA /* LaunchScreen.storyboard in Resources */, + 48EE43E21DB8BCFB005628F1 /* LJHtaskTableViewCell.xib in Resources */, + 484A5E8C1DB89CEC00F65EAA /* Assets.xcassets in Resources */, + 484A5E8A1DB89CEC00F65EAA /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 484A5E781DB89CEC00F65EAA /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 484A5E841DB89CEC00F65EAA /* AppDelegate.m in Sources */, + 48EE43E11DB8BCFB005628F1 /* LJHtaskTableViewCell.m in Sources */, + 48E4E7F91DB9DE460084A32F /* LJHtaskViewController.m in Sources */, + 484A5E811DB89CEC00F65EAA /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 484A5E881DB89CEC00F65EAA /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 484A5E891DB89CEC00F65EAA /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 484A5E8D1DB89CEC00F65EAA /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 484A5E8E1DB89CEC00F65EAA /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 484A5E911DB89CEC00F65EAA /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 484A5E921DB89CEC00F65EAA /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 484A5E941DB89CEC00F65EAA /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + DEVELOPMENT_TEAM = R9YBSZ4EG3; + INFOPLIST_FILE = taskList/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_BUNDLE_IDENTIFIER = "-37990443-qq.com.taskList"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 484A5E951DB89CEC00F65EAA /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + DEVELOPMENT_TEAM = R9YBSZ4EG3; + INFOPLIST_FILE = taskList/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_BUNDLE_IDENTIFIER = "-37990443-qq.com.taskList"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 484A5E771DB89CEC00F65EAA /* Build configuration list for PBXProject "taskList" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 484A5E911DB89CEC00F65EAA /* Debug */, + 484A5E921DB89CEC00F65EAA /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 484A5E931DB89CEC00F65EAA /* Build configuration list for PBXNativeTarget "taskList" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 484A5E941DB89CEC00F65EAA /* Debug */, + 484A5E951DB89CEC00F65EAA /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 484A5E741DB89CEC00F65EAA /* Project object */; +} diff --git "a/21651074\345\210\230\345\207\257\346\225\217/project03/taskList/AppDelegate.h" "b/21651074\345\210\230\345\207\257\346\225\217/project03/taskList/AppDelegate.h" new file mode 100755 index 0000000..d36020c --- /dev/null +++ "b/21651074\345\210\230\345\207\257\346\225\217/project03/taskList/AppDelegate.h" @@ -0,0 +1,16 @@ +// +// AppDelegate.h +// taskList +// +// Created by 刘凯敏 on 2016/10/20. +// Copyright © 2016年 刘凯敏. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end + diff --git "a/21651074\345\210\230\345\207\257\346\225\217/project03/taskList/AppDelegate.m" "b/21651074\345\210\230\345\207\257\346\225\217/project03/taskList/AppDelegate.m" new file mode 100755 index 0000000..2144db0 --- /dev/null +++ "b/21651074\345\210\230\345\207\257\346\225\217/project03/taskList/AppDelegate.m" @@ -0,0 +1,51 @@ +// +// AppDelegate.m +// taskList +// +// Created by 刘凯敏 on 2016/10/20. +// Copyright © 2016年 刘凯敏. All rights reserved. +// + +#import "AppDelegate.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + // Override point for customization after application launch. + return YES; +} + + +- (void)applicationWillResignActive:(UIApplication *)application { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. 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 active 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/21651074\345\210\230\345\207\257\346\225\217/project03/taskList/Assets.xcassets/AppIcon.appiconset/Contents.json" "b/21651074\345\210\230\345\207\257\346\225\217/project03/taskList/Assets.xcassets/AppIcon.appiconset/Contents.json" new file mode 100755 index 0000000..1d060ed --- /dev/null +++ "b/21651074\345\210\230\345\207\257\346\225\217/project03/taskList/Assets.xcassets/AppIcon.appiconset/Contents.json" @@ -0,0 +1,93 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git "a/21651074\345\210\230\345\207\257\346\225\217/project03/taskList/Base.lproj/LaunchScreen.storyboard" "b/21651074\345\210\230\345\207\257\346\225\217/project03/taskList/Base.lproj/LaunchScreen.storyboard" new file mode 100755 index 0000000..fdf3f97 --- /dev/null +++ "b/21651074\345\210\230\345\207\257\346\225\217/project03/taskList/Base.lproj/LaunchScreen.storyboard" @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git "a/21651074\345\210\230\345\207\257\346\225\217/project03/taskList/Base.lproj/Main.storyboard" "b/21651074\345\210\230\345\207\257\346\225\217/project03/taskList/Base.lproj/Main.storyboard" new file mode 100755 index 0000000..c25e67b --- /dev/null +++ "b/21651074\345\210\230\345\207\257\346\225\217/project03/taskList/Base.lproj/Main.storyboard" @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git "a/21651074\345\210\230\345\207\257\346\225\217/project03/taskList/Info.plist" "b/21651074\345\210\230\345\207\257\346\225\217/project03/taskList/Info.plist" new file mode 100755 index 0000000..d052473 --- /dev/null +++ "b/21651074\345\210\230\345\207\257\346\225\217/project03/taskList/Info.plist" @@ -0,0 +1,45 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git "a/21651074\345\210\230\345\207\257\346\225\217/project03/taskList/LJHtaskTableViewCell.h" "b/21651074\345\210\230\345\207\257\346\225\217/project03/taskList/LJHtaskTableViewCell.h" new file mode 100755 index 0000000..ab0cc9f --- /dev/null +++ "b/21651074\345\210\230\345\207\257\346\225\217/project03/taskList/LJHtaskTableViewCell.h" @@ -0,0 +1,22 @@ +// +// LJHtaskTableViewCell.h +// taskList +// +// Created by 刘凯敏 on 2016/10/20. +// Copyright © 2016年 刘凯敏. All rights reserved. +// + +#import +@protocol LJHtaskTableViewCellDelegate; +@interface LJHtaskTableViewCell : UITableViewCell + +@property (weak, nonatomic) IBOutlet UILabel *taskLabel; +@property (strong, nonatomic) id delegate; + +@end + +@protocol LJHtaskTableViewCellDelegate + +- (void)finishedTaskTableViewCell:(LJHtaskTableViewCell *)cell; + +@end diff --git "a/21651074\345\210\230\345\207\257\346\225\217/project03/taskList/LJHtaskTableViewCell.m" "b/21651074\345\210\230\345\207\257\346\225\217/project03/taskList/LJHtaskTableViewCell.m" new file mode 100755 index 0000000..7adda02 --- /dev/null +++ "b/21651074\345\210\230\345\207\257\346\225\217/project03/taskList/LJHtaskTableViewCell.m" @@ -0,0 +1,27 @@ +// +// LJHtaskTableViewCell.m +// taskList +// +// Created by 刘凯敏 on 2016/10/20. +// Copyright © 2016年 刘凯敏. All rights reserved. +// + +#import "LJHtaskTableViewCell.h" + +@implementation LJHtaskTableViewCell + +- (void)awakeFromNib { + [super awakeFromNib]; + // Initialization code +} +- (IBAction)taskFinished:(id)sender { + //要删除这条记录,刷新tableView,通知delegate 调用方法 + [self.delegate finishedTaskTableViewCell:self]; +} +- (void)setSelected:(BOOL)selected animated:(BOOL)animated { + [super setSelected:selected animated:animated]; + + // Configure the view for the selected state +} + +@end diff --git "a/21651074\345\210\230\345\207\257\346\225\217/project03/taskList/LJHtaskTableViewCell.xib" "b/21651074\345\210\230\345\207\257\346\225\217/project03/taskList/LJHtaskTableViewCell.xib" new file mode 100755 index 0000000..9ef04a8 --- /dev/null +++ "b/21651074\345\210\230\345\207\257\346\225\217/project03/taskList/LJHtaskTableViewCell.xib" @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git "a/21651074\345\210\230\345\207\257\346\225\217/project03/taskList/LJHtaskViewController.h" "b/21651074\345\210\230\345\207\257\346\225\217/project03/taskList/LJHtaskViewController.h" new file mode 100755 index 0000000..a5801df --- /dev/null +++ "b/21651074\345\210\230\345\207\257\346\225\217/project03/taskList/LJHtaskViewController.h" @@ -0,0 +1,13 @@ +// +// LJHtaskViewController.h +// taskList +// +// Created by 刘凯敏 on 2016/10/20. +// Copyright © 2016年 刘凯敏. All rights reserved. +// + +#import + +@interface LJHtaskViewController : UIViewController + +@end diff --git "a/21651074\345\210\230\345\207\257\346\225\217/project03/taskList/LJHtaskViewController.m" "b/21651074\345\210\230\345\207\257\346\225\217/project03/taskList/LJHtaskViewController.m" new file mode 100755 index 0000000..a7a439a --- /dev/null +++ "b/21651074\345\210\230\345\207\257\346\225\217/project03/taskList/LJHtaskViewController.m" @@ -0,0 +1,107 @@ +// +// LJHtaskViewController.m +// taskList +// +// Created by 刘凯敏 on 2016/10/20. +// Copyright © 2016年 刘凯敏. All rights reserved. +// + +#import "LJHtaskViewController.h" +#import "LJHtaskTableViewCell.h" +//#import "SVProgressHUD/SVProgressHUD.h" +@interface LJHtaskViewController () + +@property (weak, nonatomic) IBOutlet UITableView *taskTableView; +@property (weak, nonatomic) IBOutlet UITextField *taskTextField; +@property (copy, nonatomic) NSArray *taskArray;//待办任务 +@property (copy, nonatomic) NSString *tasksPlistPath; + +@end + +@implementation LJHtaskViewController + +#pragma mark - buttonEvent +- (IBAction)addTask:(id)sender { + //把任务添加到数组中,并且刷新tableView + //NSArray *array = [NSArray array]; + if (![_taskTextField.text isEqualToString:@""]) { + //可以添加到数组中,但要保证是不同的任务 + if (![_taskArray containsObject:_taskTextField.text]) { + _taskArray = [_taskArray arrayByAddingObject:_taskTextField.text]; + [_taskArray writeToFile:_tasksPlistPath atomically:YES]; + [_taskTableView reloadData]; + } + } +} +//- (IBAction)testSVProgressHUD:(id)sender { +// [SVProgressHUD showErrorWithStatus:@"wrong"]; +//} +#pragma mark - View +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. + //在这里读取待办任务 + self.tasksPlistPath = [LJHtaskViewController createTasksPlist];//已经创建了任务清单 + NSArray *tasksArray = [[NSArray alloc]initWithContentsOfFile:_tasksPlistPath]; + self.taskArray = tasksArray; + self.taskTableView.dataSource = self; +} +//收起键盘 +- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ + [self.view endEditing:YES]; //实现该方法是需要注意view需要是继承UIControl而来的 +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - +- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index{ + //可以按照日期来分组,这里暂分1组 + return 1; +} +//有几行 +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ + NSLog(@"%lu",(unsigned long)self.taskArray.count); + return self.taskArray.count; +} +//每一行的cell +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ + //定义标记 + static NSString *cellIdentifier = @"cell"; + //从缓冲池中取出cell + LJHtaskTableViewCell *cell = (LJHtaskTableViewCell *)[tableView dequeueReusableCellWithIdentifier:cellIdentifier]; + //缓冲池中没有cell + if(cell == nil){ + //从xib文件中加载出来 + cell = [[NSBundle mainBundle] loadNibNamed:@"LJHtaskTableViewCell" owner:nil options:nil][0]; + cell.delegate = self; + } + cell.taskLabel.text = self.taskArray[indexPath.row]; + return cell; +} +#pragma mark - +- (void)finishedTaskTableViewCell:(LJHtaskTableViewCell *)cell{ + //在数组中移除任务 + NSString *finishedTask = cell.taskLabel.text; + NSArray *newTasksArray = [NSArray array]; + for (int index = 0; index < _taskArray.count; index ++) { + if (![_taskArray[index] isEqualToString:finishedTask]) { + newTasksArray = [newTasksArray arrayByAddingObject:_taskArray[index]]; + } + } + _taskArray = newTasksArray; + [_taskTableView reloadData]; +} +#pragma mark - other ++ (NSString *)createTasksPlist{ + //获取caches文件路径 + NSArray *path = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES); + //获取完整路径 + NSString *cachesPath = [path objectAtIndex:0]; + NSString *tasksPlistPath = [cachesPath stringByAppendingPathExtension:@"tasks.plist"]; + return tasksPlistPath; +} + +@end diff --git "a/21651074\345\210\230\345\207\257\346\225\217/project03/taskList/main.m" "b/21651074\345\210\230\345\207\257\346\225\217/project03/taskList/main.m" new file mode 100755 index 0000000..625d71d --- /dev/null +++ "b/21651074\345\210\230\345\207\257\346\225\217/project03/taskList/main.m" @@ -0,0 +1,16 @@ +// +// main.m +// taskList +// +// Created by 刘凯敏 on 2016/10/20. +// Copyright © 2016年 刘凯敏. All rights reserved. +// + +#import +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +}