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 ba75288

Browse files
增加WebView JS交互的Example
1. 新增WebViewJS交互的Example,详见Profile/Example35 2. 新增基于AFNetworking的大文件上传Example,详见Contacts/FileUpload
1 parent eddba0e commit ba75288

File tree

101 files changed

+5829
-199
lines changed

Some content is hidden

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

101 files changed

+5829
-199
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: 228 additions & 22 deletions
Large diffs are not rendered by default.

‎MHDevelopExample/MHDevelopExample/AppDelegate.m

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,18 @@ @interface AppDelegate ()
2727
@implementation AppDelegate
2828

2929
#pragma mark- 获取appdelegate
30-
+ (AppDelegate *)sharedDelegate
31-
{
30+
+ (AppDelegate *)sharedDelegate{
3231
return (AppDelegate *)[[UIApplication sharedApplication] delegate];
3332
}
3433

35-
- (MHAccount *)account
36-
{
34+
- (MHAccount *)account{
3735
if (_account == nil) {
3836
// 内部初始化了数据
3937
_account = [[MHAccount alloc] init];
4038
}
4139
return _account;
4240
}
4341

44-
45-
4642
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
4743

4844
/// 初始化UI之前配置

‎MHDevelopExample/MHDevelopExample/Architecture/BaseClass/View/CMHView.m

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,5 @@
1010

1111
@implementation CMHView
1212

13-
/*
14-
// Only override drawRect: if you perform custom drawing.
15-
// An empty implementation adversely affects performance during animation.
16-
- (void)drawRect:(CGRect)rect {
17-
// Drawing code
18-
}
19-
*/
2013

2114
@end

‎MHDevelopExample/MHDevelopExample/Architecture/BaseClass/ViewController/CMHViewController.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
FOUNDATION_EXTERN NSString *const CMHViewControllerIDKey;
1515
/// 传递数据模型的key:例如 商品模型的传递 用户模型的传递...
1616
FOUNDATION_EXTERN NSString *const CMHViewControllerUtilKey;
17-
/// 传递webView Request的key:例如 webView request...
18-
FOUNDATION_EXTERN NSString *const CMHViewControllerRequestKey;
17+
/// 传递webView Request Url的key:例如 webView request...
18+
FOUNDATION_EXTERN NSString *const CMHViewControllerRequestUrlKey;
1919

2020
@interface CMHViewController : UIViewController
2121

‎MHDevelopExample/MHDevelopExample/Architecture/BaseClass/ViewController/CMHViewController.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
/// 传递数据模型的key:例如 商品模型的传递 用户模型的传递...
1616
NSString *const CMHViewControllerUtilKey = @"CMHViewControllerUtilKey";
1717
/// 传递webView Request的key:例如 webView request...
18-
NSString *const CMHViewControllerRequestKey = @"CMHViewControllerRequestKey";
18+
NSString *const CMHViewControllerRequestUrlKey = @"CMHViewControllerRequestUrlKey";
1919

2020
#import "CMHNavigationController.h"
2121
#import "CMHViewController.h"
@@ -202,7 +202,7 @@ - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {return U
202202

203203
#pragma mark - Status bar
204204
- (BOOL)prefersStatusBarHidden { return NO; }
205-
- (UIStatusBarStyle)preferredStatusBarStyle { return UIStatusBarStyleDefault; }
205+
- (UIStatusBarStyle)preferredStatusBarStyle { return UIStatusBarStyleLightContent; }
206206
- (UIStatusBarAnimation)preferredStatusBarUpdateAnimation { return UIStatusBarAnimationFade; }
207207

208208

‎MHDevelopExample/MHDevelopExample/Architecture/BaseClass/ViewController/CMHWebViewController.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
/// 内容缩进 (64,0,0,0)
1515
@property (nonatomic, readonly, assign) UIEdgeInsets contentInset;
1616

17-
/// web url quest
18-
@property (nonatomic, readwrite, copy) NSURLRequest *request;
17+
/// web url quest 如果localFile == YES , 则requestUrl 为本地路径 ; 反之,requestUrl为远程url str
18+
@property (nonatomic, readwrite, copy) NSString *requestUrl;
19+
/// 是否是本地文件 default is NO
20+
@property (nonatomic , readwrite , assign , getter = isLocalFile) BOOL localFile;
1921

2022
/// 下拉刷新 defalut is NO
2123
@property (nonatomic, readwrite, assign) BOOL shouldPullDownToRefresh;
@@ -28,4 +30,9 @@
2830
/// 是否取消关闭按钮。默认是不取消,default is NO
2931
@property (nonatomic, readwrite, assign) BOOL shouldDisableWebViewClose;
3032

33+
/// messageHandlers: 就是你要注册的 JS 调用 OC 的方法名
34+
@property (nonatomic , readwrite , copy) NSArray <NSString *> *messageHandlers;
35+
/// 导航栏高度 默认是 系统导航栏的高度
36+
@property (nonatomic , readwrite , assign) CGFloat navigationBarHeight;
37+
3138
@end

0 commit comments

Comments
(0)

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