Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c6edcdd

Browse files
增加横向滚动、水平布局、分组显示事例代码
1、增加`横向滚动、水平布局、分组显示`事例代码 2、修改一些API命名
1 parent 338f2db commit c6edcdd

File tree

54 files changed

+7430
-20
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+7430
-20
lines changed

‎.DS_Store

0 Bytes
Binary file not shown.

‎MHDevelopExample/.DS_Store

0 Bytes
Binary file not shown.

‎MHDevelopExample/MHDevelopExample.xcodeproj/project.pbxproj

Lines changed: 245 additions & 1 deletion
Large diffs are not rendered by default.

‎MHDevelopExample/MHDevelopExample/AppDelegate.m

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
#import "JPFPSStatus.h"
1616
#endif
1717

18+
/// 1 -- 进入基于MVC设计模式的基类设计
19+
/// 0 -- 进入常用的开发Demo
20+
#define CMHDEBUG 0
21+
1822
@interface AppDelegate ()
19-
/**
20-
* 用户数据 只读
21-
*/
23+
/// 用户数据 只读
2224
@property (nonatomic, readwrite, strong) MHAccount *account;
23-
24-
2525
@end
2626

2727
@implementation AppDelegate
@@ -54,13 +54,10 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
5454
self.window.rootViewController = [[MHNavigationController alloc] initWithRootViewController:[[MHExampleController alloc] init]];
5555
#endif
5656

57-
5857
[self.window makeKeyAndVisible];
59-
60-
6158

6259
#if defined(DEBUG)||defined(_DEBUG)
63-
// [self _configDebugModelTools];
60+
[self _configDebugModelTools];
6461
#endif
6562

6663
return YES;
@@ -103,6 +100,4 @@ - (void)_configDebugModelTools{
103100
[[JPFPSStatus sharedInstance] open];
104101

105102
}
106-
107-
108103
@end
0 Bytes
Binary file not shown.

‎MHDevelopExample/MHDevelopExample/Architecture/Macros/CMHConstInline.h

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,105 @@ static inline CGFloat CMHBottomMargin(CGFloat pt){
1919
return MH_IS_IPHONE_X ? (pt + 34) : (pt);
2020
}
2121

22+
23+
/// 是否为空字典
24+
static inline BOOL mh_isEmptyDictionary(id classObj){
25+
if ([classObj isKindOfClass:[NSDictionary class]]){
26+
return [(NSDictionary*)classObj count] == 0;
27+
}
28+
return YES;
29+
}
30+
31+
/// 是否为空数组
32+
static inline BOOL mh_isEmptyArray(id classObj){
33+
if ([classObj isKindOfClass:[NSArray class]]){
34+
return [(NSArray*)classObj count] == 0;
35+
}
36+
return YES;
37+
}
38+
39+
/// 是否为null对象
40+
static inline BOOL mh_isNullObject(id objClass){
41+
if (!objClass || objClass == nil || [objClass isKindOfClass:[NSNull class]] || [[objClass class] isSubclassOfClass:[NSNull class]] || [objClass isEqual:[NSNull null]] || [objClass isEqual:NULL] || objClass == NULL || objClass == (id)kCFNull){
42+
return YES;
43+
}
44+
return NO;
45+
}
46+
47+
/// 是否为空对象
48+
static inline BOOL mh_isEmptyObject(id objClass){
49+
if (mh_isNullObject(objClass)){
50+
return YES;
51+
}
52+
if ([objClass respondsToSelector:@selector(length)]){
53+
return [objClass length] == 0;
54+
}
55+
if ([objClass isKindOfClass:[NSArray class]]){
56+
return [(NSArray*)objClass count] == 0;
57+
}
58+
if ([objClass isKindOfClass:[NSDictionary class]]){
59+
return [(NSDictionary*)objClass count] == 0;
60+
}
61+
if ([objClass isKindOfClass:[NSSet class]]){
62+
return [(NSSet*)objClass count] == 0;
63+
}
64+
return NO;
65+
}
66+
67+
/// 是否为空字符串
68+
static inline BOOL mh_isEmptyString(NSString *string){
69+
if (mh_isNullObject(string) || ![string isKindOfClass:[NSString class]]){
70+
return YES;
71+
}
72+
if ([[string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] length]== 0 || [[string lowercaseString] isEqual:@"null"] || [[string lowercaseString] isEqualToString:@"<null>"] || [[string lowercaseString] isEqualToString:@"(null)"]){
73+
return YES;
74+
}
75+
return NO;
76+
}
77+
78+
/// 获取有效的字符串
79+
static inline NSString * mh_getValidString(id value){
80+
if (value == nil || [value isKindOfClass:[NSNull class]]){
81+
return @"";
82+
}else if ([value isKindOfClass:[NSString class]]){
83+
return value;
84+
}else if ([value isKindOfClass:[NSNumber class]]){
85+
return [(NSNumber*)value stringValue];
86+
}else{
87+
return [NSString stringWithFormat:@"%@", value];
88+
}
89+
return @"";
90+
}
91+
92+
/// 获取去掉空格的有效的字符串
93+
static inline NSString * mh_getValidDelSpaceString(id value){
94+
NSString *returnStr = nil;
95+
if (value == nil || [value isKindOfClass:[NSNull class]]){
96+
return @"";
97+
}else if ([value isKindOfClass:[NSString class]]){
98+
returnStr = value;
99+
}else if ([value isKindOfClass:[NSNumber class]]){
100+
returnStr = [(NSNumber*)value stringValue];
101+
}else{
102+
returnStr = [NSString stringWithFormat:@"%@", value];
103+
}
104+
105+
if (returnStr.length > 0){
106+
returnStr = [returnStr stringByReplacingOccurrencesOfString:@" " withString:@""];
107+
return returnStr;
108+
}
109+
return @"";
110+
}
111+
112+
/// 获取有效的整形值
113+
static inline NSInteger mh_getValidIntegerValue(id value){
114+
if ([value isKindOfClass:[NSString class]]){
115+
return [value integerValue];
116+
}else if ([value isKindOfClass:[NSNumber class]]){
117+
return [(NSNumber*)value integerValue];
118+
}else{
119+
return 0;
120+
}
121+
return 0;
122+
}
22123
#endif /* CMHConstInline_h */

‎MHDevelopExample/MHDevelopExample/Architecture/Macros/CMHMacros.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@
1010
#define CMHMacros_h
1111

1212

13-
/// 1 -- 进入基于MVC设计模式的基类设计
14-
/// 0 -- 进入常用的开发Demo
15-
#define CMHDEBUG 1
16-
17-
18-
1913
/// ---- WeChat --
2014
/// 全局青色 tintColor
2115
#define CMH_MAIN_TINTCOLOR [UIColor colorWithRed:(10 / 255.0) green:(193 / 255.0) blue:(42 / 255.0) alpha:1]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"version" : 1,
4+
"author" : "xcode"
5+
}
6+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"scale" : "1x"
6+
},
7+
{
8+
"idiom" : "universal",
9+
"filename" : "bg_image@2x.png",
10+
"scale" : "2x"
11+
},
12+
{
13+
"idiom" : "universal",
14+
"scale" : "3x"
15+
}
16+
],
17+
"info" : {
18+
"version" : 1,
19+
"author" : "xcode"
20+
}
21+
}
536 KB
Loading[フレーム]

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /