测试网络,修改UI
This commit is contained in:
@@ -26,6 +26,8 @@ NSErrorDomain const KBNetworkErrorDomain = @"com.company.keyboard.network";
|
||||
_enabled = NO; // 键盘扩展默认无网络能力,需外部显式开启
|
||||
_timeout = 10.0;
|
||||
_defaultHeaders = @{ @"Accept": @"application/json" };
|
||||
// 设置基础域名,路径可相对该地址拼接
|
||||
_baseURL = [NSURL URLWithString:KB_BASE_URL];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -17,5 +17,8 @@
|
||||
|
||||
#import "Masonry.h"
|
||||
|
||||
// 网络基地址(Mock环境)
|
||||
#define KB_BASE_URL @"https://m1.apifoxmock.com/m1/5438099-5113192-default/"
|
||||
|
||||
|
||||
#endif /* PrefixHeader_pch */
|
||||
|
||||
@@ -20,6 +20,8 @@ static NSString * const kKBKeyboardExtensionBundleId = @"com.keyBoard.CustomKeyb
|
||||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
||||
|
||||
[self setupRootVC];
|
||||
// 主工程默认开启网络总开关(键盘扩展仍需用户允许完全访问后再行开启)
|
||||
[KBNetworkManager shared].enabled = YES;
|
||||
/// 获取网络权限
|
||||
[self getNetJudge];
|
||||
/// Bugly
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#import "KBGuideVC.h"
|
||||
|
||||
@interface HomeVC ()
|
||||
@property (nonatomic, strong) UITextView *textView;
|
||||
|
||||
@end
|
||||
|
||||
@@ -17,17 +18,15 @@
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
self.view.backgroundColor = [UIColor whiteColor];
|
||||
// Simple demo content so the tab is distinguishable
|
||||
UILabel *label = [[UILabel alloc] initWithFrame:CGRectZero];
|
||||
label.text = @"Home";
|
||||
label.textColor = [UIColor darkTextColor];
|
||||
label.font = [UIFont systemFontOfSize:20 weight:UIFontWeightSemibold];
|
||||
[label sizeToFit];
|
||||
label.center = self.view.center;
|
||||
label.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
|
||||
[self.view addSubview:label];
|
||||
CGRect frame = CGRectMake(([UIScreen mainScreen].bounds.size.width - 200)/2, 150, 200, 200);
|
||||
self.textView = [[UITextView alloc] initWithFrame:frame];
|
||||
self.textView.text = @"测试";
|
||||
self.textView.layer.borderColor = [UIColor blackColor].CGColor;
|
||||
self.textView.layer.borderWidth = 0.5;
|
||||
[self.view addSubview:self.textView];
|
||||
[self.textView becomeFirstResponder];
|
||||
|
||||
[[KBNetworkManager shared] GET:@"https://m1.apifoxmock.com/m1/5438099-5113192-default/app/config" parameters:nil headers:nil completion:^(id _Nullable jsonOrData, NSURLResponse * _Nullable response, NSError * _Nullable error) {
|
||||
[[KBNetworkManager shared] GET:@"app/config" parameters:nil headers:nil completion:^(id _Nullable jsonOrData, NSURLResponse * _Nullable response, NSError * _Nullable error) {
|
||||
NSLog(@"====");
|
||||
}];
|
||||
}
|
||||
|
||||
@@ -26,6 +26,8 @@ NSErrorDomain const KBNetworkErrorDomain = @"com.company.keyboard.network";
|
||||
_enabled = NO; // 键盘扩展默认无网络能力,需外部显式开启
|
||||
_timeout = 10.0;
|
||||
_defaultHeaders = @{ @"Accept": @"application/json" };
|
||||
// 设置基础域名,路径可相对该地址拼接
|
||||
_baseURL = [NSURL URLWithString:KB_BASE_URL];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -29,6 +29,9 @@
|
||||
|
||||
|
||||
//-----------------------------------------------宏定义全局----------------------------------------------------------/
|
||||
// 网络基地址(Mock环境)
|
||||
#define KB_BASE_URL @"https://m1.apifoxmock.com/m1/5438099-5113192-default/"
|
||||
|
||||
/// UI 尺寸/设备宏
|
||||
// 屏幕尺寸
|
||||
#define KB_SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width)
|
||||
|
||||
Reference in New Issue
Block a user