-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
18aedfe
commit 420359e
Showing
11 changed files
with
510 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
CoreNewFeatureVC/CoreNewFeatureVC/Category/UIApplication/UIApplication+Extend.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// | ||
// UIApplication+Extend.h | ||
// Carpenter | ||
// | ||
// Created by 冯成林 on 15/4/24. | ||
// Copyright (c) 2015年 冯成林. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
@interface UIApplication (Extend) | ||
|
||
|
||
/* | ||
* 当前程序的版本号 | ||
*/ | ||
@property (nonatomic,copy,readonly) NSString *version; | ||
|
||
|
||
@end |
27 changes: 27 additions & 0 deletions
27
CoreNewFeatureVC/CoreNewFeatureVC/Category/UIApplication/UIApplication+Extend.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// UIApplication+Extend.m | ||
// Carpenter | ||
// | ||
// Created by 冯成林 on 15/4/24. | ||
// Copyright (c) 2015年 冯成林. All rights reserved. | ||
// | ||
|
||
#import "UIApplication+Extend.h" | ||
|
||
@implementation UIApplication (Extend) | ||
|
||
|
||
/* | ||
* 当前程序的版本号 | ||
*/ | ||
-(NSString *)version{ | ||
|
||
//系统直接读取的版本号 | ||
NSString *versionValueStringForSystemNow=[[NSBundle mainBundle].infoDictionary valueForKey:(NSString *)kCFBundleVersionKey]; | ||
|
||
return versionValueStringForSystemNow; | ||
} | ||
|
||
|
||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,4 +22,13 @@ | |
+(instancetype)newFeatureVCWithModels:(NSArray *)models; | ||
|
||
|
||
|
||
/* | ||
* 是否应该显示版本新特性界面 | ||
*/ | ||
+(BOOL)canShowNewFeature; | ||
|
||
|
||
|
||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
CoreNewFeatureVC/FrameWorks/CoreArchive/Category/NSString+File.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// | ||
// NSString+File.h | ||
// CoreCategory | ||
// | ||
// Created by 成林 on 15/4/6. | ||
// Copyright (c) 2015年 沐汐. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
|
||
|
||
@interface NSString (File) | ||
|
||
|
||
/* | ||
* document根文件夹 | ||
*/ | ||
+(NSString *)documentFolder; | ||
|
||
|
||
/* | ||
* caches根文件夹 | ||
*/ | ||
+(NSString *)cachesFolder; | ||
|
||
|
||
|
||
|
||
/** | ||
* 生成子文件夹 | ||
* | ||
* 如果子文件夹不存在,则直接创建;如果已经存在,则直接返回 | ||
* | ||
* @param subFolder 子文件夹名 | ||
* | ||
* @return 文件夹路径 | ||
*/ | ||
-(NSString *)createSubFolder:(NSString *)subFolder; | ||
|
||
|
||
@end |
62 changes: 62 additions & 0 deletions
62
CoreNewFeatureVC/FrameWorks/CoreArchive/Category/NSString+File.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// | ||
// NSString+File.m | ||
// CoreCategory | ||
// | ||
// Created by 成林 on 15/4/6. | ||
// Copyright (c) 2015年 沐汐. All rights reserved. | ||
// | ||
|
||
#import "NSString+File.h" | ||
|
||
@implementation NSString (File) | ||
|
||
/* | ||
* document根文件夹 | ||
*/ | ||
+(NSString *)documentFolder{ | ||
|
||
return [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject]; | ||
} | ||
|
||
|
||
|
||
/* | ||
* caches根文件夹 | ||
*/ | ||
+(NSString *)cachesFolder{ | ||
|
||
return [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) lastObject]; | ||
} | ||
|
||
|
||
|
||
|
||
|
||
/** | ||
* 生成子文件夹 | ||
* | ||
* 如果子文件夹不存在,则直接创建;如果已经存在,则直接返回 | ||
* | ||
* @param subFolder 子文件夹名 | ||
* | ||
* @return 文件夹路径 | ||
*/ | ||
-(NSString *)createSubFolder:(NSString *)subFolder{ | ||
|
||
NSString *subFolderPath=[NSString stringWithFormat:@"%@/%@",self,subFolder]; | ||
|
||
BOOL isDir = NO; | ||
|
||
NSFileManager *fileManager = [NSFileManager defaultManager]; | ||
|
||
BOOL existed = [fileManager fileExistsAtPath:subFolderPath isDirectory:&isDir]; | ||
|
||
if ( !(isDir == YES && existed == YES) ) | ||
{ | ||
[fileManager createDirectoryAtPath:subFolderPath withIntermediateDirectories:YES attributes:nil error:nil]; | ||
} | ||
|
||
return subFolderPath; | ||
} | ||
|
||
@end |
Oops, something went wrong.