缺少键盘图
修改网络环境下载图
This commit is contained in:
@@ -214,6 +214,8 @@
|
|||||||
"sym_lt" = "key_lt";
|
"sym_lt" = "key_lt";
|
||||||
/* '>' */
|
/* '>' */
|
||||||
"sym_gt" = "key_gt";
|
"sym_gt" = "key_gt";
|
||||||
|
/* '¥' */
|
||||||
|
"sym_money" = "key_money";
|
||||||
/* '€' */
|
/* '€' */
|
||||||
"sym_euro" = "key_euro";
|
"sym_euro" = "key_euro";
|
||||||
/* '£' */
|
/* '£' */
|
||||||
|
|||||||
Binary file not shown.
@@ -197,7 +197,7 @@ static const CGFloat kKBLettersRow2EdgeSpacerMultiplier = 0.5;
|
|||||||
[KBKey keyWithIdentifier:@"sym_semicolon" title:@";" output:@";" type:KBKeyTypeCharacter],
|
[KBKey keyWithIdentifier:@"sym_semicolon" title:@";" output:@";" type:KBKeyTypeCharacter],
|
||||||
[KBKey keyWithIdentifier:@"sym_paren_l" title:@"(" output:@"(" type:KBKeyTypeCharacter],
|
[KBKey keyWithIdentifier:@"sym_paren_l" title:@"(" output:@"(" type:KBKeyTypeCharacter],
|
||||||
[KBKey keyWithIdentifier:@"sym_paren_r" title:@")" output:@")" type:KBKeyTypeCharacter],
|
[KBKey keyWithIdentifier:@"sym_paren_r" title:@")" output:@")" type:KBKeyTypeCharacter],
|
||||||
[KBKey keyWithIdentifier:@"sym_dollar" title:@"$" output:@"$" type:KBKeyTypeCharacter],
|
[KBKey keyWithIdentifier:@"sym_money" title:@"¥" output:@"¥" type:KBKeyTypeCharacter],
|
||||||
[KBKey keyWithIdentifier:@"sym_amp" title:@"&" output:@"&" type:KBKeyTypeCharacter],
|
[KBKey keyWithIdentifier:@"sym_amp" title:@"&" output:@"&" type:KBKeyTypeCharacter],
|
||||||
[KBKey keyWithIdentifier:@"sym_at" title:@"@" output:@"@" type:KBKeyTypeCharacter],
|
[KBKey keyWithIdentifier:@"sym_at" title:@"@" output:@"@" type:KBKeyTypeCharacter],
|
||||||
[KBKey keyWithIdentifier:@"sym_quote_double" title:@"\"" output:@"\"" type:KBKeyTypeCharacter] ];
|
[KBKey keyWithIdentifier:@"sym_quote_double" title:@"\"" output:@"\"" type:KBKeyTypeCharacter] ];
|
||||||
|
|||||||
@@ -203,8 +203,10 @@ static NSString * const kKBSkinPendingIconShortKey = @"iconShortNames";
|
|||||||
|
|
||||||
#if __has_include("KBNetworkManager.h")
|
#if __has_include("KBNetworkManager.h")
|
||||||
// 远程下载(http/https)
|
// 远程下载(http/https)
|
||||||
|
NSLog(@"[SkinBridge] will GET zip: %@", zipURL);
|
||||||
[KBHUD show];
|
[KBHUD show];
|
||||||
[[KBNetworkManager shared] GET:zipURL parameters:nil headers:nil completion:^(id jsonOrData, NSURLResponse *response, NSError *error) {
|
[[KBNetworkManager shared] GET:zipURL parameters:nil headers:nil completion:^(id jsonOrData, NSURLResponse *response, NSError *error) {
|
||||||
|
NSLog(@"[SkinBridge] GET finished, error = %@", error);
|
||||||
[KBHUD dismiss];
|
[KBHUD dismiss];
|
||||||
NSData *data = ([jsonOrData isKindOfClass:NSData.class] ? (NSData *)jsonOrData : nil);
|
NSData *data = ([jsonOrData isKindOfClass:NSData.class] ? (NSData *)jsonOrData : nil);
|
||||||
if (error || data.length == 0) {
|
if (error || data.length == 0) {
|
||||||
|
|||||||
@@ -36,7 +36,6 @@
|
|||||||
0459D1B42EBA284C00F2D189 /* KBSkinCenterVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 0459D1B32EBA284C00F2D189 /* KBSkinCenterVC.m */; };
|
0459D1B42EBA284C00F2D189 /* KBSkinCenterVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 0459D1B32EBA284C00F2D189 /* KBSkinCenterVC.m */; };
|
||||||
0459D1B72EBA287900F2D189 /* KBSkinManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0459D1B62EBA287900F2D189 /* KBSkinManager.m */; };
|
0459D1B72EBA287900F2D189 /* KBSkinManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0459D1B62EBA287900F2D189 /* KBSkinManager.m */; };
|
||||||
0459D1B82EBA287900F2D189 /* KBSkinManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0459D1B62EBA287900F2D189 /* KBSkinManager.m */; };
|
0459D1B82EBA287900F2D189 /* KBSkinManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0459D1B62EBA287900F2D189 /* KBSkinManager.m */; };
|
||||||
046131112ECF3A6E00A6FADF /* fense.zip in Resources */ = {isa = PBXBuildFile; fileRef = 046131102ECF3A6E00A6FADF /* fense.zip */; };
|
|
||||||
046131142ECF454500A6FADF /* KBKeyPreviewView.m in Sources */ = {isa = PBXBuildFile; fileRef = 046131132ECF454500A6FADF /* KBKeyPreviewView.m */; };
|
046131142ECF454500A6FADF /* KBKeyPreviewView.m in Sources */ = {isa = PBXBuildFile; fileRef = 046131132ECF454500A6FADF /* KBKeyPreviewView.m */; };
|
||||||
0477BDF02EBB76E30055D639 /* HomeSheetVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 0477BDEF2EBB76E30055D639 /* HomeSheetVC.m */; };
|
0477BDF02EBB76E30055D639 /* HomeSheetVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 0477BDEF2EBB76E30055D639 /* HomeSheetVC.m */; };
|
||||||
0477BDF32EBB7B850055D639 /* KBDirectionIndicatorView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0477BDF22EBB7B850055D639 /* KBDirectionIndicatorView.m */; };
|
0477BDF32EBB7B850055D639 /* KBDirectionIndicatorView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0477BDF22EBB7B850055D639 /* KBDirectionIndicatorView.m */; };
|
||||||
@@ -53,6 +52,7 @@
|
|||||||
04791F982ED49CE7004E8522 /* KBFont.m in Sources */ = {isa = PBXBuildFile; fileRef = 04791F972ED49CE7004E8522 /* KBFont.m */; };
|
04791F982ED49CE7004E8522 /* KBFont.m in Sources */ = {isa = PBXBuildFile; fileRef = 04791F972ED49CE7004E8522 /* KBFont.m */; };
|
||||||
04791F992ED49CE7004E8522 /* KBFont.m in Sources */ = {isa = PBXBuildFile; fileRef = 04791F972ED49CE7004E8522 /* KBFont.m */; };
|
04791F992ED49CE7004E8522 /* KBFont.m in Sources */ = {isa = PBXBuildFile; fileRef = 04791F972ED49CE7004E8522 /* KBFont.m */; };
|
||||||
04791FF72ED5B985004E8522 /* Christmas.zip in Resources */ = {isa = PBXBuildFile; fileRef = 04791FF62ED5B985004E8522 /* Christmas.zip */; };
|
04791FF72ED5B985004E8522 /* Christmas.zip in Resources */ = {isa = PBXBuildFile; fileRef = 04791FF62ED5B985004E8522 /* Christmas.zip */; };
|
||||||
|
04791FFB2ED5EAB8004E8522 /* fense.zip in Resources */ = {isa = PBXBuildFile; fileRef = 04791FFA2ED5EAB8004E8522 /* fense.zip */; };
|
||||||
047C650D2EBC8A840035E841 /* KBPanModalView.m in Sources */ = {isa = PBXBuildFile; fileRef = 047C650C2EBC8A840035E841 /* KBPanModalView.m */; };
|
047C650D2EBC8A840035E841 /* KBPanModalView.m in Sources */ = {isa = PBXBuildFile; fileRef = 047C650C2EBC8A840035E841 /* KBPanModalView.m */; };
|
||||||
047C65102EBCA8DD0035E841 /* HomeRankContentVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 047C650F2EBCA8DD0035E841 /* HomeRankContentVC.m */; };
|
047C65102EBCA8DD0035E841 /* HomeRankContentVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 047C650F2EBCA8DD0035E841 /* HomeRankContentVC.m */; };
|
||||||
047C65502EBCBA9E0035E841 /* KBShopVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 047C654F2EBCBA9E0035E841 /* KBShopVC.m */; };
|
047C65502EBCBA9E0035E841 /* KBShopVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 047C654F2EBCBA9E0035E841 /* KBShopVC.m */; };
|
||||||
@@ -236,7 +236,6 @@
|
|||||||
0459D1B32EBA284C00F2D189 /* KBSkinCenterVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBSkinCenterVC.m; sourceTree = "<group>"; };
|
0459D1B32EBA284C00F2D189 /* KBSkinCenterVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBSkinCenterVC.m; sourceTree = "<group>"; };
|
||||||
0459D1B52EBA287900F2D189 /* KBSkinManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBSkinManager.h; sourceTree = "<group>"; };
|
0459D1B52EBA287900F2D189 /* KBSkinManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBSkinManager.h; sourceTree = "<group>"; };
|
||||||
0459D1B62EBA287900F2D189 /* KBSkinManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBSkinManager.m; sourceTree = "<group>"; };
|
0459D1B62EBA287900F2D189 /* KBSkinManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBSkinManager.m; sourceTree = "<group>"; };
|
||||||
046131102ECF3A6E00A6FADF /* fense.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; path = fense.zip; sourceTree = "<group>"; };
|
|
||||||
046131122ECF454500A6FADF /* KBKeyPreviewView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBKeyPreviewView.h; sourceTree = "<group>"; };
|
046131122ECF454500A6FADF /* KBKeyPreviewView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBKeyPreviewView.h; sourceTree = "<group>"; };
|
||||||
046131132ECF454500A6FADF /* KBKeyPreviewView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBKeyPreviewView.m; sourceTree = "<group>"; };
|
046131132ECF454500A6FADF /* KBKeyPreviewView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBKeyPreviewView.m; sourceTree = "<group>"; };
|
||||||
0477BDEE2EBB76E30055D639 /* HomeSheetVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HomeSheetVC.h; sourceTree = "<group>"; };
|
0477BDEE2EBB76E30055D639 /* HomeSheetVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HomeSheetVC.h; sourceTree = "<group>"; };
|
||||||
@@ -264,6 +263,7 @@
|
|||||||
04791F962ED49CE7004E8522 /* KBFont.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBFont.h; sourceTree = "<group>"; };
|
04791F962ED49CE7004E8522 /* KBFont.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBFont.h; sourceTree = "<group>"; };
|
||||||
04791F972ED49CE7004E8522 /* KBFont.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBFont.m; sourceTree = "<group>"; };
|
04791F972ED49CE7004E8522 /* KBFont.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBFont.m; sourceTree = "<group>"; };
|
||||||
04791FF62ED5B985004E8522 /* Christmas.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; path = Christmas.zip; sourceTree = "<group>"; };
|
04791FF62ED5B985004E8522 /* Christmas.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; path = Christmas.zip; sourceTree = "<group>"; };
|
||||||
|
04791FFA2ED5EAB8004E8522 /* fense.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; path = fense.zip; sourceTree = "<group>"; };
|
||||||
047C650B2EBC8A840035E841 /* KBPanModalView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBPanModalView.h; sourceTree = "<group>"; };
|
047C650B2EBC8A840035E841 /* KBPanModalView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBPanModalView.h; sourceTree = "<group>"; };
|
||||||
047C650C2EBC8A840035E841 /* KBPanModalView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBPanModalView.m; sourceTree = "<group>"; };
|
047C650C2EBC8A840035E841 /* KBPanModalView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBPanModalView.m; sourceTree = "<group>"; };
|
||||||
047C650E2EBCA8DD0035E841 /* HomeRankContentVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HomeRankContentVC.h; sourceTree = "<group>"; };
|
047C650E2EBCA8DD0035E841 /* HomeRankContentVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HomeRankContentVC.h; sourceTree = "<group>"; };
|
||||||
@@ -500,7 +500,7 @@
|
|||||||
children = (
|
children = (
|
||||||
041007D12ECE012000D203BB /* KBSkinIconMap.strings */,
|
041007D12ECE012000D203BB /* KBSkinIconMap.strings */,
|
||||||
041007D32ECE012500D203BB /* 002.zip */,
|
041007D32ECE012500D203BB /* 002.zip */,
|
||||||
046131102ECF3A6E00A6FADF /* fense.zip */,
|
04791FFA2ED5EAB8004E8522 /* fense.zip */,
|
||||||
04791FF62ED5B985004E8522 /* Christmas.zip */,
|
04791FF62ED5B985004E8522 /* Christmas.zip */,
|
||||||
);
|
);
|
||||||
path = Resource;
|
path = Resource;
|
||||||
@@ -1450,9 +1450,9 @@
|
|||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
04A9FE202EB893F10020DB6D /* Localizable.strings in Resources */,
|
04A9FE202EB893F10020DB6D /* Localizable.strings in Resources */,
|
||||||
046131112ECF3A6E00A6FADF /* fense.zip in Resources */,
|
|
||||||
041007D42ECE012500D203BB /* 002.zip in Resources */,
|
041007D42ECE012500D203BB /* 002.zip in Resources */,
|
||||||
041007D22ECE012000D203BB /* KBSkinIconMap.strings in Resources */,
|
041007D22ECE012000D203BB /* KBSkinIconMap.strings in Resources */,
|
||||||
|
04791FFB2ED5EAB8004E8522 /* fense.zip in Resources */,
|
||||||
04791FF72ED5B985004E8522 /* Christmas.zip in Resources */,
|
04791FF72ED5B985004E8522 /* Christmas.zip in Resources */,
|
||||||
04286A0B2ECD88B400CE730C /* KeyboardAssets.xcassets in Resources */,
|
04286A0B2ECD88B400CE730C /* KeyboardAssets.xcassets in Resources */,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -65,7 +65,7 @@
|
|||||||
<EnvironmentVariable
|
<EnvironmentVariable
|
||||||
key = "OS_ACTIVITY_MODE"
|
key = "OS_ACTIVITY_MODE"
|
||||||
value = "disable"
|
value = "disable"
|
||||||
isEnabled = "YES">
|
isEnabled = "NO">
|
||||||
</EnvironmentVariable>
|
</EnvironmentVariable>
|
||||||
</EnvironmentVariables>
|
</EnvironmentVariables>
|
||||||
</LaunchAction>
|
</LaunchAction>
|
||||||
|
|||||||
@@ -49,10 +49,10 @@
|
|||||||
self.view.backgroundColor = [UIColor whiteColor];
|
self.view.backgroundColor = [UIColor whiteColor];
|
||||||
self.skins = @[
|
self.skins = @[
|
||||||
@{
|
@{
|
||||||
@"id": @"local002",
|
@"id": @"local本地",
|
||||||
@"name": KBLocalized(@"本地002皮肤"),
|
@"name": KBLocalized(@"粉色皮肤"),
|
||||||
// 关键:zip_url 写成 bundle:// 前缀 + 文件名
|
// 关键:zip_url 写成 bundle:// 前缀 + 文件名
|
||||||
@"zip_url": @"bundle://002.zip",
|
@"zip_url": @"bundle://fense.zip",
|
||||||
|
|
||||||
// 颜色你可以先随便写一套,或者继承默认
|
// 颜色你可以先随便写一套,或者继承默认
|
||||||
@"background": @"#F5FFE8",
|
@"background": @"#F5FFE8",
|
||||||
@@ -66,7 +66,7 @@
|
|||||||
@"id": @"remote002",
|
@"id": @"remote002",
|
||||||
@"name": KBLocalized(@"远程皮肤"),
|
@"name": KBLocalized(@"远程皮肤"),
|
||||||
// 关键:zip_url 写成 bundle:// 前缀 + 文件名
|
// 关键:zip_url 写成 bundle:// 前缀 + 文件名
|
||||||
@"zip_url": @"https://raw.githubusercontent.com/CoderST/XDCouponAlertView/master/Christmas.zip",
|
@"zip_url": @"http://gx.zhukeping.com/download/Christmas.zip",
|
||||||
|
|
||||||
// // 颜色你可以先随便写一套,或者继承默认
|
// // 颜色你可以先随便写一套,或者继承默认
|
||||||
// @"background": @"#F5FFE8",
|
// @"background": @"#F5FFE8",
|
||||||
@@ -75,21 +75,7 @@
|
|||||||
// @"key_highlight": @"#D9F4C4",
|
// @"key_highlight": @"#D9F4C4",
|
||||||
// @"accent": @"#A4D68A"
|
// @"accent": @"#A4D68A"
|
||||||
// 不写 key_icons,代码会自动用本地那份映射表
|
// 不写 key_icons,代码会自动用本地那份映射表
|
||||||
},
|
}
|
||||||
@{
|
|
||||||
@"id": @"圣诞001",
|
|
||||||
@"name": KBLocalized(@"本地圣诞皮肤"),
|
|
||||||
// 关键:zip_url 写成 bundle:// 前缀 + 文件名
|
|
||||||
@"zip_url": @"bundle://Christmas.zip",
|
|
||||||
|
|
||||||
// 颜色你可以先随便写一套,或者继承默认
|
|
||||||
@"background": @"#F5FFE8",
|
|
||||||
@"key_bg": @"#FFFFFF",
|
|
||||||
@"key_text": @"#4A4A4A",
|
|
||||||
@"key_highlight": @"#D9F4C4",
|
|
||||||
@"accent": @"#A4D68A"
|
|
||||||
// 不写 key_icons,代码会自动用本地那份映射表
|
|
||||||
},
|
|
||||||
];
|
];
|
||||||
|
|
||||||
self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, KB_NAV_TOTAL_HEIGHT, KB_SCREEN_WIDTH, KB_SCREEN_HEIGHT - KB_NAV_TOTAL_HEIGHT) style:UITableViewStyleInsetGrouped];
|
self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, KB_NAV_TOTAL_HEIGHT, KB_SCREEN_WIDTH, KB_SCREEN_HEIGHT - KB_NAV_TOTAL_HEIGHT) style:UITableViewStyleInsetGrouped];
|
||||||
@@ -120,6 +106,13 @@
|
|||||||
inset.bottom += 44 + 24; // 按钮高度 + 上下间距
|
inset.bottom += 44 + 24; // 按钮高度 + 上下间距
|
||||||
self.tableView.contentInset = inset;
|
self.tableView.contentInset = inset;
|
||||||
self.tableView.scrollIndicatorInsets = inset;
|
self.tableView.scrollIndicatorInsets = inset;
|
||||||
|
|
||||||
|
[[KBNetworkManager shared] GET:@"https://www.apple.com"
|
||||||
|
parameters:nil
|
||||||
|
headers:nil
|
||||||
|
completion:^(id jsonOrData, NSURLResponse *response, NSError *error) {
|
||||||
|
NSLog(@"[Test] apple.com finished, error = %@", error);
|
||||||
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - UITableView
|
#pragma mark - UITableView
|
||||||
@@ -145,10 +138,14 @@
|
|||||||
NSDictionary *skin = self.skins[idx];
|
NSDictionary *skin = self.skins[idx];
|
||||||
if (!skin) return;
|
if (!skin) return;
|
||||||
if (idx == 0) {
|
if (idx == 0) {
|
||||||
[[KBSkinService shared] applySkinWithJSON:skin
|
// NSString *title = (indexPath.item < self.dataSource.count) ? self.dataSource[indexPath.item] : KBLocalized(@"专属皮肤002");
|
||||||
fromViewController:self
|
// 将需求固定到 002.zip,本地写死皮肤 id,便于键盘扩展识别并解压。
|
||||||
mode:KBSkinSourceModeLocalBundleZip
|
static NSString * const kKBBundleSkinId002 = @"bundle_skin_fense";
|
||||||
completion:nil];
|
[KBSkinInstallBridge publishBundleSkinRequestWithId:kKBBundleSkinId002
|
||||||
|
name:@"" ?: kKBBundleSkinId002
|
||||||
|
zipName:@"fense.zip"
|
||||||
|
iconShortNames:nil];
|
||||||
|
[KBHUD showInfo:KBLocalized(@"已通知键盘解压,切换到自定义键盘即可生效")];
|
||||||
}else if (idx == 1){
|
}else if (idx == 1){
|
||||||
[[KBSkinService shared] applySkinWithJSON:skin
|
[[KBSkinService shared] applySkinWithJSON:skin
|
||||||
fromViewController:self
|
fromViewController:self
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ NSErrorDomain const KBNetworkErrorDomain = @"com.company.keyboard.network";
|
|||||||
parameters:(NSDictionary *)parameters
|
parameters:(NSDictionary *)parameters
|
||||||
headers:(NSDictionary<NSString *,NSString *> *)headers
|
headers:(NSDictionary<NSString *,NSString *> *)headers
|
||||||
completion:(KBNetworkCompletion)completion {
|
completion:(KBNetworkCompletion)completion {
|
||||||
|
NSLog(@"[KBNetworkManager] GET called, enabled=%d, path=%@", self.isEnabled, path);
|
||||||
if (![self ensureEnabled:completion]) return nil;
|
if (![self ensureEnabled:completion]) return nil;
|
||||||
NSString *urlString = [self buildURLStringWithPath:path];
|
NSString *urlString = [self buildURLStringWithPath:path];
|
||||||
if (!urlString) { [self fail:KBNetworkErrorInvalidURL completion:completion]; return nil; }
|
if (!urlString) { [self fail:KBNetworkErrorInvalidURL completion:completion]; return nil; }
|
||||||
@@ -144,9 +145,11 @@ NSErrorDomain const KBNetworkErrorDomain = @"com.company.keyboard.network";
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (NSURLSessionDataTask *)startAFTaskWithRequest:(NSURLRequest *)req completion:(KBNetworkCompletion)completion {
|
- (NSURLSessionDataTask *)startAFTaskWithRequest:(NSURLRequest *)req completion:(KBNetworkCompletion)completion {
|
||||||
|
NSLog(@"[KBNetworkManager] startAFTaskWithRequest: %@", req.URL.absoluteString);
|
||||||
// 响应先用原始数据返回,再按 Content-Type 解析 JSON(与原实现一致)
|
// 响应先用原始数据返回,再按 Content-Type 解析 JSON(与原实现一致)
|
||||||
self.manager.responseSerializer = [AFHTTPResponseSerializer serializer];
|
self.manager.responseSerializer = [AFHTTPResponseSerializer serializer];
|
||||||
NSURLSessionDataTask *task = [self.manager dataTaskWithRequest:req uploadProgress:nil downloadProgress:nil completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) {
|
NSURLSessionDataTask *task = [self.manager dataTaskWithRequest:req uploadProgress:nil downloadProgress:nil completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) {
|
||||||
|
NSLog(@"[KBNetworkManager] task finished, error = %@", error);
|
||||||
// AFN 默认对非 2xx 的状态码返回 error;这里先日志,再直接回调上层
|
// AFN 默认对非 2xx 的状态码返回 error;这里先日志,再直接回调上层
|
||||||
if (error) {
|
if (error) {
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
|
|||||||
@@ -214,6 +214,8 @@
|
|||||||
"sym_lt" = "key_lt";
|
"sym_lt" = "key_lt";
|
||||||
/* '>' */
|
/* '>' */
|
||||||
"sym_gt" = "key_gt";
|
"sym_gt" = "key_gt";
|
||||||
|
/* '¥' */
|
||||||
|
"sym_money" = "key_money";
|
||||||
/* '€' */
|
/* '€' */
|
||||||
"sym_euro" = "key_euro";
|
"sym_euro" = "key_euro";
|
||||||
/* '£' */
|
/* '£' */
|
||||||
|
|||||||
Reference in New Issue
Block a user