7个文件已删除
2 文件已重命名
140个文件已修改
88个文件已添加
| | |
| | | "${PODS_ROOT}/AliLinkPartnerSDK/AlibcLinkPartnerSDK.framework/SmartLink.bundle", |
| | | "${PODS_ROOT}/AlibcTradeSDK/AlibcTradeBiz.framework/NBResource.bundle", |
| | | "${PODS_ROOT}/UMCShare/UMShare/UMSocialUI/UMSocialSDKResources.bundle", |
| | | "${PODS_ROOT}/WindVane/WindVaneBasic.framework/Resources/WindVaneBasic.bundle", |
| | | "${PODS_ROOT}/WindVane/WindVaneBasic.framework/Resources/NebulaWK.bundle", |
| | | "${PODS_ROOT}/WindVane/WindVaneCore.framework/WindVaneBasic.bundle", |
| | | "${PODS_ROOT}/WindVane/WindVaneCore.framework/NebulaWK.bundle", |
| | | "${PODS_ROOT}/mob_sharesdk/ShareSDK/Support/PlatformSDK/SinaWeiboSDK/WeiboSDK.bundle", |
| | | "${PODS_ROOT}/mob_sharesdk/ShareSDK/Support/Optional/ShareSDKUI.bundle", |
| | | "${PODS_CONFIGURATION_BUILD_DIR}/mob_sharesdk/ShareSDK.bundle", |
| | | "${PODS_CONFIGURATION_BUILD_DIR}/mob_sharesdk/ShareSDK_JS_QQ.bundle", |
| | | "${PODS_CONFIGURATION_BUILD_DIR}/mob_sharesdk/ShareSDK_JS_SinaWeibo.bundle", |
| | | "${PODS_CONFIGURATION_BUILD_DIR}/mob_sharesdk/ShareSDK_JS_WeChat.bundle", |
| | | "${PODS_ROOT}/securityGuard/SGMiddleTier.framework/bx-cancel.png", |
| | | "${PODS_ROOT}/securityGuard/SGMiddleTier.framework/bx-cancel@2x.png", |
| | | "${PODS_ROOT}/securityGuard/SGMiddleTier.framework/bx-refresh.png", |
| | | "${PODS_ROOT}/securityGuard/SGMiddleTier.framework/bx-refresh@2x.png", |
| | | ); |
| | | name = "[CP] Copy Pods Resources"; |
| | | outputPaths = ( |
| | |
| | | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SmartLink.bundle", |
| | | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/NBResource.bundle", |
| | | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/UMSocialSDKResources.bundle", |
| | | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/WindVaneBasic.bundle", |
| | | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/NebulaWK.bundle", |
| | | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/WeiboSDK.bundle", |
| | | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ShareSDKUI.bundle", |
| | | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ShareSDK.bundle", |
| | | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ShareSDK_JS_QQ.bundle", |
| | | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ShareSDK_JS_SinaWeibo.bundle", |
| | | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ShareSDK_JS_WeChat.bundle", |
| | | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/bx-cancel.png", |
| | | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/bx-cancel@2x.png", |
| | | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/bx-refresh.png", |
| | | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/bx-refresh@2x.png", |
| | | ); |
| | | runOnlyForDeploymentPostprocessing = 0; |
| | | shellPath = /bin/sh; |
| | |
| | | pod 'IQKeyboardManager' |
| | | pod 'SDWebImage', '~> 5.1.1' |
| | | |
| | | pod 'AlibcTradeSDK','4.0.0.8' |
| | | pod 'AliAuthSDK','2.0.0.3' |
| | | pod 'mtopSDK','3.0.0.4' |
| | | pod 'securityGuard','5.4.173' |
| | | pod 'AlibcTradeSDK','4.0.1.6' |
| | | pod 'AliAuthSDK','1.1.0.41-bc' |
| | | pod 'mtopSDK','3.0.0.3-BC' |
| | | pod 'securityGuard','5.4.191' |
| | | pod 'AliLinkPartnerSDK','4.0.0.24' |
| | | pod 'BCUserTrack','5.2.0.11-appkeys' |
| | | pod 'BCUserTrack','5.2.0.16-appkeys' |
| | | pod 'UTDID','1.1.0.16' |
| | | pod 'WindVane','8.5.0.46-bc11' |
| | | |
| | | pod 'ReactiveCocoa', :git => 'https://github.com/zhao0/ReactiveCocoa.git', :tag => '2.5.2' |
| | | pod 'SDAutoLayout' |
| | |
| | | - AFNetworking/Serialization (3.2.1) |
| | | - AFNetworking/UIKit (3.2.1): |
| | | - AFNetworking/NSURLSession |
| | | - AliAuthSDK (2.0.0.3) |
| | | - AlibcTradeSDK (4.0.0.8) |
| | | - AliAuthSDK (1.1.0.41-bc) |
| | | - AlibcTradeSDK (4.0.1.6) |
| | | - AliLinkPartnerSDK (4.0.0.24) |
| | | - BCUserTrack (5.2.0.11-appkeys): |
| | | - BCUserTrack (5.2.0.16-appkeys): |
| | | - UTDID |
| | | - CRBoxInputView (1.0.1): |
| | | - Masonry |
| | |
| | | - mob_sharesdk/ShareSDK |
| | | - MOBFoundation |
| | | - MOBFoundation (3.2.6) |
| | | - mtopSDK (3.0.0.4) |
| | | - mtopSDK (3.0.0.3-BC) |
| | | - ReactiveCocoa (2.5.2): |
| | | - ReactiveCocoa/UI (= 2.5.2) |
| | | - ReactiveCocoa/Core (2.5.2): |
| | |
| | | - SDWebImage (5.1.1): |
| | | - SDWebImage/Core (= 5.1.1) |
| | | - SDWebImage/Core (5.1.1) |
| | | - securityGuard (5.4.173) |
| | | - securityGuard (5.4.191) |
| | | - SVProgressHUD (2.2.5) |
| | | - Toast (4.0.0) |
| | | - TYSnapshotScroll (0.0.7) |
| | |
| | | - UMCCommon |
| | | - UMCShare/Core |
| | | - UTDID (1.1.0.16) |
| | | - WindVane (8.5.0.46-bc11): |
| | | - WindVane/Basic (= 8.5.0.46-bc11) |
| | | - WindVane/Core (= 8.5.0.46-bc11) |
| | | - WindVane/WindVane (= 8.5.0.46-bc11) |
| | | - WindVane/Basic (8.5.0.46-bc11) |
| | | - WindVane/Core (8.5.0.46-bc11) |
| | | - WindVane/WindVane (8.5.0.46-bc11) |
| | | - YYCache (1.0.4) |
| | | - YYImage (1.0.4): |
| | | - YYImage/Core (= 1.0.4) |
| | |
| | | |
| | | DEPENDENCIES: |
| | | - AFNetworking (~> 3.0) |
| | | - AliAuthSDK (= 2.0.0.3) |
| | | - AlibcTradeSDK (= 4.0.0.8) |
| | | - AliAuthSDK (= 1.1.0.41-bc) |
| | | - AlibcTradeSDK (= 4.0.1.6) |
| | | - AliLinkPartnerSDK (= 4.0.0.24) |
| | | - BCUserTrack (= 5.2.0.11-appkeys) |
| | | - BCUserTrack (= 5.2.0.16-appkeys) |
| | | - CRBoxInputView (= 1.0.1) |
| | | - GPUImage |
| | | - IQKeyboardManager |
| | |
| | | - mob_sharesdk/ShareSDKPlatforms/SinaWeibo |
| | | - mob_sharesdk/ShareSDKPlatforms/WeChat |
| | | - mob_sharesdk/ShareSDKUI |
| | | - mtopSDK (= 3.0.0.4) |
| | | - mtopSDK (= 3.0.0.3-BC) |
| | | - ReactiveCocoa (from `https://github.com/zhao0/ReactiveCocoa.git`, tag `2.5.2`) |
| | | - SAMKeychain |
| | | - SDAutoLayout |
| | | - SDWebImage (~> 5.1.1) |
| | | - securityGuard (= 5.4.173) |
| | | - securityGuard (= 5.4.191) |
| | | - SVProgressHUD |
| | | - Toast |
| | | - TYSnapshotScroll |
| | |
| | | - UMCShare/Social/ReducedWeChat |
| | | - UMCShare/UI |
| | | - UTDID (= 1.1.0.16) |
| | | - WindVane (= 8.5.0.46-bc11) |
| | | - YYImage/WebP |
| | | - YYModel |
| | | - YYText |
| | |
| | | - mtopSDK |
| | | - securityGuard |
| | | - UTDID |
| | | - WindVane |
| | | https://github.com/cocoapods/specs.git: |
| | | - AFNetworking |
| | | - CRBoxInputView |
| | |
| | | |
| | | SPEC CHECKSUMS: |
| | | AFNetworking: b6f891fdfaed196b46c7a83cf209e09697b94057 |
| | | AliAuthSDK: be6caff0bb645ad663c75f311170b2a3b069780e |
| | | AlibcTradeSDK: 72d36e433ecfbd4c78b5199f0db4f70fd4be374b |
| | | AliAuthSDK: 7018e8f3c8be3382e60f69d3b517c7de34c351e0 |
| | | AlibcTradeSDK: 9a3e7af6cd648dd1f85684e82694c213fe48dad2 |
| | | AliLinkPartnerSDK: c5778cdfdcee7bfe342238d39a77766184d36a46 |
| | | BCUserTrack: f267dfb52a6e67603c33668f2e9384ee01b68a88 |
| | | BCUserTrack: ea53788070a12046c5b40fb426293f3b7a8a0c9d |
| | | CRBoxInputView: 93cf523613369ec67643d1c78e5c8a22e401983a |
| | | GPUImage: 733a5f0fab92df9de1c37ba9df520a833ccb406d |
| | | IQKeyboardManager: 700e5155d6a292383b54e8678aec769e14fc78fc |
| | |
| | | MJRefresh: ed450d6eb9d3346a2cb033ab7eb6de090aeef437 |
| | | mob_sharesdk: 48cb240a4b9cc393be2d6ff9c5b597ae77a1da73 |
| | | MOBFoundation: 08c456357888e4c984fba23bbf04cfd2f4fc1e02 |
| | | mtopSDK: bf447d4361b0199790e2a2829a1cc0299df71716 |
| | | mtopSDK: d6fdf81730342a69be920b576541c7bb81a683d5 |
| | | ReactiveCocoa: 3ff25b1bd992ac79c5c79b26b6c0c1713b715bb2 |
| | | SAMKeychain: 483e1c9f32984d50ca961e26818a534283b4cd5c |
| | | SDAutoLayout: 8bf6b3bbc8b01f775d4defbb4fda2ace805461be |
| | | SDWebImage: 96d7f03415ccb28d299d765f93557ff8a617abd8 |
| | | securityGuard: 35d3a1b5877bb2de4698a78089eb8906fa3ad27b |
| | | securityGuard: 9c04c44a3b663f36e15064042abfc107fa07133c |
| | | SVProgressHUD: 1428aafac632c1f86f62aa4243ec12008d7a51d6 |
| | | Toast: 91b396c56ee72a5790816f40d3a94dd357abc196 |
| | | TYSnapshotScroll: 699a985c9d630f00b62b90bb3ba5ea9ccd03767a |
| | |
| | | UMCCommon: 971f324a5a99c9d662ae040a815e7e3d7ef8b2a8 |
| | | UMCShare: e0cef55c0fd6051254c8cda1d0630eb578b27bad |
| | | UTDID: c28855683c5ea2e77e597cb14609328f7d470d6e |
| | | WindVane: 56e096abae757397ccd3accb66a959f3ffcbf949 |
| | | YYCache: 8105b6638f5e849296c71f331ff83891a4942952 |
| | | YYImage: 1e1b62a9997399593e4b9c4ecfbbabbf1d3f3b54 |
| | | YYModel: 2a7fdd96aaa4b86a824e26d0c517de8928c04b30 |
| | | YYText: 5c461d709e24d55a182d1441c41dc639a18a4849 |
| | | YYWebImage: 5f7f36aee2ae293f016d418c7d6ba05c4863e928 |
| | | |
| | | PODFILE CHECKSUM: 95a4ef54bbe59a7fb561f803de7be68f42c9551e |
| | | PODFILE CHECKSUM: 5a3aed10479b939f477ffc166e80e3b05bcd5148 |
| | | |
| | | COCOAPODS: 1.5.3 |
New file |
| | |
| | | // |
| | | // aluEnvConfig.h |
| | | // AliUniversalAccount |
| | | // |
| | | // Created by ethan on 12/14/15. |
| | | // Copyright © 2015 Alipay. All rights reserved. |
| | | // |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | /** 环境 */ |
| | | typedef NS_ENUM (NSUInteger, ALBBCompatibleEnvironment) { |
| | | /** 测试环境 */ |
| | | ALBBCompatibleEnvironmentDaily, |
| | | /** 预发环境 */ |
| | | ALBBCompatibleEnvironmentPreRelease, |
| | | /** 线上环境 */ |
| | | ALBBCompatibleEnvironmentRelease, |
| | | }; |
| | | |
| | | @interface ALBBCompatibleEnvConfig : NSObject |
| | | |
| | | + (instancetype)shareInstance; |
| | | |
| | | - (void) setGWServerSettings:(ALBBCompatibleEnvironment) env; |
| | | |
| | | - (void)setSecAdditional:(NSString *)additional; |
| | | |
| | | @end |
File was renamed from Pods/AliAuthSDK/AlibabaAuthSDK.framework/Headers/ALBBSession.h |
| | |
| | | #import <Foundation/Foundation.h> |
| | | #import "ALBBUser.h" |
| | | |
| | | @interface ALBBSession : NSObject |
| | | @property(nonatomic, assign)BOOL isCanceledByUser; |
| | | @property(nonatomic, copy)NSString* bindCode; |
| | | @interface ALBBCompatibleSession : NSObject |
| | | |
| | | /** |
| | | @return 返回单例 |
| | | */ |
| | | + (ALBBSession *)sharedInstance; |
| | | + (ALBBCompatibleSession *)sharedInstance; |
| | | |
| | | /** |
| | | 如果未登录或者登录态已经过期,返回NO |
New file |
| | |
| | | // |
| | | // AlibabaAuthSDK.h |
| | | // AlibabaAuthSDK |
| | | // |
| | | // Created by Bangzhe Liu on 6/15/16. |
| | | // Copyright © 2016 taobao. All rights reserved. |
| | | // |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | |
| | | /** 回调定义 */ |
| | | typedef void (^SuccessCallback)(void); |
| | | typedef void (^FailureCallback)(NSError *error); |
| | | |
| | | |
| | | @interface ALBBSDK : NSObject |
| | | |
| | | + (ALBBSDK *)sharedInstance; |
| | | |
| | | //必须在主线程调用 |
| | | - (void)ALBBSDKInit; |
| | | |
| | | - (void)auth:(UIViewController *)parentController successCallback:(SuccessCallback) onSuccess failureCallback:(FailureCallback) onFailure; |
| | | |
| | | /** |
| | | 退出登录 |
| | | */ |
| | | - (void)logout; |
| | | |
| | | /** |
| | | 是否是登录URL |
| | | */ |
| | | - (BOOL)isLoginURL:(NSString *)url; |
| | | |
| | | /** |
| | | 是否是登出URL |
| | | */ |
| | | - (BOOL)isLogoutUrl:(NSString *)url; |
| | | |
| | | - (BOOL)handleUrl:(NSString *)url; |
| | | |
| | | //如果是接入的极简版本需要手动设置appkey |
| | | - (void)setAppkey : (NSString *)appKey; |
| | | |
| | | - (void)setH5Only:(BOOL)h5Only; |
| | | @end |
File was renamed from Pods/AliAuthSDK/AlibabaAuthSDK.framework/Headers/ALBBUser.h |
| | |
| | | |
| | | - (instancetype)initWithNick:(NSString *)nick avatarUrl:(NSString *)avatarUrl openId:(NSString *)openId openSid:(NSString *)openSid topAccessToken:(NSString *)topAccessToken topAuthCode:(NSString*)authCode; |
| | | |
| | | - (NSString *)ALBBUserDescription; |
| | | |
| | | @end |
| | |
| | | <plist version="1.0"> |
| | | <dict> |
| | | <key>BuildMachineOSBuild</key> |
| | | <string>17A405</string> |
| | | <string>18D109</string> |
| | | <key>CFBundleDevelopmentRegion</key> |
| | | <string>en</string> |
| | | <key>CFBundleExecutable</key> |
| | |
| | | <key>CFBundlePackageType</key> |
| | | <string>FMWK</string> |
| | | <key>CFBundleShortVersionString</key> |
| | | <string>1.1.0.34-mtop-SNAPSHOT</string> |
| | | <string>1.1.0.41-bc-SNAPSHOT</string> |
| | | <key>CFBundleSignature</key> |
| | | <string>????</string> |
| | | <key>CFBundleSupportedPlatforms</key> |
| | |
| | | <key>DTCompiler</key> |
| | | <string>com.apple.compilers.llvm.clang.1_0</string> |
| | | <key>DTPlatformBuild</key> |
| | | <string>15A372</string> |
| | | <string>16B91</string> |
| | | <key>DTPlatformName</key> |
| | | <string>iphoneos</string> |
| | | <key>DTPlatformVersion</key> |
| | | <string>11.0</string> |
| | | <string>12.1</string> |
| | | <key>DTSDKBuild</key> |
| | | <string>15A372</string> |
| | | <string>16B91</string> |
| | | <key>DTSDKName</key> |
| | | <string>iphoneos11.0</string> |
| | | <string>iphoneos12.1</string> |
| | | <key>DTXcode</key> |
| | | <string>0900</string> |
| | | <string>1010</string> |
| | | <key>DTXcodeBuild</key> |
| | | <string>9A235</string> |
| | | <string>10B61</string> |
| | | <key>MinimumOSVersion</key> |
| | | <string>7.0</string> |
| | | <key>UIDeviceFamily</key> |
| | |
| | | <plist version="1.0"> |
| | | <dict> |
| | | <key>BuildMachineOSBuild</key> |
| | | <string>17A405</string> |
| | | <string>18D109</string> |
| | | <key>CFBundleDevelopmentRegion</key> |
| | | <string>en</string> |
| | | <key>CFBundleExecutable</key> |
| | |
| | | <key>CFBundlePackageType</key> |
| | | <string>FMWK</string> |
| | | <key>CFBundleShortVersionString</key> |
| | | <string>1.1.0.34-mtop-SNAPSHOT</string> |
| | | <string>1.1.0.41-bc-SNAPSHOT</string> |
| | | <key>CFBundleSignature</key> |
| | | <string>????</string> |
| | | <key>CFBundleSupportedPlatforms</key> |
| | |
| | | <key>DTCompiler</key> |
| | | <string>com.apple.compilers.llvm.clang.1_0</string> |
| | | <key>DTPlatformBuild</key> |
| | | <string>15A372</string> |
| | | <string>16B91</string> |
| | | <key>DTPlatformName</key> |
| | | <string>iphoneos</string> |
| | | <key>DTPlatformVersion</key> |
| | | <string>11.0</string> |
| | | <string>12.1</string> |
| | | <key>DTSDKBuild</key> |
| | | <string>15A372</string> |
| | | <string>16B91</string> |
| | | <key>DTSDKName</key> |
| | | <string>iphoneos11.0</string> |
| | | <string>iphoneos12.1</string> |
| | | <key>DTXcode</key> |
| | | <string>0900</string> |
| | | <string>1010</string> |
| | | <key>DTXcodeBuild</key> |
| | | <string>9A235</string> |
| | | <string>10B61</string> |
| | | <key>MinimumOSVersion</key> |
| | | <string>7.0</string> |
| | | <key>UIDeviceFamily</key> |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | |
| | | |
| | | @interface AlibcTradePayResult : NSObject |
| | | @property(nonatomic, copy, nullable, readonly) NSArray *paySuccessOrders; |
| | | @property(nonatomic, copy, nullable, readonly) NSArray *paySuccessOrders; |
| | | @property(nonatomic, copy, nullable, readonly) NSArray *payFailedOrders; |
| | | |
| | | @end |
| | |
| | | + (BOOL)isPaymentSuccess:(nullable NSDictionary *)payment; |
| | | |
| | | |
| | | /** 支付订单 */ |
| | | - (void)payOrder:(nonnull NSString *)order scheme:(nonnull NSString *)scheme callback:(nullable void (^)(NSDictionary *__nullable result))callback; |
| | | |
| | | /** 支付结果 */ |
| | | - (void)receiptURL:(nullable NSURL *)url callback:(nullable void (^)(NSDictionary *__nullable result))callback; |
| | | |
| | | /** 解析支付结果 */ |
| | | - (void)processPayment:(NSDictionary *__nullable)payment callback:(nullable void (^)(AlibcTradePayResult *__nullable result, NSError *__nullable error))callback; |
| | | |
| | | |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | AlibcSDKStateInitFailed = 3 |
| | | }; |
| | | |
| | | |
| | | |
| | | NS_ASSUME_NONNULL_BEGIN |
| | | |
| | | /** 配置 */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | #import "AlibcTradeSDKConfigModel.h" |
| | | #import "AlibcTradeSDKESConfigModel.h" |
| | | |
| | | |
| | | #ifndef AlibcConfigService_h |
| | | #define AlibcConfigService_h |
| | | #define YBHPSS @"ybhpss" //全链路打通数据参数 |
| | | #define YBHPSS @"ybhpss" //全链路打通数据参数 |
| | | |
| | | @interface AlibcConfigService : NSObject |
| | | |
| | |
| | | @property(nonatomic, readonly) NSString *channel; |
| | | @property(nonatomic, strong) NSString *alizfRequestSender; |
| | | |
| | | |
| | | // 全局授权登录重试次数 |
| | | @property(nonatomic, assign) NSInteger reTryCount; |
| | | @property(nonatomic, assign)NSInteger reTryCount; |
| | | // 已经重试次数 |
| | | @property(nonatomic, assign) NSInteger hasRryCount; |
| | | @property(nonatomic, assign)NSInteger hasRryCount; |
| | | |
| | | //全局淘客参数 |
| | | @property(nonatomic, strong) AlibcTradeTaokeParams *taokeParams; |
| | |
| | | //淘客打点是否使用同步换url的方式 |
| | | - (BOOL)isSyncForTaoke; |
| | | |
| | | // 默认YES. |
| | | - (BOOL)isNeedAlizfNative; |
| | | |
| | | //设置是否检测WebView |
| | | - (void)setNeedAlizfNative:(BOOL)need; |
| | | |
| | | //是否登陆降级(不触发登陆了) |
| | |
| | | |
| | | - (NSString *)extUserAgent; |
| | | |
| | | // 电商套件页面配置信息 |
| | | - (AlibcTradeSDKESConfigModel *)getESTradeConfig; |
| | | - (void)setBCUserAgent:(NSString *)BCUserAgent; |
| | | |
| | | - (NSString *)BCUserAgent; |
| | | |
| | | - (void)setNormalUserAgent:(NSString *)normalUserAgent; |
| | | |
| | | - (NSString *)normalUserAgent; |
| | | |
| | | // 电商配置信息 |
| | | - (AlibcTradeSDKConfigModel *)getTradeSDKConfig; |
| | | |
| | | // 电商套件页面配置信息 |
| | | - (AlibcTradeSDKESConfigModel *)getESTradeConfig; |
| | | |
| | | // SDK func |
| | | - (NSError *)testSDKFunc:(NSString *)func; |
| | | |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | @property(nonatomic, strong, nullable) AlibcTradeProcessSuccessCallback onTradeSuccess; |
| | | @property(nonatomic, copy, nullable) AlibcTradeProcessFailedCallback onTradeFailure; |
| | | |
| | | |
| | | //辅助函数 |
| | | - (BOOL)isForceH5; //是否整个链路强制用h5打开 |
| | | |
| | | @end |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | @property(nonatomic, assign) BOOL needWUA; //是否需要人机识别,默认是NO |
| | | @property(nonatomic, assign) BOOL needPost; |
| | | @property(nonatomic, assign) NSInteger sessionExpireType; // 0: AutologinAndManualLogin 1: AutoLoginOnly |
| | | @property(nonatomic, strong) NSDictionary * _Nullable extParams; |
| | | @property(nonatomic, strong) NSDictionary * _Nullable extHeaders; |
| | | |
| | | |
| | | // |
| | | @property(nonatomic, copy) NSString * _Nullable ttid;// ttid |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | seessionExpireType:(NSInteger)seessionExpireType |
| | | complete:(nullable MtopRequestJSCallback)callback; |
| | | |
| | | + (void)ProcessJSMtopRequest:(nonnull NSString *)cmdName |
| | | version:(nullable NSString *)version |
| | | ttid:(nullable NSString *)ttid |
| | | data:(nullable NSDictionary *)dict |
| | | extParams:(nullable NSDictionary *)extParmas |
| | | extHeaders:(nullable NSDictionary *)extHeaders |
| | | bizId:(nullable NSString *)bizId |
| | | uniqueKey:(nullable NSString *)uniqueKey |
| | | needLogin:(BOOL)needLogin |
| | | needAuth:(BOOL)needAuth |
| | | needWua:(BOOL)needWua |
| | | needPost:(BOOL)needPost |
| | | seessionExpireType:(NSInteger)seessionExpireType |
| | | complete:(nullable MtopRequestJSCallback)callback; |
| | | |
| | | @end |
| | | |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | @property(nonatomic, copy) NSString *bizId; //组件id,默认不需要填,组件发起的才需要填 |
| | | @property(nonatomic, copy) NSString *ttid;// 不设置 用默认百川的ttid |
| | | |
| | | @property(nonatomic, strong) NSDictionary *extHeaders; |
| | | |
| | | - (instancetype)initWithCmd:(NSString *)cmd; |
| | | @end |
| | |
| | | |
| | | - (NSDictionary *)generateMtopBody; |
| | | |
| | | - (NSDictionary *)generateMtopExtParams; |
| | | |
| | | //重试通知, 如果有需要在这里修改内部数据 ,否则不用管,retryCount是第几次(1开始) |
| | | //retryAction时,可以改变netType,这样重试的时候,可以改变通道方式.比如第一次用accs的,重发的时候用mtop |
| | | - (void)retryAction:(NSUInteger)retryCount; |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | #import "AlibcURLBusNativeContext.h" |
| | | #import "AlibcURLBusRequestContext.h" |
| | | #import "AlibcWebviewHookHelp.h" |
| | | #import "AlibcAlizfBridge.h" |
| | | #import "AlibcTradeSDKESConfigModel.h" |
| | | #endif |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | //url加载事件 |
| | | #define ALIBCBIZWEBVIEWLOADURL @"ALI.BC.Biz.WebviewLoadWithUrl" |
| | | |
| | | |
| | | #endif |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | #ifndef AlibcTradeBizSDK_h |
| | | #define AlibcTradeBizSDK_h |
| | | |
| | | #define AlibcTradeBizSDKVersion @"4.0.0.8" |
| | | #define AlibcTradeBizSDKVersion @"4.0.1.0" |
| | | |
| | | |
| | | @interface AlibcTradeBizSDK : NSObject |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
New file |
| | |
| | | /* |
| | | * AlibcTradeListenerFactory.h |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeCommonSDK |
| | | * 版本号:5.0.0.0 |
| | | * 发布时间:2020-01-03 |
| | | * 开发团队:阿里巴巴百川 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | NS_ASSUME_NONNULL_BEGIN |
| | | |
| | | /** |
| | | Listener 的工厂,相同 Protocol 的 Listener 只允许注册一个。 |
| | | */ |
| | | @interface AlibcTradeListenerFactory : NSObject |
| | | |
| | | /** |
| | | 注册指定的 Listener。 |
| | | */ |
| | | + (void)registerHandler:(id _Nonnull)handler withProtocol:(Protocol * _Nonnull)protocol; |
| | | |
| | | /** |
| | | 注册指定的 Listener 类。 |
| | | |
| | | @param singleton 是否是单例。如果为 YES,会将首次调用创建的实例保存起来;如果为 NO,会每次返回一个新实例。 |
| | | */ |
| | | + (void)registerHandlerClass:(Class _Nonnull)handlerClass isSingleton:(BOOL)singleton withProtocol:(Protocol * _Nonnull)protocol; |
| | | |
| | | /** |
| | | 移除指定 Protocol 的 Listener。 |
| | | */ |
| | | + (void)unregisterHandlerWithProtocol:(Protocol * _Nonnull)protocol; |
| | | |
| | | /** |
| | | 获取与指定 Protocol 关联的 Listener。 |
| | | */ |
| | | + (id _Nullable)handlerForProtocol:(Protocol * _Nonnull)protocol; |
| | | |
| | | @end |
| | | |
| | | NS_ASSUME_NONNULL_END |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
New file |
| | |
| | | // |
| | | // AlibcTradePageLifeCycle.h |
| | | // AlibcTradeBiz |
| | | // |
| | | // Created by zhongweitao on 2020/4/23. |
| | | // |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | @protocol AlibcTradePageLifeCycle <NSObject> |
| | | |
| | | @optional |
| | | |
| | | /// @brief H5 容器释放时机调用 (注意 viewController的使用,处于不完整状态) |
| | | - (void)webPageDidClose:(UIViewController *)viewController; |
| | | |
| | | @end |
| | | |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | @interface AlibcTradeMiscConfigModel:AlibcJSONModel |
| | | |
| | | @property(nonatomic,copy)NSString* failMode; |
| | | @property(nonatomic,copy)NSString* isNeedAlipay; |
| | | @property(nonatomic,copy)NSString* isNeedAlizf; |
| | | @property(nonatomic,copy)NSString* sampling; |
| | | @property(nonatomic,copy)NSString* loginDegarade; |
| | | @property(nonatomic,copy)NSString* isSyncForTaoke; |
| | | @property(nonatomic,copy)NSString* urlApi; |
| | | @property(nonatomic,assign)NSInteger al; |
| | | |
| | | |
| | | @end |
| | | @interface AlibcTradeSDKConfigModel : AlibcJSONModel |
| | | |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * 暂定 Native>小程序>h5 |
| | | */ |
| | | typedef NS_ENUM(NSUInteger, AlibcOpenPageResultType) { |
| | | /** h5展示 */ |
| | | AlibcOpenPageResultTypeH5, |
| | | /** 走App内小程序 */ |
| | | AlibcOpenPageResultTypeMiniApp, |
| | | /** 跳手淘 */ |
| | | AlibcOpenPageResultTypeNative, |
| | | /** 走App内小程序 */ |
| | | AlibcOpenPageResultTypeMiniApp |
| | | /** h5展示 */ |
| | | AlibcOpenPageResultTypeH5 |
| | | }; |
| | | |
| | | /** |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | #import <Foundation/Foundation.h> |
| | | #import "AlibcJSONModel.h" |
| | | |
| | | |
| | | @interface AlibcTradeSDKESConfigModel : AlibcJSONModel |
| | | |
| | | @property(nonatomic,copy)NSArray *urls; |
| | | @property(nonatomic,copy)NSString *sign; |
| | | |
| | | |
| | | @end |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | | |
| | | #import "AlibcTradeWebViewMonitor.h" |
| | | |
| | | |
| | | typedef NSString *AlibcTradeShowH5TaokeTypeMeasure; |
| | | |
| | |
| | | @end |
| | | |
| | | /** |
| | | UIWebView AlibcTradeShowH5Monitor Category |
| | | WKWebView AlibcTradeShowH5Monitor Category |
| | | */ |
| | | @interface UIWebView (AlibcTradeShowH5Monitor) |
| | | @interface WKWebView (AlibcTradeShowH5Monitor) |
| | | |
| | | - (void)alibc_setShowH5Monitor:(AlibcTradeShowH5Monitor *)monitor; |
| | | |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | */ |
| | | @property(nonatomic, strong) NSString *linkKey; |
| | | |
| | | |
| | | /** |
| | | * 是否需要自定义处理跳手淘/天猫失败后的处理策略,默认未无需自定义 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * AppLink唤端失败,媒体自定义降级url |
| | | * 当isNeedCustomNativeFailMode ==YES && nativeFailMode 设置为 AlibcNativeFailModeJumpDergardH5时生效 |
| | | * 当isNeedCustomNativeFailMode ==YES && nativeFailMode 设置为 AlibcNativeFailModeJumpH5时生效 |
| | | * |
| | | */ |
| | | @property(nonatomic, copy)NSString *degradeUrl; |
| | | |
| | | |
| | | @end |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | //@class AlibcTradePage; |
| | | |
| | | /** |
| | | UIWebView AlibcTradeWebViewMonitor Category |
| | | WKWebView AlibcTradeWebViewMonitor Category |
| | | */ |
| | | @interface UIWebView (AlibcTradeWebViewMonitor) |
| | | @interface WKWebView (AlibcTradeWebViewMonitor) |
| | | |
| | | - (void)alibc_setWebViewMonitor:(AlibcTradeWebViewMonitor *)monitor; |
| | | |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | #ifndef AlibcURLBus_h |
| | | #define AlibcURLBus_h |
| | | |
| | | @class UIWebView; |
| | | @class WKWebView; |
| | | @class UIViewController; |
| | | |
| | | /** 处理结果 */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | #import <UIKit/UIKit.h> |
| | | #import <WebKit/WebKit.h> |
| | | |
| | | @interface AlibcURLBusContext : NSObject |
| | | |
| | | @property(nonatomic,assign)BOOL isLoadedUrl;// 是否已经完成一次页面加载 |
| | | @property(nonatomic,assign)BOOL isConvertUrl;// 是否加载前被转链 |
| | | @property(nonatomic, copy)NSString *originalUrl;// 原始URL |
| | | @property(nonatomic, copy)NSString *convertUrl;// 被转链之后的url |
| | | |
| | | @property(nonatomic, weak) UIWebView *webview; |
| | | @property(nonatomic, weak) WKWebView *webview; |
| | | @property(nonatomic, assign) BOOL bFiltered; //标记本次加载是通过filter触发的 |
| | | @property(nonatomic, weak) UIViewController *sourceViewController; |
| | | |
| | |
| | | @property (nonatomic,strong)id param; |
| | | |
| | | |
| | | - (void)setWebviewAndViewController:(UIWebView *)webview controller:(UIViewController *)vc; |
| | | - (void)setWebviewAndViewController:(WKWebView *)webview controller:(UIViewController *)vc; |
| | | |
| | | //webview触发load事件 |
| | | - (void)setLoadWithRequest:(NSURLRequest *)request; |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | #import <UIKit/UIKit.h> |
| | | #import <WebKit/WebKit.h> |
| | | #import "AlibcTradeTaokeParams.h" |
| | | |
| | | /** |
| | | 拉起手淘失败后的处理策略 |
| | | |
| | | - AlibcNativeFailModeJumpH5: 当拉起手淘/天猫失败, 则在 webview 中跳转对应 H5(可自定义) 页面; 默认选项 |
| | | - AlibcNativeFailModeJumpDownloadPage: 当拉起手淘/天猫失败, 则跳转对应 App 下载页面(默认行为) |
| | | - AlibcNativeFailModeNone: 当拉起手淘/天猫失败, 不做任何处理; |
| | | - AlibcNativeFailModeJumpH5: 当拉起手淘/天猫失败, 则在 webview 中跳转对应 H5 (可自定义)页面; 默认选项 |
| | | - AlibcNativeFailModeJumpDownloadPage: 当拉起手淘/天猫失败, 则跳转对应 App 下载页面 |
| | | - AlibcNativeFailModeNone: 当拉起手淘/天猫失败, 不做额外操作 |
| | | */ |
| | | typedef NS_ENUM(NSInteger, AlibcNativeFailMode) { |
| | | AlibcNativeFailModeJumpH5 = 0, |
| | | AlibcNativeFailModeJumpDownloadPage = 1, |
| | | AlibcNativeFailModeNone = 2 |
| | | AlibcNativeFailModeNone = 2, |
| | | }; |
| | | |
| | | @interface AlibcURLBusNativeContext : NSObject |
| | |
| | | @property(nonatomic,assign)AlibcNativeFailMode failMode; |
| | | |
| | | // aid转链需要 |
| | | @property(nonatomic,strong) UIWebView *webview; |
| | | @property(nonatomic,strong) WKWebView *webview; |
| | | |
| | | // 淘客参数 |
| | | @property(nonatomic,strong)AlibcTradeTaokeParams *taokeParams; |
| | |
| | | // 是否被转链 |
| | | @property(nonatomic,assign)BOOL isConvertUrl; |
| | | |
| | | // 是否来自二跳 |
| | | // 是否是二跳webView |
| | | @property(nonatomic,assign)BOOL isFromWeb; |
| | | |
| | | @end |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | |
| | | /** |
| | | * AppLink唤端失败,媒体自定义降级url |
| | | * 当isNeedCustomNativeFailMode ==YES && nativeFailMode 设置为 AlibcNativeFailModeJumpDergardH5时生效 |
| | | * 当isNeedCustomNativeFailMode ==YES && nativeFailMode 设置为 AlibcNativeFailModeJumpH5时生效 |
| | | * |
| | | */ |
| | | @property(nonatomic, copy)NSString *degradeUrl; |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | #import <WebKit/WebKit.h> |
| | | #import "AlibcLinkPartnerBridge.h" |
| | | #import "AlibcTradeShowParams.h" |
| | | #import "AlibcTradeSDKDefines.h" |
| | |
| | | @property(nonatomic,strong)AlibcTradeTaokeParams *taokeParams; |
| | | |
| | | // h5承载容器 |
| | | @property(nonatomic, strong) UIWebView *webview; |
| | | @property(nonatomic, strong) WKWebView *webview; |
| | | |
| | | // 跳转发起来源页面 |
| | | @property(nonatomic, strong) UIViewController *sourceViewController; |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | #import <WebKit/WebKit.h> |
| | | |
| | | #ifndef AlibcUT_h |
| | | #define AlibcUT_h |
| | |
| | | #define ALiTRADE_TRACE_TRACKER_ID @"aliTradesdk" |
| | | |
| | | typedef NSString AlibcUTEventID; |
| | | @class UIWebView; |
| | | @class WKWebView; |
| | | @class UIViewController; |
| | | |
| | | FOUNDATION_EXTERN NSString *AlibcUTGlobalPropertySdkVersion; |
| | |
| | | @param pViewController vc |
| | | @return return value |
| | | */ |
| | | + (BOOL)h5UT:(NSDictionary *)dataDict view:(UIWebView *)pView viewController:(UIViewController *)pViewController; |
| | | + (BOOL)h5UT:(NSDictionary *)dataDict view:(WKWebView *)pView viewController:(UIViewController *)pViewController; |
| | | |
| | | |
| | | /** |
| | |
| | | args:(NSDictionary *)args; |
| | | |
| | | @optional |
| | | - (void)h5UT:(NSDictionary *)dataDict view:(UIWebView *)pView viewController:(UIViewController *)pViewController; |
| | | - (void)h5UT:(NSDictionary *)dataDict view:(WKWebView *)pView viewController:(UIViewController *)pViewController; |
| | | |
| | | #pragma mark - Other |
| | | |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | - (BOOL)isThird; |
| | | |
| | | // 三方UT无效 |
| | | - (void)h5UT:(NSDictionary *)dataDict view:(UIWebView *)pView viewController:(UIViewController *)pViewController; |
| | | - (void)h5UT:(NSDictionary *)dataDict view:(WKWebView *)pView viewController:(UIViewController *)pViewController; |
| | | |
| | | @end |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | // 是否不允许唤端 |
| | | @property(nonatomic,assign)BOOL isNotAllowLink; |
| | | |
| | | |
| | | @end |
| | | |
| | | NS_ASSUME_NONNULL_END |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | /** 卸载 */ |
| | | + (void)uninstall:(NSDictionary *)context; |
| | | |
| | | + (void)currentUserAgent; |
| | | |
| | | @end |
| | | |
| | | #endif |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | #import <UIKit/UIKit.h> |
| | | #import <WebKit/WebKit.h> |
| | | |
| | | #ifndef AlibcWebViewController_h |
| | | #define AlibcWebViewController_h |
| | | |
| | | @interface AlibcWebViewController : UIViewController <UIWebViewDelegate> |
| | | @property(strong, nonatomic) UIWebView *webView; |
| | | @interface AlibcWebViewController : UIViewController <WKNavigationDelegate> |
| | | @property(strong, nonatomic) WKWebView *webView; |
| | | @end |
| | | |
| | | #endif |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | #import <WebKit/WebKit.h> |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | #import "AlibcMultiDelegates.h" |
| | |
| | | @optional |
| | | |
| | | /** |
| | | 前面的参数同 - (void)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType |
| | | @param returnValue Delegate 响应时的返回值 |
| | | 前面的参数同 |
| | | */ |
| | | - (void)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType returnValue:(BOOL)returnValue; |
| | | |
| | | - (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler; |
| | | |
| | | /** |
| | | WebView 开始加载 |
| | | */ |
| | | - (void)webViewDidStartLoad:(UIWebView *)webView; |
| | | - (void)webViewDidStartLoad:(WKWebView *)webView; |
| | | |
| | | /** |
| | | WebView 结束加载 |
| | | */ |
| | | - (void)webViewDidFinishLoad:(UIWebView *)webView; |
| | | - (void)webViewDidFinishLoad:(WKWebView *)webView; |
| | | |
| | | /** |
| | | WebView 加载失败 |
| | | |
| | | @param error error instance |
| | | */ |
| | | - (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error; |
| | | - (void)webView:(WKWebView *)webView didFailLoadWithError:(NSError *)error; |
| | | |
| | | @end |
| | | |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | #import "AlibcWebViewService.h" |
| | | #import "AlibcURLBus.h" |
| | | |
| | | #ifndef AlibcWebViewServiceImpl_h |
| | | #define AlibcWebViewServiceImpl_h |
| | | |
| | | @interface AlibcWebViewServiceImpl : NSObject <AlibcWebViewService> |
| | | @interface AlibcWebViewServiceImpl : NSObject |
| | | + (instancetype)sharedInstance; |
| | | |
| | | - (void)bindWebviewService:(UIWebView *)webview sourceViewController:(UIViewController *)sourceViewController; |
| | | - (void)bindWebviewService:(WKWebView *)webview sourceViewController:(UIViewController *)sourceViewController; |
| | | |
| | | - (void)bindWebviewService:(UIWebView *)webview context:(AlibcURLBusContext *)context; |
| | | - (void)bindWebviewService:(WKWebView *)webview context:(AlibcURLBusContext *)context; |
| | | |
| | | - (AlibcURLBusContext *)getContextByWebview:(UIWebView *)webview; |
| | | - (AlibcURLBusContext *)getContextByWebview:(WKWebView *)webview; |
| | | @end |
| | | |
| | | #endif |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | |
| | | @class NSURLRequest; |
| | | @class UIViewController; |
| | | @class UIWebView; |
| | | @class WKWebView; |
| | | @class NSURL; |
| | | |
| | | @interface AlibcWebviewHookHelp : NSObject |
| | |
| | | |
| | | @property(nonatomic,assign)double lastAutoLoginTime; |
| | | |
| | | - (BOOL)webView:(nonnull UIWebView *)webView sourceViewController:(nonnull UIViewController *)vc shouldStartLoadWithRequest:(nonnull NSURLRequest *)request; |
| | | |
| | | - (BOOL)webView:(nonnull UIWebView *)webView context:(nonnull AlibcURLBusContext *)context shouldStartLoadWithRequest:(nonnull NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType; |
| | | - (BOOL)webView:(WKWebView *_Nonnull)webView context:(nonnull AlibcURLBusContext *)context decidePolicyForNavigationAction:(WKNavigationAction *_Nonnull)navigationAction decisionHandler:(void (^_Nonnull)(WKNavigationActionPolicy))decisionHandler; |
| | | |
| | | |
| | | - (void)beforeWebViewStartLoad:(nullable NSURL *)url; |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | */ |
| | | - (BOOL)alibc_isSameTypeUrl:(NSURL *)url; |
| | | |
| | | |
| | | |
| | | @end |
| | | |
| | | #endif /* NSURL_ALIURL_h */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeBiz |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | <plist version="1.0"> |
| | | <dict> |
| | | <key>BuildMachineOSBuild</key> |
| | | <string>17G65</string> |
| | | <string>18G103</string> |
| | | <key>CFBundleDevelopmentRegion</key> |
| | | <string>en</string> |
| | | <key>CFBundleExecutable</key> |
| | |
| | | <key>CFBundlePackageType</key> |
| | | <string>FMWK</string> |
| | | <key>CFBundleShortVersionString</key> |
| | | <string>4.0.0.2-bugfix-SNAPSHOT</string> |
| | | <string>4.0.0.0-SNAPSHOT</string> |
| | | <key>CFBundleSupportedPlatforms</key> |
| | | <array> |
| | | <string>iPhoneOS</string> |
| | |
| | | <key>DTXcodeBuild</key> |
| | | <string>10B61</string> |
| | | <key>MinimumOSVersion</key> |
| | | <string>8.0</string> |
| | | <string>9.0</string> |
| | | <key>UIDeviceFamily</key> |
| | | <array> |
| | | <integer>1</integer> |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeSDK |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeSDK |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | #import "AlibcTradePageFactory.h" |
| | | #import "AlibcTradeService.h" |
| | | #import <AlibcTradeBiz/AlibcTradeShowParams.h> |
| | | |
| | | |
| | | @interface AlibcTradeSDK : NSObject |
| | | |
| | |
| | | /** |
| | | * 获取service对象,该对象包含大部分Trade相关的方法 |
| | | */ |
| | | - (id <AlibcTradeService>)tradeService; |
| | | |
| | | - (id<AlibcTradeService>)tradeService; |
| | | |
| | | /** |
| | | * App 回跳处理, 适用于 iOS 9 以下的回调接口 |
| | | |
| | | |
| | | @param application application |
| | | @param url url |
| | | @param sourceApplication sourceApplication |
| | | @param annotation annotation |
| | | @return handled or nor |
| | | */ |
| | | - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation; |
| | | - (BOOL)application:(UIApplication *)application |
| | | openURL:(NSURL *)url |
| | | sourceApplication:(NSString *)sourceApplication |
| | | annotation:(id)annotation; |
| | | |
| | | /** |
| | | * App 回跳处理, 适用于 iOS 9 起的回调接口 |
| | | |
| | | |
| | | @param annotation annotation |
| | | @param url url |
| | | @param options options |
| | |
| | | */ |
| | | - (BOOL)application:(UIApplication *)application |
| | | openURL:(NSURL *)url |
| | | options:(NSDictionary<NSString *, id> *)options NS_AVAILABLE_IOS(9_0); |
| | | options:(NSDictionary<NSString *, id> *)options |
| | | NS_AVAILABLE_IOS(9_0); |
| | | |
| | | @end |
| | | |
| | |
| | | - (void)enableAuthVipMode; |
| | | |
| | | /** |
| | | * 设置是否需要 Native Alizf 接口 |
| | | * 设置是否需要 Native AliZf 接口 |
| | | * |
| | | * @param shouldUseAlizf 是否需要 Native Alizf 接口 |
| | | * @param shouldUseAlizf 是否需要 Native AliZf 接口 |
| | | */ |
| | | - (void)setShouldUseAlizfNative:(BOOL)shouldUseAlizfNative; |
| | | |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeSDK |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | #import <WebKit/WebKit.h> |
| | | #import <AlibcTradeBiz/AlibcTradeResult.h> |
| | | #import "AlibcTradePageFactory.h" |
| | | #import <AlibcTradeBiz/AlibcTradeShowParams.h> |
| | | #import <AlibcTradeBiz/AlibcTradeSDKDefines.h> |
| | | |
| | | @class UIViewController; |
| | | @class UIWebView; |
| | | @class WKWebView; |
| | | |
| | | /** 电商服务 */ |
| | | @protocol AlibcTradeService<NSObject> |
| | |
| | | */ |
| | | - (NSInteger)openByUrl:(NSString *__nonnull)url |
| | | identity:(NSString *__nonnull)identity |
| | | webView:(nullable UIWebView *)webView |
| | | webView:(WKWebView *_Nullable)webView |
| | | parentController:(UIViewController *__nonnull)parentController |
| | | showParams:(nullable AlibcTradeShowParams *)showParams |
| | | taoKeParams:(nullable AlibcTradeTaokeParams *)taoKeParams |
| | |
| | | 1: 标识用h5打开了 |
| | | 2: 标识用小程序打开了Url |
| | | -1: 入参出错 |
| | | -2: 打开页面 |
| | | * -4: sdk初始化失败 |
| | | -2: 打开页面失败 |
| | | -4: sdk初始化失败 |
| | | * -5: 该版本SDK已被废弃,需要升级 |
| | | * -6: sdk不允许唤端 |
| | | * -6: sdkh不允许唤端 |
| | | |
| | | * |
| | | * |
| | | * 返回值 仅一种情况需要媒体处理 即当AlibcTradeShowParams 中 isNeedPush 为 |
| | | YES时.此时需要媒体根据API返回值为1时 |
| | |
| | | */ |
| | | - (NSInteger)openByBizCode:(NSString *__nonnull)pageCode |
| | | page:(id <AlibcTradePage> __nonnull)page |
| | | webView:(nullable UIWebView *)webView |
| | | webView:(WKWebView *_Nullable)webView |
| | | parentController:(UIViewController *__nonnull)parentController |
| | | showParams:(nullable AlibcTradeShowParams *)showParams |
| | | taoKeParams:(nullable AlibcTradeTaokeParams *)taoKeParams |
| | |
| | | * |
| | | * 阿里百川电商 |
| | | * 项目名称:阿里巴巴电商 AlibcTradeSDK |
| | | * 版本号:4.0.0.8 |
| | | * 发布时间:2019-11-11 |
| | | * 开发团队:阿里巴巴百川团队 |
| | | * 版本号:4.0.0.9 |
| | | * 发布时间:2019-10-31 |
| | | * 开发团队:阿里巴巴商家服务引擎团队 |
| | | * 阿里巴巴电商SDK答疑群号:1488705339 2071154343(阿里旺旺) |
| | | * Copyright (c) 2016-2020 阿里巴巴-淘宝-百川. All rights reserved. |
| | | */ |
| | |
| | | <plist version="1.0"> |
| | | <dict> |
| | | <key>BuildMachineOSBuild</key> |
| | | <string>17G65</string> |
| | | <string>18G103</string> |
| | | <key>CFBundleDevelopmentRegion</key> |
| | | <string>en</string> |
| | | <key>CFBundleExecutable</key> |
| | |
| | | <key>CFBundlePackageType</key> |
| | | <string>FMWK</string> |
| | | <key>CFBundleShortVersionString</key> |
| | | <string>4.0.0.2-bugfix-SNAPSHOT</string> |
| | | <string>4.0.0.0-SNAPSHOT</string> |
| | | <key>CFBundleSignature</key> |
| | | <string>????</string> |
| | | <key>CFBundleSupportedPlatforms</key> |
| | |
| | | <key>DTXcodeBuild</key> |
| | | <string>10B61</string> |
| | | <key>MinimumOSVersion</key> |
| | | <string>8.0</string> |
| | | <string>9.0</string> |
| | | <key>UIDeviceFamily</key> |
| | | <array> |
| | | <integer>1</integer> |
| | |
| | | <plist version="1.0"> |
| | | <dict> |
| | | <key>BuildMachineOSBuild</key> |
| | | <string>17G65</string> |
| | | <string>18D109</string> |
| | | <key>CFBundleDevelopmentRegion</key> |
| | | <string>English</string> |
| | | <key>CFBundleExecutable</key> |
| | |
| | | - AFNetworking/Serialization (3.2.1) |
| | | - AFNetworking/UIKit (3.2.1): |
| | | - AFNetworking/NSURLSession |
| | | - AliAuthSDK (2.0.0.3) |
| | | - AlibcTradeSDK (4.0.0.8) |
| | | - AliAuthSDK (1.1.0.41-bc) |
| | | - AlibcTradeSDK (4.0.1.6) |
| | | - AliLinkPartnerSDK (4.0.0.24) |
| | | - BCUserTrack (5.2.0.11-appkeys): |
| | | - BCUserTrack (5.2.0.16-appkeys): |
| | | - UTDID |
| | | - CRBoxInputView (1.0.1): |
| | | - Masonry |
| | |
| | | - mob_sharesdk/ShareSDK |
| | | - MOBFoundation |
| | | - MOBFoundation (3.2.6) |
| | | - mtopSDK (3.0.0.4) |
| | | - mtopSDK (3.0.0.3-BC) |
| | | - ReactiveCocoa (2.5.2): |
| | | - ReactiveCocoa/UI (= 2.5.2) |
| | | - ReactiveCocoa/Core (2.5.2): |
| | |
| | | - SDWebImage (5.1.1): |
| | | - SDWebImage/Core (= 5.1.1) |
| | | - SDWebImage/Core (5.1.1) |
| | | - securityGuard (5.4.173) |
| | | - securityGuard (5.4.191) |
| | | - SVProgressHUD (2.2.5) |
| | | - Toast (4.0.0) |
| | | - TYSnapshotScroll (0.0.7) |
| | |
| | | - UMCCommon |
| | | - UMCShare/Core |
| | | - UTDID (1.1.0.16) |
| | | - WindVane (8.5.0.46-bc11): |
| | | - WindVane/Basic (= 8.5.0.46-bc11) |
| | | - WindVane/Core (= 8.5.0.46-bc11) |
| | | - WindVane/WindVane (= 8.5.0.46-bc11) |
| | | - WindVane/Basic (8.5.0.46-bc11) |
| | | - WindVane/Core (8.5.0.46-bc11) |
| | | - WindVane/WindVane (8.5.0.46-bc11) |
| | | - YYCache (1.0.4) |
| | | - YYImage (1.0.4): |
| | | - YYImage/Core (= 1.0.4) |
| | |
| | | |
| | | DEPENDENCIES: |
| | | - AFNetworking (~> 3.0) |
| | | - AliAuthSDK (= 2.0.0.3) |
| | | - AlibcTradeSDK (= 4.0.0.8) |
| | | - AliAuthSDK (= 1.1.0.41-bc) |
| | | - AlibcTradeSDK (= 4.0.1.6) |
| | | - AliLinkPartnerSDK (= 4.0.0.24) |
| | | - BCUserTrack (= 5.2.0.11-appkeys) |
| | | - BCUserTrack (= 5.2.0.16-appkeys) |
| | | - CRBoxInputView (= 1.0.1) |
| | | - GPUImage |
| | | - IQKeyboardManager |
| | |
| | | - mob_sharesdk/ShareSDKPlatforms/SinaWeibo |
| | | - mob_sharesdk/ShareSDKPlatforms/WeChat |
| | | - mob_sharesdk/ShareSDKUI |
| | | - mtopSDK (= 3.0.0.4) |
| | | - mtopSDK (= 3.0.0.3-BC) |
| | | - ReactiveCocoa (from `https://github.com/zhao0/ReactiveCocoa.git`, tag `2.5.2`) |
| | | - SAMKeychain |
| | | - SDAutoLayout |
| | | - SDWebImage (~> 5.1.1) |
| | | - securityGuard (= 5.4.173) |
| | | - securityGuard (= 5.4.191) |
| | | - SVProgressHUD |
| | | - Toast |
| | | - TYSnapshotScroll |
| | |
| | | - UMCShare/Social/ReducedWeChat |
| | | - UMCShare/UI |
| | | - UTDID (= 1.1.0.16) |
| | | - WindVane (= 8.5.0.46-bc11) |
| | | - YYImage/WebP |
| | | - YYModel |
| | | - YYText |
| | |
| | | - mtopSDK |
| | | - securityGuard |
| | | - UTDID |
| | | - WindVane |
| | | https://github.com/cocoapods/specs.git: |
| | | - AFNetworking |
| | | - CRBoxInputView |
| | |
| | | |
| | | SPEC CHECKSUMS: |
| | | AFNetworking: b6f891fdfaed196b46c7a83cf209e09697b94057 |
| | | AliAuthSDK: be6caff0bb645ad663c75f311170b2a3b069780e |
| | | AlibcTradeSDK: 72d36e433ecfbd4c78b5199f0db4f70fd4be374b |
| | | AliAuthSDK: 7018e8f3c8be3382e60f69d3b517c7de34c351e0 |
| | | AlibcTradeSDK: 9a3e7af6cd648dd1f85684e82694c213fe48dad2 |
| | | AliLinkPartnerSDK: c5778cdfdcee7bfe342238d39a77766184d36a46 |
| | | BCUserTrack: f267dfb52a6e67603c33668f2e9384ee01b68a88 |
| | | BCUserTrack: ea53788070a12046c5b40fb426293f3b7a8a0c9d |
| | | CRBoxInputView: 93cf523613369ec67643d1c78e5c8a22e401983a |
| | | GPUImage: 733a5f0fab92df9de1c37ba9df520a833ccb406d |
| | | IQKeyboardManager: 700e5155d6a292383b54e8678aec769e14fc78fc |
| | |
| | | MJRefresh: ed450d6eb9d3346a2cb033ab7eb6de090aeef437 |
| | | mob_sharesdk: 48cb240a4b9cc393be2d6ff9c5b597ae77a1da73 |
| | | MOBFoundation: 08c456357888e4c984fba23bbf04cfd2f4fc1e02 |
| | | mtopSDK: bf447d4361b0199790e2a2829a1cc0299df71716 |
| | | mtopSDK: d6fdf81730342a69be920b576541c7bb81a683d5 |
| | | ReactiveCocoa: 3ff25b1bd992ac79c5c79b26b6c0c1713b715bb2 |
| | | SAMKeychain: 483e1c9f32984d50ca961e26818a534283b4cd5c |
| | | SDAutoLayout: 8bf6b3bbc8b01f775d4defbb4fda2ace805461be |
| | | SDWebImage: 96d7f03415ccb28d299d765f93557ff8a617abd8 |
| | | securityGuard: 35d3a1b5877bb2de4698a78089eb8906fa3ad27b |
| | | securityGuard: 9c04c44a3b663f36e15064042abfc107fa07133c |
| | | SVProgressHUD: 1428aafac632c1f86f62aa4243ec12008d7a51d6 |
| | | Toast: 91b396c56ee72a5790816f40d3a94dd357abc196 |
| | | TYSnapshotScroll: 699a985c9d630f00b62b90bb3ba5ea9ccd03767a |
| | |
| | | UMCCommon: 971f324a5a99c9d662ae040a815e7e3d7ef8b2a8 |
| | | UMCShare: e0cef55c0fd6051254c8cda1d0630eb578b27bad |
| | | UTDID: c28855683c5ea2e77e597cb14609328f7d470d6e |
| | | WindVane: 56e096abae757397ccd3accb66a959f3ffcbf949 |
| | | YYCache: 8105b6638f5e849296c71f331ff83891a4942952 |
| | | YYImage: 1e1b62a9997399593e4b9c4ecfbbabbf1d3f3b54 |
| | | YYModel: 2a7fdd96aaa4b86a824e26d0c517de8928c04b30 |
| | | YYText: 5c461d709e24d55a182d1441c41dc639a18a4849 |
| | | YYWebImage: 5f7f36aee2ae293f016d418c7d6ba05c4863e928 |
| | | |
| | | PODFILE CHECKSUM: 95a4ef54bbe59a7fb561f803de7be68f42c9551e |
| | | PODFILE CHECKSUM: 5a3aed10479b939f477ffc166e80e3b05bcd5148 |
| | | |
| | | COCOAPODS: 1.5.3 |
| | |
| | | Alibaba-INC copyright |
| | | |
| | | |
| | | ## WindVane |
| | | |
| | | Alibaba-INC copyright |
| | | |
| | | ## YYCache |
| | | |
| | | The MIT License (MIT) |
| | |
| | | </dict> |
| | | <dict> |
| | | <key>FooterText</key> |
| | | <string>Alibaba-INC copyright</string> |
| | | <key>License</key> |
| | | <string>Copyright</string> |
| | | <key>Title</key> |
| | | <string>WindVane</string> |
| | | <key>Type</key> |
| | | <string>PSGroupSpecifier</string> |
| | | </dict> |
| | | <dict> |
| | | <key>FooterText</key> |
| | | <string>The MIT License (MIT) |
| | | |
| | | Copyright (c) 2015 ibireme <ibireme@gmail.com> |
| | |
| | | install_resource "${PODS_ROOT}/AliLinkPartnerSDK/AlibcLinkPartnerSDK.framework/SmartLink.bundle" |
| | | install_resource "${PODS_ROOT}/AlibcTradeSDK/AlibcTradeBiz.framework/NBResource.bundle" |
| | | install_resource "${PODS_ROOT}/UMCShare/UMShare/UMSocialUI/UMSocialSDKResources.bundle" |
| | | install_resource "${PODS_ROOT}/WindVane/WindVaneBasic.framework/Resources/WindVaneBasic.bundle" |
| | | install_resource "${PODS_ROOT}/WindVane/WindVaneBasic.framework/Resources/NebulaWK.bundle" |
| | | install_resource "${PODS_ROOT}/WindVane/WindVaneCore.framework/WindVaneBasic.bundle" |
| | | install_resource "${PODS_ROOT}/WindVane/WindVaneCore.framework/NebulaWK.bundle" |
| | | install_resource "${PODS_ROOT}/mob_sharesdk/ShareSDK/Support/PlatformSDK/SinaWeiboSDK/WeiboSDK.bundle" |
| | | install_resource "${PODS_ROOT}/mob_sharesdk/ShareSDK/Support/Optional/ShareSDKUI.bundle" |
| | | install_resource "${PODS_CONFIGURATION_BUILD_DIR}/mob_sharesdk/ShareSDK.bundle" |
| | | install_resource "${PODS_CONFIGURATION_BUILD_DIR}/mob_sharesdk/ShareSDK_JS_QQ.bundle" |
| | | install_resource "${PODS_CONFIGURATION_BUILD_DIR}/mob_sharesdk/ShareSDK_JS_SinaWeibo.bundle" |
| | | install_resource "${PODS_CONFIGURATION_BUILD_DIR}/mob_sharesdk/ShareSDK_JS_WeChat.bundle" |
| | | install_resource "${PODS_ROOT}/securityGuard/SGMiddleTier.framework/bx-cancel.png" |
| | | install_resource "${PODS_ROOT}/securityGuard/SGMiddleTier.framework/bx-cancel@2x.png" |
| | | install_resource "${PODS_ROOT}/securityGuard/SGMiddleTier.framework/bx-refresh.png" |
| | | install_resource "${PODS_ROOT}/securityGuard/SGMiddleTier.framework/bx-refresh@2x.png" |
| | | fi |
| | | if [[ "$CONFIGURATION" == "Release" ]]; then |
| | | install_resource "${PODS_ROOT}/AliAuthSDK/AlibabaAuthSDK.framework/AlibabaAuthSDK.bundle" |
| | | install_resource "${PODS_ROOT}/AliLinkPartnerSDK/AlibcLinkPartnerSDK.framework/SmartLink.bundle" |
| | | install_resource "${PODS_ROOT}/AlibcTradeSDK/AlibcTradeBiz.framework/NBResource.bundle" |
| | | install_resource "${PODS_ROOT}/UMCShare/UMShare/UMSocialUI/UMSocialSDKResources.bundle" |
| | | install_resource "${PODS_ROOT}/WindVane/WindVaneBasic.framework/Resources/WindVaneBasic.bundle" |
| | | install_resource "${PODS_ROOT}/WindVane/WindVaneBasic.framework/Resources/NebulaWK.bundle" |
| | | install_resource "${PODS_ROOT}/WindVane/WindVaneCore.framework/WindVaneBasic.bundle" |
| | | install_resource "${PODS_ROOT}/WindVane/WindVaneCore.framework/NebulaWK.bundle" |
| | | install_resource "${PODS_ROOT}/mob_sharesdk/ShareSDK/Support/PlatformSDK/SinaWeiboSDK/WeiboSDK.bundle" |
| | | install_resource "${PODS_ROOT}/mob_sharesdk/ShareSDK/Support/Optional/ShareSDKUI.bundle" |
| | | install_resource "${PODS_CONFIGURATION_BUILD_DIR}/mob_sharesdk/ShareSDK.bundle" |
| | | install_resource "${PODS_CONFIGURATION_BUILD_DIR}/mob_sharesdk/ShareSDK_JS_QQ.bundle" |
| | | install_resource "${PODS_CONFIGURATION_BUILD_DIR}/mob_sharesdk/ShareSDK_JS_SinaWeibo.bundle" |
| | | install_resource "${PODS_CONFIGURATION_BUILD_DIR}/mob_sharesdk/ShareSDK_JS_WeChat.bundle" |
| | | install_resource "${PODS_ROOT}/securityGuard/SGMiddleTier.framework/bx-cancel.png" |
| | | install_resource "${PODS_ROOT}/securityGuard/SGMiddleTier.framework/bx-cancel@2x.png" |
| | | install_resource "${PODS_ROOT}/securityGuard/SGMiddleTier.framework/bx-refresh.png" |
| | | install_resource "${PODS_ROOT}/securityGuard/SGMiddleTier.framework/bx-refresh@2x.png" |
| | | fi |
| | | |
| | | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" |
| | |
| | | CLANG_MODULES_AUTOLINK = YES |
| | | FRAMEWORK_SEARCH_PATHS = $(inherited) $(PODS_ROOT)/UTDID "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking" "${PODS_CONFIGURATION_BUILD_DIR}/CRBoxInputView" "${PODS_CONFIGURATION_BUILD_DIR}/GPUImage" "${PODS_CONFIGURATION_BUILD_DIR}/IQKeyboardManager" "${PODS_CONFIGURATION_BUILD_DIR}/MBProgressHUD" "${PODS_CONFIGURATION_BUILD_DIR}/MJRefresh" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" "${PODS_CONFIGURATION_BUILD_DIR}/ReactiveCocoa" "${PODS_CONFIGURATION_BUILD_DIR}/SAMKeychain" "${PODS_CONFIGURATION_BUILD_DIR}/SDAutoLayout" "${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage" "${PODS_CONFIGURATION_BUILD_DIR}/SVProgressHUD" "${PODS_CONFIGURATION_BUILD_DIR}/TYSnapshotScroll" "${PODS_CONFIGURATION_BUILD_DIR}/TZImagePickerController" "${PODS_CONFIGURATION_BUILD_DIR}/Toast" "${PODS_CONFIGURATION_BUILD_DIR}/UICollectionViewLeftAlignedLayout" "${PODS_CONFIGURATION_BUILD_DIR}/UICountingLabel" "${PODS_CONFIGURATION_BUILD_DIR}/YYCache" "${PODS_CONFIGURATION_BUILD_DIR}/YYImage" "${PODS_CONFIGURATION_BUILD_DIR}/YYModel" "${PODS_CONFIGURATION_BUILD_DIR}/YYText" "${PODS_CONFIGURATION_BUILD_DIR}/YYWebImage" "${PODS_ROOT}/AliAuthSDK" "${PODS_ROOT}/AliLinkPartnerSDK" "${PODS_ROOT}/AlibcTradeSDK" "${PODS_ROOT}/BCUserTrack" "${PODS_ROOT}/MOBFoundation/MOBFoundation" "${PODS_ROOT}/UMCAnalytics" "${PODS_ROOT}/UMCCommon" "${PODS_ROOT}/UMCShare/UMShare" "${PODS_ROOT}/UMCShare/UMShare/UMSocialUI" "${PODS_ROOT}/UTDID" "${PODS_ROOT}/mob_sharesdk/ShareSDK" "${PODS_ROOT}/mob_sharesdk/ShareSDK/Support/Required" "${PODS_ROOT}/mob_sharesdk/ShareSDK/Support/PlatformSDK/QQSDK" "${PODS_ROOT}/mob_sharesdk/ShareSDK/Support/PlatformConnector" "${PODS_ROOT}/mob_sharesdk/ShareSDK/Support/Optional" "${PODS_ROOT}/mtopSDK" "${PODS_ROOT}/securityGuard" |
| | | FRAMEWORK_SEARCH_PATHS = $(inherited) $(PODS_ROOT)/UTDID "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking" "${PODS_CONFIGURATION_BUILD_DIR}/CRBoxInputView" "${PODS_CONFIGURATION_BUILD_DIR}/GPUImage" "${PODS_CONFIGURATION_BUILD_DIR}/IQKeyboardManager" "${PODS_CONFIGURATION_BUILD_DIR}/MBProgressHUD" "${PODS_CONFIGURATION_BUILD_DIR}/MJRefresh" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" "${PODS_CONFIGURATION_BUILD_DIR}/ReactiveCocoa" "${PODS_CONFIGURATION_BUILD_DIR}/SAMKeychain" "${PODS_CONFIGURATION_BUILD_DIR}/SDAutoLayout" "${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage" "${PODS_CONFIGURATION_BUILD_DIR}/SVProgressHUD" "${PODS_CONFIGURATION_BUILD_DIR}/TYSnapshotScroll" "${PODS_CONFIGURATION_BUILD_DIR}/TZImagePickerController" "${PODS_CONFIGURATION_BUILD_DIR}/Toast" "${PODS_CONFIGURATION_BUILD_DIR}/UICollectionViewLeftAlignedLayout" "${PODS_CONFIGURATION_BUILD_DIR}/UICountingLabel" "${PODS_CONFIGURATION_BUILD_DIR}/YYCache" "${PODS_CONFIGURATION_BUILD_DIR}/YYImage" "${PODS_CONFIGURATION_BUILD_DIR}/YYModel" "${PODS_CONFIGURATION_BUILD_DIR}/YYText" "${PODS_CONFIGURATION_BUILD_DIR}/YYWebImage" "${PODS_ROOT}/AliAuthSDK" "${PODS_ROOT}/AliLinkPartnerSDK" "${PODS_ROOT}/AlibcTradeSDK" "${PODS_ROOT}/BCUserTrack" "${PODS_ROOT}/MOBFoundation/MOBFoundation" "${PODS_ROOT}/UMCAnalytics" "${PODS_ROOT}/UMCCommon" "${PODS_ROOT}/UMCShare/UMShare" "${PODS_ROOT}/UMCShare/UMShare/UMSocialUI" "${PODS_ROOT}/UTDID" "${PODS_ROOT}/WindVane" "${PODS_ROOT}/mob_sharesdk/ShareSDK" "${PODS_ROOT}/mob_sharesdk/ShareSDK/Support/Required" "${PODS_ROOT}/mob_sharesdk/ShareSDK/Support/PlatformSDK/QQSDK" "${PODS_ROOT}/mob_sharesdk/ShareSDK/Support/PlatformConnector" "${PODS_ROOT}/mob_sharesdk/ShareSDK/Support/Optional" "${PODS_ROOT}/mtopSDK" "${PODS_ROOT}/securityGuard" |
| | | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 |
| | | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/UMCShare" "${PODS_ROOT}/Headers/Public/mob_sharesdk" |
| | | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' |
| | | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/UMCShare/UMShare/SocialLibraries/WeChat" "${PODS_ROOT}/mob_sharesdk/ShareSDK/Support/PlatformSDK/SinaWeiboSDK" "${PODS_ROOT}/mob_sharesdk/ShareSDK/Support/PlatformSDK/WeChatSDK" |
| | | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking/AFNetworking.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/CRBoxInputView/CRBoxInputView.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/GPUImage/GPUImage.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/IQKeyboardManager/IQKeyboardManager.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/MBProgressHUD/MBProgressHUD.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/MJRefresh/MJRefresh.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Masonry/Masonry.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/ReactiveCocoa/ReactiveCocoa.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/SAMKeychain/SAMKeychain.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/SDAutoLayout/SDAutoLayout.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage/SDWebImage.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/SVProgressHUD/SVProgressHUD.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/TYSnapshotScroll/TYSnapshotScroll.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/TZImagePickerController/TZImagePickerController.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Toast/Toast.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/UICollectionViewLeftAlignedLayout/UICollectionViewLeftAlignedLayout.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/UICountingLabel/UICountingLabel.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/YYCache/YYCache.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/YYImage/YYImage.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/YYModel/YYModel.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/YYText/YYText.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/YYWebImage/YYWebImage.framework/Headers" -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/UMCShare" -isystem "${PODS_ROOT}/Headers/Public/mob_sharesdk" |
| | | OTHER_LDFLAGS = $(inherited) -ObjC -l"SocialWeChat" -l"WeChatSDK" -l"WeiboSDK" -l"c++" -l"sqlite3" -l"z" -framework "AFNetworking" -framework "AlibabaAuthExt" -framework "AlibabaAuthSDK" -framework "AlibcLinkPartnerSDK" -framework "AlibcTradeBiz" -framework "AlibcTradeSDK" -framework "CFNetwork" -framework "CRBoxInputView" -framework "CoreFoundation" -framework "CoreGraphics" -framework "CoreLocation" -framework "CoreMotion" -framework "CoreTelephony" -framework "Foundation" -framework "GPUImage" -framework "IQKeyboardManager" -framework "ImageIO" -framework "JavaScriptCore" -framework "MBProgressHUD" -framework "MJRefresh" -framework "MOBFoundation" -framework "MOBFoundationEx" -framework "Masonry" -framework "MtopSDK" -framework "QQConnector" -framework "QuartzCore" -framework "ReactiveCocoa" -framework "SAMKeychain" -framework "SDAutoLayout" -framework "SDWebImage" -framework "SGAVMP" -framework "SGMain" -framework "SGMiddleTier" -framework "SGSecurityBody" -framework "SVProgressHUD" -framework "Security" -framework "SecurityGuardSDK" -framework "ShareSDK" -framework "ShareSDKConnector" -framework "ShareSDKUI" -framework "SinaWeiboConnector" -framework "SystemConfiguration" -framework "TYSnapshotScroll" -framework "TZImagePickerController" -framework "TencentOpenAPI" -framework "Toast" -framework "UICollectionViewLeftAlignedLayout" -framework "UICountingLabel" -framework "UIKit" -framework "UMAnalytics" -framework "UMCommon" -framework "UMShare" -framework "UShareUI" -framework "UTDID" -framework "UTMini" -framework "WechatConnector" -framework "YYCache" -framework "YYImage" -framework "YYModel" -framework "YYText" -framework "YYWebImage" -framework "mtopcoreopen" -framework "mtopext" -weak_framework "AdSupport" |
| | | OTHER_LDFLAGS = $(inherited) -ObjC -l"SocialWeChat" -l"WeChatSDK" -l"WeiboSDK" -l"c++" -l"sqlite3" -l"z" -framework "AFNetworking" -framework "AlibabaAuthEntrance" -framework "AlibabaAuthExt" -framework "AlibabaAuthSDK" -framework "AlibcLinkPartnerSDK" -framework "AlibcTradeBiz" -framework "AlibcTradeSDK" -framework "CFNetwork" -framework "CRBoxInputView" -framework "CoreFoundation" -framework "CoreGraphics" -framework "CoreLocation" -framework "CoreMotion" -framework "CoreTelephony" -framework "Foundation" -framework "GPUImage" -framework "IQKeyboardManager" -framework "ImageIO" -framework "JavaScriptCore" -framework "MBProgressHUD" -framework "MJRefresh" -framework "MOBFoundation" -framework "MOBFoundationEx" -framework "Masonry" -framework "MtopSDK" -framework "QQConnector" -framework "QuartzCore" -framework "ReactiveCocoa" -framework "SAMKeychain" -framework "SDAutoLayout" -framework "SDWebImage" -framework "SGAVMP" -framework "SGMain" -framework "SGMiddleTier" -framework "SGSecurityBody" -framework "SVProgressHUD" -framework "Security" -framework "SecurityGuardSDK" -framework "ShareSDK" -framework "ShareSDKConnector" -framework "ShareSDKUI" -framework "SinaWeiboConnector" -framework "SystemConfiguration" -framework "TYSnapshotScroll" -framework "TZImagePickerController" -framework "TencentOpenAPI" -framework "Toast" -framework "UICollectionViewLeftAlignedLayout" -framework "UICountingLabel" -framework "UIKit" -framework "UMAnalytics" -framework "UMCommon" -framework "UMShare" -framework "UShareUI" -framework "UTDID" -framework "UTMini" -framework "WechatConnector" -framework "WindVane" -framework "WindVaneBasic" -framework "WindVaneCore" -framework "YYCache" -framework "YYImage" -framework "YYModel" -framework "YYText" -framework "YYWebImage" -framework "mtopcoreopen" -framework "mtopext" -weak_framework "AdSupport" -weak_framework "WebKit" |
| | | PODS_BUILD_DIR = ${BUILD_DIR} |
| | | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) |
| | | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. |
| | |
| | | CLANG_MODULES_AUTOLINK = YES |
| | | FRAMEWORK_SEARCH_PATHS = $(inherited) $(PODS_ROOT)/UTDID "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking" "${PODS_CONFIGURATION_BUILD_DIR}/CRBoxInputView" "${PODS_CONFIGURATION_BUILD_DIR}/GPUImage" "${PODS_CONFIGURATION_BUILD_DIR}/IQKeyboardManager" "${PODS_CONFIGURATION_BUILD_DIR}/MBProgressHUD" "${PODS_CONFIGURATION_BUILD_DIR}/MJRefresh" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" "${PODS_CONFIGURATION_BUILD_DIR}/ReactiveCocoa" "${PODS_CONFIGURATION_BUILD_DIR}/SAMKeychain" "${PODS_CONFIGURATION_BUILD_DIR}/SDAutoLayout" "${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage" "${PODS_CONFIGURATION_BUILD_DIR}/SVProgressHUD" "${PODS_CONFIGURATION_BUILD_DIR}/TYSnapshotScroll" "${PODS_CONFIGURATION_BUILD_DIR}/TZImagePickerController" "${PODS_CONFIGURATION_BUILD_DIR}/Toast" "${PODS_CONFIGURATION_BUILD_DIR}/UICollectionViewLeftAlignedLayout" "${PODS_CONFIGURATION_BUILD_DIR}/UICountingLabel" "${PODS_CONFIGURATION_BUILD_DIR}/YYCache" "${PODS_CONFIGURATION_BUILD_DIR}/YYImage" "${PODS_CONFIGURATION_BUILD_DIR}/YYModel" "${PODS_CONFIGURATION_BUILD_DIR}/YYText" "${PODS_CONFIGURATION_BUILD_DIR}/YYWebImage" "${PODS_ROOT}/AliAuthSDK" "${PODS_ROOT}/AliLinkPartnerSDK" "${PODS_ROOT}/AlibcTradeSDK" "${PODS_ROOT}/BCUserTrack" "${PODS_ROOT}/MOBFoundation/MOBFoundation" "${PODS_ROOT}/UMCAnalytics" "${PODS_ROOT}/UMCCommon" "${PODS_ROOT}/UMCShare/UMShare" "${PODS_ROOT}/UMCShare/UMShare/UMSocialUI" "${PODS_ROOT}/UTDID" "${PODS_ROOT}/mob_sharesdk/ShareSDK" "${PODS_ROOT}/mob_sharesdk/ShareSDK/Support/Required" "${PODS_ROOT}/mob_sharesdk/ShareSDK/Support/PlatformSDK/QQSDK" "${PODS_ROOT}/mob_sharesdk/ShareSDK/Support/PlatformConnector" "${PODS_ROOT}/mob_sharesdk/ShareSDK/Support/Optional" "${PODS_ROOT}/mtopSDK" "${PODS_ROOT}/securityGuard" |
| | | FRAMEWORK_SEARCH_PATHS = $(inherited) $(PODS_ROOT)/UTDID "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking" "${PODS_CONFIGURATION_BUILD_DIR}/CRBoxInputView" "${PODS_CONFIGURATION_BUILD_DIR}/GPUImage" "${PODS_CONFIGURATION_BUILD_DIR}/IQKeyboardManager" "${PODS_CONFIGURATION_BUILD_DIR}/MBProgressHUD" "${PODS_CONFIGURATION_BUILD_DIR}/MJRefresh" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" "${PODS_CONFIGURATION_BUILD_DIR}/ReactiveCocoa" "${PODS_CONFIGURATION_BUILD_DIR}/SAMKeychain" "${PODS_CONFIGURATION_BUILD_DIR}/SDAutoLayout" "${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage" "${PODS_CONFIGURATION_BUILD_DIR}/SVProgressHUD" "${PODS_CONFIGURATION_BUILD_DIR}/TYSnapshotScroll" "${PODS_CONFIGURATION_BUILD_DIR}/TZImagePickerController" "${PODS_CONFIGURATION_BUILD_DIR}/Toast" "${PODS_CONFIGURATION_BUILD_DIR}/UICollectionViewLeftAlignedLayout" "${PODS_CONFIGURATION_BUILD_DIR}/UICountingLabel" "${PODS_CONFIGURATION_BUILD_DIR}/YYCache" "${PODS_CONFIGURATION_BUILD_DIR}/YYImage" "${PODS_CONFIGURATION_BUILD_DIR}/YYModel" "${PODS_CONFIGURATION_BUILD_DIR}/YYText" "${PODS_CONFIGURATION_BUILD_DIR}/YYWebImage" "${PODS_ROOT}/AliAuthSDK" "${PODS_ROOT}/AliLinkPartnerSDK" "${PODS_ROOT}/AlibcTradeSDK" "${PODS_ROOT}/BCUserTrack" "${PODS_ROOT}/MOBFoundation/MOBFoundation" "${PODS_ROOT}/UMCAnalytics" "${PODS_ROOT}/UMCCommon" "${PODS_ROOT}/UMCShare/UMShare" "${PODS_ROOT}/UMCShare/UMShare/UMSocialUI" "${PODS_ROOT}/UTDID" "${PODS_ROOT}/WindVane" "${PODS_ROOT}/mob_sharesdk/ShareSDK" "${PODS_ROOT}/mob_sharesdk/ShareSDK/Support/Required" "${PODS_ROOT}/mob_sharesdk/ShareSDK/Support/PlatformSDK/QQSDK" "${PODS_ROOT}/mob_sharesdk/ShareSDK/Support/PlatformConnector" "${PODS_ROOT}/mob_sharesdk/ShareSDK/Support/Optional" "${PODS_ROOT}/mtopSDK" "${PODS_ROOT}/securityGuard" |
| | | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 |
| | | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/UMCShare" "${PODS_ROOT}/Headers/Public/mob_sharesdk" |
| | | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' |
| | | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/UMCShare/UMShare/SocialLibraries/WeChat" "${PODS_ROOT}/mob_sharesdk/ShareSDK/Support/PlatformSDK/SinaWeiboSDK" "${PODS_ROOT}/mob_sharesdk/ShareSDK/Support/PlatformSDK/WeChatSDK" |
| | | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking/AFNetworking.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/CRBoxInputView/CRBoxInputView.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/GPUImage/GPUImage.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/IQKeyboardManager/IQKeyboardManager.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/MBProgressHUD/MBProgressHUD.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/MJRefresh/MJRefresh.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Masonry/Masonry.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/ReactiveCocoa/ReactiveCocoa.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/SAMKeychain/SAMKeychain.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/SDAutoLayout/SDAutoLayout.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage/SDWebImage.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/SVProgressHUD/SVProgressHUD.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/TYSnapshotScroll/TYSnapshotScroll.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/TZImagePickerController/TZImagePickerController.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Toast/Toast.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/UICollectionViewLeftAlignedLayout/UICollectionViewLeftAlignedLayout.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/UICountingLabel/UICountingLabel.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/YYCache/YYCache.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/YYImage/YYImage.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/YYModel/YYModel.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/YYText/YYText.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/YYWebImage/YYWebImage.framework/Headers" -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/UMCShare" -isystem "${PODS_ROOT}/Headers/Public/mob_sharesdk" |
| | | OTHER_LDFLAGS = $(inherited) -ObjC -l"SocialWeChat" -l"WeChatSDK" -l"WeiboSDK" -l"c++" -l"sqlite3" -l"z" -framework "AFNetworking" -framework "AlibabaAuthExt" -framework "AlibabaAuthSDK" -framework "AlibcLinkPartnerSDK" -framework "AlibcTradeBiz" -framework "AlibcTradeSDK" -framework "CFNetwork" -framework "CRBoxInputView" -framework "CoreFoundation" -framework "CoreGraphics" -framework "CoreLocation" -framework "CoreMotion" -framework "CoreTelephony" -framework "Foundation" -framework "GPUImage" -framework "IQKeyboardManager" -framework "ImageIO" -framework "JavaScriptCore" -framework "MBProgressHUD" -framework "MJRefresh" -framework "MOBFoundation" -framework "MOBFoundationEx" -framework "Masonry" -framework "MtopSDK" -framework "QQConnector" -framework "QuartzCore" -framework "ReactiveCocoa" -framework "SAMKeychain" -framework "SDAutoLayout" -framework "SDWebImage" -framework "SGAVMP" -framework "SGMain" -framework "SGMiddleTier" -framework "SGSecurityBody" -framework "SVProgressHUD" -framework "Security" -framework "SecurityGuardSDK" -framework "ShareSDK" -framework "ShareSDKConnector" -framework "ShareSDKUI" -framework "SinaWeiboConnector" -framework "SystemConfiguration" -framework "TYSnapshotScroll" -framework "TZImagePickerController" -framework "TencentOpenAPI" -framework "Toast" -framework "UICollectionViewLeftAlignedLayout" -framework "UICountingLabel" -framework "UIKit" -framework "UMAnalytics" -framework "UMCommon" -framework "UMShare" -framework "UShareUI" -framework "UTDID" -framework "UTMini" -framework "WechatConnector" -framework "YYCache" -framework "YYImage" -framework "YYModel" -framework "YYText" -framework "YYWebImage" -framework "mtopcoreopen" -framework "mtopext" -weak_framework "AdSupport" |
| | | OTHER_LDFLAGS = $(inherited) -ObjC -l"SocialWeChat" -l"WeChatSDK" -l"WeiboSDK" -l"c++" -l"sqlite3" -l"z" -framework "AFNetworking" -framework "AlibabaAuthEntrance" -framework "AlibabaAuthExt" -framework "AlibabaAuthSDK" -framework "AlibcLinkPartnerSDK" -framework "AlibcTradeBiz" -framework "AlibcTradeSDK" -framework "CFNetwork" -framework "CRBoxInputView" -framework "CoreFoundation" -framework "CoreGraphics" -framework "CoreLocation" -framework "CoreMotion" -framework "CoreTelephony" -framework "Foundation" -framework "GPUImage" -framework "IQKeyboardManager" -framework "ImageIO" -framework "JavaScriptCore" -framework "MBProgressHUD" -framework "MJRefresh" -framework "MOBFoundation" -framework "MOBFoundationEx" -framework "Masonry" -framework "MtopSDK" -framework "QQConnector" -framework "QuartzCore" -framework "ReactiveCocoa" -framework "SAMKeychain" -framework "SDAutoLayout" -framework "SDWebImage" -framework "SGAVMP" -framework "SGMain" -framework "SGMiddleTier" -framework "SGSecurityBody" -framework "SVProgressHUD" -framework "Security" -framework "SecurityGuardSDK" -framework "ShareSDK" -framework "ShareSDKConnector" -framework "ShareSDKUI" -framework "SinaWeiboConnector" -framework "SystemConfiguration" -framework "TYSnapshotScroll" -framework "TZImagePickerController" -framework "TencentOpenAPI" -framework "Toast" -framework "UICollectionViewLeftAlignedLayout" -framework "UICountingLabel" -framework "UIKit" -framework "UMAnalytics" -framework "UMCommon" -framework "UMShare" -framework "UShareUI" -framework "UTDID" -framework "UTMini" -framework "WechatConnector" -framework "WindVane" -framework "WindVaneBasic" -framework "WindVaneCore" -framework "YYCache" -framework "YYImage" -framework "YYModel" -framework "YYText" -framework "YYWebImage" -framework "mtopcoreopen" -framework "mtopext" -weak_framework "AdSupport" -weak_framework "WebKit" |
| | | PODS_BUILD_DIR = ${BUILD_DIR} |
| | | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) |
| | | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. |
New file |
| | |
| | | /* |
| | | * WindVane.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2014年 阿里巴巴-无线事业部. All rights reserved. |
| | | */ |
| | | |
| | | #ifdef __OBJC__ |
| | | |
| | | #if __has_include(<WindVaneCore/WindVaneCore.h>) |
| | | #import <WindVaneCore/WindVaneCore.h> |
| | | #endif |
| | | |
| | | #if __has_include(<WindVaneBasic/WindVaneBasic.h>) |
| | | #import <WindVaneBasic/WindVaneBasic.h> |
| | | #endif |
| | | |
| | | #endif /* __OBJC__ */ |
New file |
| | |
| | | framework module WindVane { |
| | | umbrella header "WindVane.h" |
| | | |
| | | export * |
| | | module * { export * } |
| | | } |
New file |
| | |
| | | /* |
| | | * UIColor+WVUtility.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | /** |
| | | * 提供 UIColor 类的扩展方法。 |
| | | */ |
| | | @interface UIColor (WVUtility) |
| | | |
| | | /** |
| | | 使用指定的十六进制颜色初始化 UIColor。 |
| | | */ |
| | | + (UIColor * _Nonnull)wvColorWithHex:(NSInteger)hexValue; |
| | | |
| | | /** |
| | | 使用指定的十六进制颜色和透明度初始化 UIColor。 |
| | | */ |
| | | + (UIColor * _Nonnull)wvColorWithHex:(NSInteger)hexValue alpha:(CGFloat)alphaValue; |
| | | |
| | | /** |
| | | 使用指定的十六进制颜色字符串初始化 UIColor。 |
| | | */ |
| | | + (UIColor * _Nullable)wvColorWithHexString:(NSString * _Nonnull)hexString; |
| | | |
| | | /** |
| | | 表示透明色。 |
| | | */ |
| | | + (UIColor * _Nonnull)wvTransparentColor; |
| | | |
| | | /** |
| | | 返回当前颜色的十六进制颜色字符串(RRGGBB,不包含前导字符)。 |
| | | */ |
| | | - (NSString * _Nullable)wvHexString; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * WVBasic.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | #import <WindVaneCore/WVUserConfig.h> |
| | | |
| | | /** |
| | | * 初始化 WindVane Basic 模块。 |
| | | * WindVane 基础 WebView 库,提供了一些 WebView 相关基础功能,包括 WebView、JSBridge、URLInterceptor、ViewController、StandardEventModal 模块。 |
| | | */ |
| | | @interface WVBasic : NSObject |
| | | |
| | | /** |
| | | * 初始化 WindVane Basic 模块,会自动初始化 WindVane Core 模块。 |
| | | */ |
| | | + (void)setup; |
| | | |
| | | #pragma mark - UserAgent |
| | | |
| | | /** |
| | | 返回浏览器的默认 UserAgent。 |
| | | |
| | | @return 该方法第一次调用时的默认 UserAgent。 |
| | | */ |
| | | + (NSString *)defaultUserAgent; |
| | | |
| | | /** |
| | | 返回 WindVane 的 UserAgent。 |
| | | |
| | | @return WindVane 的 UserAgent。 |
| | | */ |
| | | + (NSString *)userAgent; |
| | | |
| | | /** |
| | | 要求 WindVane 不要影响客户端的全局 UserAgent,在 WebView 自有 UserAgent 修改失败时,可能会导致 UserAgent 缺失 AliApp 和 WindVane 标记。 |
| | | */ |
| | | + (void)doNotChangeUserAgent; |
| | | |
| | | /** |
| | | 修改全局 UserAgent,多次调用只有第一次生效。 |
| | | 没有特殊必要请不要调用此方法来修改全局 UserAgent,WindVane 会优先使用 WebView 级别的 UserAgent,避免对非 WindVane 的 WebView 产生影响。 |
| | | */ |
| | | + (void)changeUserAgent; |
| | | |
| | | #pragma mark - ScrollIndicator |
| | | |
| | | /** |
| | | * 获取默认是否显示垂直滚动条指示器。 |
| | | */ |
| | | + (BOOL)showsVerticalScrollIndicator; |
| | | |
| | | /** |
| | | * 设置默认是否显示垂直滚动条指示器,默认为 YES。 |
| | | */ |
| | | + (void)setShowsVerticalScrollIndicator:(BOOL)showsVerticalScrollIndicator; |
| | | |
| | | #pragma mark - JavaScript Log |
| | | |
| | | /** |
| | | * 获取 JavaScript 日志的级别,默认为 WVLogLevelOff。 |
| | | */ |
| | | + (WVLogLevel)JSLogLevel; |
| | | |
| | | /** |
| | | * [仅限 DEBUG 包]设置 JavaScript 日志的级别。 |
| | | * 设置后,只会在新创建的 WebView 生效。 |
| | | */ |
| | | + (void)setJSLogLevel:(WVLogLevel)logLevel; |
| | | |
| | | #pragma mark - Xcode8 Compatible |
| | | |
| | | /** |
| | | 在 iOS11 上对 Xcode8 打包的模式做兼容,仍在使用 Xcode8 编译的客户端必须设置。 |
| | | */ |
| | | + (void)xcode8Compatible; |
| | | |
| | | /** |
| | | 获取是否在 iOS11 上对 Xcode8 打包的模式做兼容。 |
| | | */ |
| | | + (BOOL)isXcode8Compatible; |
| | | |
| | | #pragma mark - 其它设置(功能验证) |
| | | |
| | | /** |
| | | 设置额外的配置。 |
| | | */ |
| | | + (void)setExternalConfig:(NSDictionary *)externalConfig; |
| | | |
| | | /** |
| | | 获取额外的配置。 |
| | | */ |
| | | + (NSDictionary *)externalConfig; |
| | | |
| | | #pragma mark - 已废弃,预计于 2020.05 移除 |
| | | |
| | | /** |
| | | 只要开启了 [WVURLProtocolService setSupportWKURLProtocol:YES],就会自动同步 cookie 和补充 POST Body。 |
| | | 不再支持手动设置。 |
| | | */ |
| | | + (BOOL)syncWKWebViewCookie DEPRECATED_ATTRIBUTE; |
| | | + (void)setSyncWKWebViewCookie:(BOOL)syncWKWebViewCookie DEPRECATED_ATTRIBUTE; |
| | | + (BOOL)fixWKWebViewPostBody DEPRECATED_ATTRIBUTE; |
| | | + (void)setFixWKWebViewPostBody:(BOOL)fixWKWebViewPostBody DEPRECATED_ATTRIBUTE; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * WVNotiBar.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | /** |
| | | * 从顶部滑出的通知栏。 |
| | | */ |
| | | @interface WVNotiBar : UIControl |
| | | |
| | | /** |
| | | * 显示通知栏。 |
| | | */ |
| | | + (void)showNotiBar:(NSString *)text inView:(UIView *)view; |
| | | |
| | | /** |
| | | * 显示通知栏。 |
| | | */ |
| | | + (void)showNotiBar:(NSString *)text image:(UIImage *)image inView:(UIView *)view; |
| | | |
| | | /** |
| | | * 显示通知栏。 |
| | | */ |
| | | + (void)showNotiBar:(NSString *)text image:(UIImage *)image height:(CGFloat)height duration:(NSUInteger)duration inView:(UIView *)view target:(id)target action:(SEL)action; |
| | | |
| | | /** |
| | | * 通知栏的图标。 |
| | | */ |
| | | @property (nonatomic, strong, readonly) UIImageView * imageView; |
| | | |
| | | /** |
| | | * 通知栏的文本。 |
| | | */ |
| | | @property (nonatomic, strong, readonly) UILabel * textLabel; |
| | | |
| | | /** |
| | | * 文本颜色。 |
| | | */ |
| | | @property (nonatomic, strong) UIColor * textColor; |
| | | |
| | | /** |
| | | * 提示文本。 |
| | | */ |
| | | @property (nonatomic, copy) NSString * text; |
| | | |
| | | /** |
| | | * 弹出动画的持续时间。 |
| | | */ |
| | | @property (nonatomic, assign) NSTimeInterval animationDuration; |
| | | |
| | | /** |
| | | * 通知栏展示的持续时间。 |
| | | */ |
| | | @property (nonatomic, assign) NSTimeInterval displayDuration; |
| | | |
| | | /** |
| | | * 展示通知栏。 |
| | | */ |
| | | - (void)show; |
| | | |
| | | /** |
| | | * 隐藏通知栏,隐藏后自动从父 View 移除。 |
| | | */ |
| | | - (void)hide; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * WVRuleWebViewController.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import "WVViewController.h" |
| | | |
| | | /** |
| | | 这个类已将主要功能迁移到 WVViewController。 |
| | | */ |
| | | @interface WVRuleWebViewController : WVViewController |
| | | @end |
New file |
| | |
| | | /* |
| | | * WVStandardEventCenter.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | #import <WindVaneBasic/WindVaneBasic.h> |
| | | |
| | | /** |
| | | * WindVane 标准事件中心。 |
| | | */ |
| | | @interface WVStandardEventCenter : NSObject |
| | | |
| | | /** |
| | | * 注册全局事件。 |
| | | */ |
| | | + (void)setup; |
| | | |
| | | /** |
| | | * 发送 JS 事件到指定 WebView。 |
| | | * 也可以直接使用 [webView dispatchEvent:withParam:withCallback:] 方法。 |
| | | * |
| | | * @param eventName 要发送的事件名称。 |
| | | * @param eventData 要发送的事件数据。 |
| | | * @param webView 要发送事件到的 WebView。 |
| | | */ |
| | | + (void)postNotificationToJS:(NSString * _Nonnull)eventName withEventData:(NSDictionary * _Nullable)eventData withWebView:(UIView<WVWebViewBasicProtocol> * _Nonnull)webView; |
| | | |
| | | /** |
| | | * 发送 JS 事件到所有 WebView。 |
| | | * |
| | | * @param eventName 要发送的事件名称。 |
| | | * @param eventData 要发送的事件数据。 |
| | | */ |
| | | + (void)postNotificationToJS:(NSString * _Nonnull)eventName withEventData:(NSDictionary * _Nullable)eventData; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * WVUIButtonItem.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | /** |
| | | 表示一个按钮项。 |
| | | */ |
| | | @interface WVUIButtonItem : NSObject |
| | | |
| | | /** |
| | | 按钮项的标题。 |
| | | */ |
| | | @property (nonatomic, copy, nullable) NSString * title; |
| | | |
| | | /** |
| | | 直接使用按钮项的标题时,点击事件的回调。 |
| | | */ |
| | | @property (nonatomic, copy, nullable) void (^callback)(void); |
| | | |
| | | /** |
| | | 按钮项的自定义 View。 |
| | | */ |
| | | @property (nonatomic, strong, nullable) UIView * customView; |
| | | |
| | | /** |
| | | 与按钮项关联的参数。 |
| | | */ |
| | | @property (nonatomic, strong, nullable) NSDictionary * params; |
| | | |
| | | /** |
| | | 使用指定的标题和点击回调初始化。 |
| | | */ |
| | | + (WVUIButtonItem * _Nullable)itemWithTitle:(NSString * _Nonnull)title withCallback:(void (^_Nullable)(void))callback; |
| | | |
| | | /** |
| | | 使用指定的自定义 View 初始化。 |
| | | */ |
| | | + (WVUIButtonItem * _Nullable)itemWithCustomView:(UIView * _Nonnull)customView; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * WVUIIconFontServiceProtocol.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2018年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | /** |
| | | 表示 IconFont 的服务接口。 |
| | | */ |
| | | @protocol WVUIIconFontServiceProtocol <NSObject> |
| | | |
| | | @required |
| | | |
| | | /** |
| | | 返回指定尺寸的 IconFont 字体。 |
| | | */ |
| | | - (UIFont * _Nonnull)iconFontOfSize:(CGFloat)fontSize; |
| | | |
| | | @optional |
| | | |
| | | /** |
| | | 返回与指定 IconFont 名称对应的 Unicode 文本。 |
| | | |
| | | @param name IconFont 名称。 |
| | | @return 相应的 Unicode 文本。 |
| | | */ |
| | | - (NSString * _Nullable)iconFontUnicodeWithName:(NSString * _Nonnull)name; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * WVUILoadingBox.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | /** |
| | | * WindVane 加载框。 |
| | | */ |
| | | @interface WVUILoadingBox : UIView |
| | | |
| | | /** |
| | | * 加载框的标题。 |
| | | */ |
| | | @property (nonatomic, strong) UILabel * loadingBoxTitle; |
| | | |
| | | /** |
| | | * 设置加载框的文本。 |
| | | * |
| | | * @param title 加载框的文本。 |
| | | */ |
| | | - (void)setTitle:(NSString *)title; |
| | | |
| | | /** |
| | | * 重设加载框所在 View 的 frame,会自动重新居中。 |
| | | * |
| | | * @param frame 加载框所在 View 的 frame。 |
| | | */ |
| | | - (void)resize:(CGRect)frame; |
| | | |
| | | @end |
| | | |
New file |
| | |
| | | /* |
| | | * WVUIUtil.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import "WVUIButtonItem.h" |
| | | #import "WVUIIconFontServiceProtocol.h" |
| | | #import <Foundation/Foundation.h> |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | /** |
| | | 包含与 UI 相关的实用方法。 |
| | | */ |
| | | @interface WVUIUtil : NSObject |
| | | |
| | | #pragma mark - IconFont |
| | | |
| | | /** |
| | | 获取已注册的 IconFont 服务。 |
| | | */ |
| | | + (id<WVUIIconFontServiceProtocol> _Nullable)registeredIconFontService; |
| | | |
| | | /** |
| | | 获取已注册的 IconFont 服务。 |
| | | */ |
| | | + (void)registerIconFontService:(id<WVUIIconFontServiceProtocol> _Nullable)iconFontService; |
| | | |
| | | /** |
| | | 返回指定尺寸的 IconFont 图片。 |
| | | |
| | | @param text IconFont 的文本,如果 iconFontService 支持名称翻译,则会额外尝试将文本作为名称翻译。 |
| | | @param size 图片的尺寸。 |
| | | @param color 图片的前景色。 |
| | | @return IconFont 图片。 |
| | | */ |
| | | + (UIImage * _Nullable)imageWithIconFontText:(NSString * _Nonnull)text size:(CGFloat)size color:(UIColor * _Nonnull)color; |
| | | |
| | | #pragma mark - WVUIButtonItem |
| | | |
| | | /** |
| | | 使用指定的参数创建按钮项。 |
| | | |
| | | @param params 按钮项的配置 |
| | | @param maxHeight 按钮项的最大高度 |
| | | @param callback 点击事件的回调 |
| | | */ |
| | | + (WVUIButtonItem * _Nullable)createNavigationBarItem:(NSDictionary * _Nullable)params maxHeight:(CGFloat)maxHeight callback:(void(^ _Nullable)(void))callback; |
| | | |
| | | /** |
| | | 压缩图片至合适的大小。 |
| | | */ |
| | | + (UIImage * _Nullable)scaleImage:(UIImage * _Nonnull)image maxHeight:(CGFloat)maxHeight; |
| | | |
| | | @end |
New file |
| | |
| | | // |
| | | // WVUIWebViewController+CustomizeUI.h |
| | | // Basic |
| | | // |
| | | // Created by lianyu.ysj on 2018/1/31. |
| | | // Copyright © 2018年 WindVane. All rights reserved. |
| | | // |
| | | |
| | | #import "WVUIButtonItem.h" |
| | | #import "WVUIWebViewController.h" |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | @interface WVUIWebViewController (CustomizeUI) |
| | | |
| | | /** |
| | | 更新导航栏的标题项,可以自行覆盖以提供定制化的逻辑。 |
| | | |
| | | @param navigationBarTitleItem 导航栏的标题项,nil 表示需要重置标题。 |
| | | */ |
| | | - (void)updateNavigationBarTitleItem:(WVUIButtonItem * _Nullable)navigationBarTitleItem; |
| | | |
| | | /** |
| | | 设置是否允许通过手势关闭当前 ViewController,可以自行覆盖以提供定制化的逻辑。 |
| | | |
| | | @param allowsNavigationGestures 是否允许通过手势关闭当前 ViewController,使用 WVTristateNotSure 表示恢复默认值。 |
| | | */ |
| | | - (void)updateAllowsNavigationGestures:(WVTristate)allowsNavigationGestures; |
| | | |
| | | /** |
| | | 设置导航栏是否被隐藏,可以自行覆盖以提供定制化的逻辑。 |
| | | */ |
| | | - (void)updateNavigationBarHidden:(WVTristate)navigationBarHidden animated:(BOOL)animated; |
| | | |
| | | /** |
| | | 更新导航栏的右侧按钮项,可以自行覆盖以提供定制化的逻辑。 |
| | | */ |
| | | - (void)updateNavigationBarRightItems:(NSArray<WVUIButtonItem *> * _Nullable)rightItems; |
| | | |
| | | /** |
| | | 从指定的 WVUIButtonItem 创建 UIBarButtonItem 实例。 |
| | | */ |
| | | - (UIBarButtonItem * _Nullable)createBarButtonItem:(WVUIButtonItem * _Nonnull)buttonItem; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * WVUIWebViewController.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import "WVRuleWebViewController.h" |
| | | #import "WVUIButtonItem.h" |
| | | #import "WVWebViewControllerProtocol.h" |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | #pragma mark - Constant |
| | | |
| | | // 错误页面背景图片名称。 |
| | | #define WVUIVC_ERROR_BACKGROUND_IMG @"WindVaneResource.bundle/wifi" |
| | | // WebView 背景图片名称。 |
| | | #define WVUIVC_BACKGROUND_IMG @"WindVaneResource.bundle/all_bg_small" |
| | | // 顶部下拉刷新箭头图片名称。 |
| | | #define WVUIVC_ARROW_IMG @"WindVaneResource.bundle/upload1" |
| | | // 工具栏最左边第一个返回按钮图片名称。 |
| | | #define WVUIVC_TOOLBAR_POP_IMG @"WindVaneResource.bundle/toolbar_webview_back" |
| | | // 工具栏后退按钮图片名称。 |
| | | #define WVUIVC_TOOLBAR_BACK_IMG @"WindVaneResource.bundle/toolbar_webview_pre" |
| | | // 工具栏前进按钮图片名称。 |
| | | #define WVUIVC_TOOLBAR_NEXT_IMG @"WindVaneResource.bundle/toolbar_webview_next" |
| | | // 工具栏停止按钮图片名称。 |
| | | #define WVUIVC_TOOLBAR_STOP_IMG @"WindVaneResource.bundle/toolbar_webview_stop" |
| | | // 工具栏刷新按钮图片名称。 |
| | | #define WVUIVC_TOOLBAR_REFRESH_IMG @"WindVaneResource.bundle/toolbar_webview_refresh" |
| | | // 工具栏背景图片名称。 |
| | | #define WVUIVC_TOOLBAR_BACKGROUND_IMG @"WindVaneResource.bundle/toolbar_webview_background" |
| | | |
| | | #pragma mark - WVUIWebViewController |
| | | |
| | | /** |
| | | * 提供了 WindVane WebView UI 扩展的 ViewController。 |
| | | */ |
| | | @interface WVUIWebViewController : WVRuleWebViewController <WVWebViewControllerProtocol> |
| | | |
| | | #pragma mark - WebView |
| | | |
| | | /** |
| | | * 自定义 TabBar 高度 - 用于计算 WebView 高度。 |
| | | */ |
| | | @property (nonatomic, assign) CGFloat tabBarHeight; |
| | | |
| | | #pragma mark - Status Bar |
| | | |
| | | /** |
| | | 状态栏的样式,默认不对状态栏样式做变更。 |
| | | */ |
| | | @property (nonatomic, assign) UIStatusBarStyle statusBarStyle; |
| | | |
| | | /** |
| | | 隐藏导航栏时,Status Bar 背景的颜色,默认为 nil。 |
| | | |
| | | @discussion iOS 7 的 Status Bar 在导航栏隐藏的时候会背景透明,与 WebView 中的内容遮盖。 |
| | | 如果希望为 Status Bar 添加一个不透明背景,可以设置此属性为需要的颜色。 |
| | | 自 iOS11 后,iPhoneX 的机型状态栏高度变为 44pt,不再适合自动设置状态栏颜色,应当由前端主动填充合适的背景,让状态栏与背景融合起来。 |
| | | */ |
| | | @property (nonatomic, strong, nullable) UIColor * statusBarColor NS_DEPRECATED_IOS(7_0, 10_0); |
| | | |
| | | /** |
| | | [iOS 7 适配] 隐藏导航栏时,为 Status Bar 添加白色背景颜色。 |
| | | |
| | | @discussion 自 iOS11 后,iPhoneX 的机型状态栏高度变为 44pt,不再适合自动设置状态栏颜色,应当由前端主动填充合适的背景,让状态栏与背景融合起来。 |
| | | */ |
| | | - (void)supportiOS7WithoutStatusBar NS_DEPRECATED_IOS(7_0, 10_0); |
| | | |
| | | #pragma mark - Title |
| | | |
| | | /** |
| | | 是否允许 H5 title 发生变更后是否更新导航栏的标题,默认为 YES。 |
| | | 不受 allowsControlNavigationBar 的影响。 |
| | | */ |
| | | @property (nonatomic, assign, getter=isAutoLoadTitle) BOOL autoLoadTitle; |
| | | |
| | | /** |
| | | 导航栏的标题项,注意标题默认不支持为文本标题设置点击回调,默认为 nil。 |
| | | */ |
| | | @property (nonatomic, strong, nullable) WVUIButtonItem * navigationBarTitleItem; |
| | | |
| | | #pragma mark - Navigation Bar |
| | | |
| | | /** |
| | | 自定义导航栏高度 - 用于计算 WebView 高度。 |
| | | */ |
| | | @property (nonatomic, assign) CGFloat navBarHeight; |
| | | |
| | | /** |
| | | 是否允许 H5 操纵导航栏,默认为 NO。 |
| | | 请在创建 WebView 之前完成设置。 |
| | | 包括通过 JSBridge 或 meta 设置隐藏、透明等功能,但标题不受影响(仅由 autoLoadTitle 控制)。 |
| | | */ |
| | | @property (nonatomic, assign) BOOL allowsControlNavigationBar; |
| | | |
| | | /** |
| | | 是否允许通过手势关闭当前 ViewController,默认为 WVTristateNotSure,表示未设置。 |
| | | */ |
| | | @property (nonatomic, assign) WVTristate allowsNavigationGestures; |
| | | |
| | | /** |
| | | 导航栏是否被隐藏,默认为 WVTristateNotSure,表示未设置。 |
| | | */ |
| | | @property(nonatomic, assign, getter=isNavigationBarHidden) WVTristate navigationBarHidden; |
| | | |
| | | /** |
| | | 导航栏的右侧按钮,默认为 nil。 |
| | | */ |
| | | @property (nonatomic, copy, nullable) NSArray<WVUIButtonItem *> * navigationBarRightItems; |
| | | |
| | | /** |
| | | 导航栏的前景色,默认为 nil,表示不设置。 |
| | | */ |
| | | @property (nonatomic, strong, nullable) UIColor * navigationBarForegroundColor; |
| | | |
| | | /** |
| | | 导航栏的背景色,默认为 nil,表示不设置。 |
| | | 如果希望指定透明背景,请设置为 [UIColor wvTransparentColor]。 |
| | | */ |
| | | @property (nonatomic, strong, nullable) UIColor * navigationBarBackgroundColor; |
| | | |
| | | /** |
| | | 更新导航栏的前景色,可以自行覆盖以提供定制化的逻辑。 |
| | | |
| | | @param color 导航栏的前景色,nil 表示需要重置前景色。 |
| | | */ |
| | | - (void)updateNavigationBarForegroundColor:(UIColor * _Nullable)color; |
| | | |
| | | /** |
| | | 更新导航栏的背景色,可以自行覆盖以提供定制化的逻辑。 |
| | | |
| | | @param color 导航栏的背景色,nil 表示需要重置背景色。 |
| | | */ |
| | | - (void)updateNavigationBarBackgroundColor:(UIColor * _Nullable)color; |
| | | |
| | | /** |
| | | 更新 ViewController 的 UI(导航栏隐藏、前景色、背景色和按钮等),一般在 viewWillAppear 时调用。 |
| | | */ |
| | | - (void)updateViewControllerUI; |
| | | |
| | | #pragma mark - Toolbar |
| | | |
| | | /** |
| | | * 是否使用带有前进、后退、刷新、停止基本浏览器功能的默认工具栏,默认为 NO。 |
| | | */ |
| | | @property (nonatomic, assign, getter=isUseToolbar) BOOL useToolbar; |
| | | |
| | | /** |
| | | * 工具栏。 |
| | | */ |
| | | @property (nonatomic, strong, readonly, nullable) WVWebViewToolbar * toolbar; |
| | | |
| | | /** |
| | | * 工具栏的高度,默认为 40px。 |
| | | */ |
| | | @property (nonatomic, assign) CGFloat toolbarHeight; |
| | | |
| | | /** |
| | | * 是否动态显示工具栏。 |
| | | */ |
| | | @property (nonatomic, assign) BOOL showToolBarDynamic; |
| | | |
| | | /** |
| | | * 是否仅在发生错误的时候,才使用工具栏,无错误发生的时候,一直隐藏起来。 |
| | | * 仅在 useToolbar=YES 时候生效。 |
| | | */ |
| | | @property (nonatomic, assign, getter=isUseToolbarOnlyError) BOOL useToolbarOnlyError; |
| | | |
| | | /** |
| | | * 点击工具栏左边第一个按钮要执行的方法,默认为 pop 当前 ViewController。 |
| | | */ |
| | | - (void)goFirstClicked; |
| | | |
| | | /** |
| | | * 隐藏默认的工具栏。 |
| | | */ |
| | | - (void)hiddenToolBar; |
| | | |
| | | /** |
| | | * 显示默认的工具栏。 |
| | | */ |
| | | - (void)showToolBar; |
| | | |
| | | /** |
| | | * 如果需要提供自己的工具栏,请设置 useToolbar=NO,然后自行提供工具栏,并设置以下的属性。 |
| | | * 会自动根据当前 WebView 状态,设置按钮的 enabled。 |
| | | */ |
| | | /** |
| | | * 自定义的回退按钮。 |
| | | */ |
| | | @property (nonatomic, weak, nullable) id customToolBarGoBackButton; |
| | | |
| | | /** |
| | | * 自定义的前进按钮。 |
| | | */ |
| | | @property (nonatomic, weak, nullable) id customToolBarGoForwardButton; |
| | | |
| | | /** |
| | | * 自定义的停止按钮。 |
| | | */ |
| | | @property (nonatomic, weak, nullable) id customToolBarStopLoadingButton; |
| | | |
| | | /** |
| | | * 自定义的刷新按钮。 |
| | | */ |
| | | @property (nonatomic, weak, nullable) id customToolBarRefreshButton; |
| | | |
| | | #pragma mark - 定制错误页 |
| | | |
| | | /** |
| | | * 显示错误页。 |
| | | * 允许由子类重写以自定义错误页。 |
| | | * |
| | | * @param webView 产生错误的 WebView。 |
| | | * @param error 错误信息。 |
| | | */ |
| | | - (void)showErrorView:(UIView<WVWebViewProtocol> * _Nonnull)webView didFailLoadWithError:(NSError * _Nonnull)error; |
| | | |
| | | /** |
| | | * 隐藏错误页。 |
| | | * 允许由子类重写以自定义错误页。 |
| | | */ |
| | | - (void)removeErrorView; |
| | | |
| | | #pragma mark - 定制加载框 |
| | | |
| | | /** |
| | | * 是否显示加载框,默认为 YES。 |
| | | * 可以设置为 NO 不显示加载框,此时可以使用 KVO 监听 WebView.estimatedProgress 的改变,实现加载进度。 |
| | | */ |
| | | @property (nonatomic, assign, getter=isShowLoadingBox) BOOL showLoadingBox; |
| | | |
| | | /** |
| | | * 显示加载框。 |
| | | * 允许由子类重写以自定义加载框。 |
| | | */ |
| | | - (void)showLoadingBox; |
| | | |
| | | /** |
| | | * 使用指定的标题显示加载框。 |
| | | * 允许由子类重写以自定义加载框。 |
| | | */ |
| | | - (void)showLoadingBoxWithTitle:(NSString * _Nullable)title; |
| | | |
| | | /** |
| | | * 隐藏加载框。 |
| | | * 允许由子类重写以自定义加载框。 |
| | | */ |
| | | - (void)hiddenLoadingBox; |
| | | |
| | | #pragma mark - 设备旋转 |
| | | |
| | | /** |
| | | * 支持的设备旋转方向。 |
| | | * 设置为 0 会使用系统默认的设备旋转方向,客户端可能需要自行重写设置方法,才能实现完整的转屏适配。 |
| | | */ |
| | | @property (nonatomic, assign) UIInterfaceOrientationMask interfaceOrientationMask; |
| | | |
| | | /** |
| | | * 首选的设备旋转方向。 |
| | | */ |
| | | @property (nonatomic, assign) UIInterfaceOrientation preferredInterfaceOrientation; |
| | | |
| | | @end |
New file |
| | |
| | | // |
| | | // WVViewController.h |
| | | // Basic |
| | | // |
| | | // Created by lianyu.ysj on 2018/1/25. |
| | | // Copyright © 2018年 WindVane. All rights reserved. |
| | | // |
| | | |
| | | #import "WVViewControllerProtocol.h" |
| | | #import <WindVaneCore/WVWebViewDelegate.h> |
| | | #import <Foundation/Foundation.h> |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | @class WKWebViewConfiguration; |
| | | |
| | | // 表示当前 ViewController 从其它 WebView 唤起。 |
| | | #define WVViewControllerActionFromWebView @"webview" |
| | | |
| | | /** |
| | | 提供了 WindVane WebView 基础功能的 ViewController。 |
| | | */ |
| | | @interface WVViewController : UIViewController <WVViewControllerProtocol, WVWebViewDelegate> |
| | | |
| | | /** |
| | | 是否使用 WKWebView,默认为 WVUseWKWebViewNever。 |
| | | */ |
| | | @property (nonatomic, assign, getter=isUseWKWebView) WVUseWKWebView useWKWebView; |
| | | |
| | | /** |
| | | 是否使用了预渲染的 WebView。 |
| | | */ |
| | | @property (nonatomic, assign, readonly) BOOL usePreloadWebView; |
| | | |
| | | #pragma mark - WebView |
| | | |
| | | /** |
| | | 当前 ViewController 包含的 WebView,不存在时会自动创建。 |
| | | */ |
| | | @property (nonatomic, strong, readonly, nonnull) UIView<WVWebViewProtocol> * webView; |
| | | |
| | | /** |
| | | WebView 的 UIScrollView 对象。 |
| | | */ |
| | | @property (nonatomic, weak, readonly, nullable) UIScrollView * webViewScrollView; |
| | | |
| | | /** |
| | | WebView 的内容是否允许拖拽超过边缘再回弹,默认为 YES。 |
| | | 需要禁止拖拽效果时,请使用本属性,不要对 ScrollView 的 bounces 属性进行设置。 |
| | | 与 forbiddenPullScroll 属性作用相同,但值恰好相反。 |
| | | */ |
| | | @property (nonatomic, assign) BOOL bounces; |
| | | |
| | | /** |
| | | WKWebView 的配置,在创建 WKWebView 时,会将此对象传入 WKWebView 的构造函数中。 |
| | | 注意 ViewController 的 allowsInlineMediaPlayback 和 mediaPlaybackRequiresUserAction 属性会覆盖 WKWebViewConfiguration 的相应配置。 |
| | | */ |
| | | @property (nonatomic, strong, nullable) WKWebViewConfiguration * WKWebViewConfiguration; |
| | | |
| | | /** |
| | | WebView 的业务代码。 |
| | | */ |
| | | @property (nonatomic, strong, nullable) NSString * bizCode; |
| | | |
| | | /** |
| | | 需要在 viewDidLoad 时自动加载的页面请求,会与 loadUrl 同步变化。 |
| | | */ |
| | | @property (nonatomic, copy, nullable) NSURLRequest * loadRequest; |
| | | |
| | | /** |
| | | 需要在 viewDidLoad 时自动加载的页面地址,会与 loadRequest 同步变化。 |
| | | */ |
| | | @property (nonatomic, copy, nullable) NSString * loadUrl; |
| | | |
| | | #pragma mark - WebView Content |
| | | |
| | | /** |
| | | WebView 是否正在加载内容。 |
| | | */ |
| | | @property (nonatomic, assign, readonly, getter=isWebViewLoading) BOOL webViewLoading; |
| | | |
| | | /** |
| | | WebView 当前加载的请求,是主页面的请求,而非 iframe。 |
| | | */ |
| | | @property (nonatomic, copy, readonly, nullable) NSURLRequest * webViewRequest; |
| | | |
| | | /** |
| | | WebView 当前加载的 URL,是主页面的 URL,而非 iframe。 |
| | | */ |
| | | @property (nonatomic, copy, readonly, nullable) NSURL * webViewURL; |
| | | |
| | | /** |
| | | 是否允许 WebKit 长按事件(选择、弹出菜单),默认为 NO。 |
| | | */ |
| | | @property (nonatomic, assign, getter=isOpenWebKitLongPress) BOOL openWebKitLongPress; |
| | | |
| | | /** |
| | | 是否开启长按保存图片,默认为 YES |
| | | */ |
| | | @property (nonatomic, assign, getter=isOpenLongPressSaveImage) BOOL openLongPressSaveImage; |
| | | |
| | | /** |
| | | 是否允许使用 MixView,默认为 NO。 |
| | | 仅 WKWebView 支持,且必须在创建 WebView 前完成设置。 |
| | | */ |
| | | @property (nonatomic, assign) BOOL allowsMixView; |
| | | |
| | | /** |
| | | 是否允许内联播放媒体,默认为 YES。 |
| | | * |
| | | @discussion 对于 WKWebView,WebView 初始化之后再设置可能无法生效。 |
| | | */ |
| | | @property (nonatomic, assign) BOOL allowsInlineMediaPlayback; |
| | | |
| | | /** |
| | | 媒体是否需要用户交互才能自动播放,默认为 NO。 |
| | | * |
| | | @discussion 对于 WKWebView,WebView 初始化之后再设置可能无法生效。 |
| | | */ |
| | | @property (nonatomic, assign) BOOL mediaPlaybackRequiresUserAction; |
| | | |
| | | /** |
| | | 是否要求用户操作后才能弹出键盘,默认为 YES。 |
| | | */ |
| | | @property (nonatomic, assign) BOOL keyboardDisplayRequiresUserAction; |
| | | |
| | | /** |
| | | 获取 WebView 是否可以回退。 |
| | | */ |
| | | @property (nonatomic, assign, readonly) BOOL webViewCanGoBack; |
| | | |
| | | /** |
| | | 获取 WebView 是否可以前进。 |
| | | */ |
| | | @property (nonatomic, assign, readonly) BOOL webViewCanGoForward; |
| | | |
| | | #pragma mark - WVWebViewDelegate |
| | | |
| | | /** |
| | | 在加载指定页面之前执行的行为。 |
| | | 会在 webView:shouldStartLoadWithRequest:navigationType: 方法中调用,根据子类具体实现的不同,可能不会调用此 Block。 |
| | | */ |
| | | @property (nonatomic, copy, nullable) BOOL (^shouldStartLoadAction)(UIView<WVWebViewProtocol> * _Nonnull, NSURLRequest * _Nonnull, WKNavigationType); |
| | | |
| | | /** |
| | | 在开始加载新页面前执行的行为。 |
| | | 会在 webViewDidStartLoad: 方法中调用,根据子类具体实现的不同,可能不会调用此 Block。 |
| | | */ |
| | | @property (nonatomic, copy, nullable) void (^didStartLoadAction)(UIView<WVWebViewProtocol> * _Nonnull); |
| | | |
| | | /** |
| | | 在页面加载完毕后执行的行为。 |
| | | 会在 webViewDidStartLoad: 方法中调用,根据子类具体实现的不同,可能不会调用此 Block。 |
| | | */ |
| | | @property (nonatomic, copy, nullable) void (^didFinishLoadAction)(UIView<WVWebViewProtocol> * _Nonnull); |
| | | |
| | | /** |
| | | 在页面加载失败时执行的行为。 |
| | | 会在 webView:didFailLoadWithError: 方法中调用,根据子类具体实现的不同,可能不会调用此 Block。 |
| | | */ |
| | | @property (nonatomic, copy, nullable) void (^didFailLoadAction)(UIView<WVWebViewProtocol> * _Nonnull, NSError * _Nonnull); |
| | | |
| | | /** |
| | | 在接收到 JS 的 console 日志或错误信息时的行为。 |
| | | 会在 webView:didReceiveJSLog:level: 方法中调用,根据子类具体实现的不同,可能不会调用此 Block。 |
| | | 需要 WebView 主动开启 JSLog 级别,才能接收 console 日志。 |
| | | */ |
| | | @property (nonatomic, copy, nullable) void (^didReceiveJSLogAction)(UIView<WVWebViewProtocol> * _Nonnull, NSString * _Nonnull, WVLogLevel); |
| | | |
| | | /** |
| | | WKWebView 的独立进程崩溃时的行为。 |
| | | */ |
| | | @property (nonatomic, copy, nullable) void (^webContentProcessDidTerminateAction)(WVWKWebView * _Nonnull); |
| | | |
| | | #pragma mark - LoadPage |
| | | |
| | | /** |
| | | 加载指定的请求 |
| | | * |
| | | @param request 要加载的请求。 |
| | | */ |
| | | - (void)loadPageByRequest:(NSURLRequest * _Nonnull)request; |
| | | |
| | | /** |
| | | 加载指定的 URL。 |
| | | * |
| | | @param url 要加载的 URL。 |
| | | */ |
| | | - (void)loadPageByUrl:(NSString * _Nonnull)url; |
| | | |
| | | /** |
| | | 使用 POST 请求加载指定的 URL。 |
| | | * |
| | | @param url 要加载的 URL。 |
| | | @param postBody POST 请求内容。 |
| | | */ |
| | | - (void)loadPageByUrl:(NSString * _Nonnull)url postBody:(NSData * _Nullable)postBody; |
| | | |
| | | /** |
| | | 在 isUseWKWebView 为 WVUseWKWebViewCustom 时,决定是否使用 WKWebView。 |
| | | */ |
| | | - (BOOL)decideIsUseWKWebView; |
| | | |
| | | /** |
| | | WebView 回退历史记录。 |
| | | */ |
| | | - (void)webViewGoBack; |
| | | |
| | | /** |
| | | WebView 前进历史记录。 |
| | | */ |
| | | - (void)webViewGoForward; |
| | | |
| | | /** |
| | | WebView 停止加载。 |
| | | */ |
| | | - (void)webViewStopLoading; |
| | | |
| | | /** |
| | | WebView 刷新页面。 |
| | | */ |
| | | - (void)webViewReload; |
| | | |
| | | #pragma mark - WVWebViewDelegate |
| | | |
| | | /** |
| | | 在加载指定请求之前调用。 |
| | | * |
| | | @return 如果要加载指定的请求,则返回 YES;否则返回 NO。 |
| | | */ |
| | | - (BOOL)webView:(UIView<WVWebViewProtocol> * _Nonnull)webView shouldStartLoadWithRequest:(NSURLRequest * _Nonnull)request navigationType:(WKNavigationType)navigationType; |
| | | |
| | | /** |
| | | 在开始加载新页面前调用。 |
| | | */ |
| | | - (void)webViewDidStartLoad:(UIView<WVWebViewProtocol> * _Nonnull)webView; |
| | | |
| | | /** |
| | | 在页面加载完毕后调用。 |
| | | */ |
| | | - (void)webViewDidFinishLoad:(UIView<WVWebViewProtocol> * _Nonnull)webView; |
| | | |
| | | /** |
| | | 在页面加载失败时调用。 |
| | | */ |
| | | - (void)webView:(UIView<WVWebViewProtocol> * _Nonnull)webView didFailLoadWithError:(NSError * _Nonnull)error; |
| | | |
| | | /** |
| | | 在接收到 JS 的 console 日志或错误信息时调用。 |
| | | 需要 WebView 主动开启 JSLog 级别,才能接收 console 日志。 |
| | | */ |
| | | - (void)webView:(UIView<WVWebViewProtocol> * _Nonnull)webView didReceiveJSLog:(NSString * _Nonnull)log level:(WVLogLevel)level; |
| | | |
| | | #pragma mark - 下拉刷新 & 上拉加载 |
| | | |
| | | /** |
| | | 是否启用下拉刷新,默认为 YES。 |
| | | 启用下拉刷新之后,才允许自定义下拉刷新的视图样式。 |
| | | |
| | | @discussion |
| | | 由于 iOS7 支持透明导航栏,需要在 viewDidLayoutSubviews 中配置下拉刷新,才可以正确处理 UIScrollView 的 contentInset。 |
| | | 因此对于透明导航栏,下拉刷新会延迟到 viewDidLayoutSubviews 中初始化。 |
| | | 对于不透明导航,下拉刷新仍然会在 loadView 中初始化。 |
| | | 为了统一这一点,我们额外提供了 configPullToRefreshStyle 方法,供子方法重写下拉刷新的样式配置。 |
| | | */ |
| | | @property (nonatomic, assign, getter=isUsePullToRefresh) BOOL usePullToRefresh; |
| | | |
| | | /** |
| | | 是否启用上拉加载,默认为 YES。 |
| | | 启用上拉加载之后,才允许自定义上拉加载的视图样式。 |
| | | */ |
| | | @property (nonatomic, assign, getter=isUseInfiniteScrolling) BOOL useInfiniteScrolling; |
| | | |
| | | /** |
| | | 是否使用自定义的下拉刷新组件(仅支持 SVPullToRefresh 开源库),默认为 NO,会使用 WVPullToRefresh 和 WVInfiniteScrolling。 |
| | | 请在使用任何下拉刷新或上拉加载前设置,并且不要在中途修改,否则会发生错误。 |
| | | */ |
| | | @property (nonatomic, assign, getter=isUseCustomPullToRefresh) BOOL useCustomPullToRefresh; |
| | | |
| | | /** |
| | | 配置下拉刷新的样式。 |
| | | |
| | | @discussion |
| | | 由于 iOS7 支持透明导航栏,需要在 viewDidLayoutSubviews 中配置下拉刷新,才可以正确处理 UIScrollView 的 contentInset。 |
| | | 因此对于透明导航栏,下拉刷新会延迟到 viewDidLayoutSubviews 中初始化。 |
| | | 对于不透明导航,下拉刷新仍然会在 loadView 中初始化。 |
| | | 为了统一这一点,我们额外提供了 configPullToRefreshStyle 方法,供子方法重写下拉刷新的样式配置。 |
| | | */ |
| | | - (void)configPullToRefreshStyle; |
| | | |
| | | @end |
New file |
| | |
| | | // |
| | | // WVViewControllerProtocol.h |
| | | // Basic |
| | | // |
| | | // Created by lianyu.ysj on 2018/1/25. |
| | | // Copyright © 2018年 WindVane. All rights reserved. |
| | | // |
| | | |
| | | #import <WindVaneCore/WVWKWebView.h> |
| | | #import <WindVaneCore/WVWebViewProtocol.h> |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | typedef NS_ENUM(NSInteger, WVUseWKWebView) { |
| | | WVUseWKWebViewNever, // 从不使用 WKWebView |
| | | WVUseWKWebViewAlways, // 总是使用 WKWebView |
| | | WVUseWKWebViewCustom // 由 decideIsUseWKWebView 方法的结果决定是否使用 WKWebView |
| | | }; |
| | | |
| | | /** |
| | | WindVane ViewController 协议。 |
| | | */ |
| | | @protocol WVViewControllerProtocol <NSObject> |
| | | |
| | | @required |
| | | |
| | | /** |
| | | 是否使用 WKWebView,默认为 WVUseWKWebViewNever。 |
| | | */ |
| | | @property (nonatomic, assign, getter=isUseWKWebView) WVUseWKWebView useWKWebView; |
| | | |
| | | #pragma mark - WebView |
| | | |
| | | /** |
| | | 当前 ViewController 包含的 WebView,不存在时会自动创建。 |
| | | */ |
| | | @property (nonatomic, strong, readonly, nonnull) UIView<WVWebViewProtocol> * webView; |
| | | |
| | | /** |
| | | 当前 ViewController 包含的 WebView,不存在时会返回 nil,而不是自动创建。 |
| | | */ |
| | | @property (nonatomic, strong, readonly, nullable) UIView<WVWebViewProtocol> * internalWebView; |
| | | |
| | | /** |
| | | WebView 的 UIScrollView 对象。 |
| | | */ |
| | | @property (nonatomic, weak, readonly, nullable) UIScrollView * webViewScrollView; |
| | | |
| | | /** |
| | | WebView 的内容是否允许拖拽超过边缘再回弹,默认为 YES。 |
| | | 需要禁止拖拽效果时,请使用本属性,不要对 ScrollView 的 bounces 属性进行设置。 |
| | | 与 forbiddenPullScroll 属性作用相同,但值恰好相反。 |
| | | */ |
| | | @property (nonatomic, assign) BOOL bounces; |
| | | |
| | | #pragma mark - WebView Content |
| | | |
| | | /** |
| | | WebView 是否正在加载内容。 |
| | | */ |
| | | @property (nonatomic, assign, readonly, getter=isWebViewLoading) BOOL webViewLoading; |
| | | |
| | | /** |
| | | WebView 当前加载的请求,是主页面的请求,而非 iframe。 |
| | | */ |
| | | @property (nonatomic, copy, readonly, nullable) NSURLRequest * webViewRequest; |
| | | |
| | | /** |
| | | WebView 当前加载的 URL,是主页面的 URL,而非 iframe。 |
| | | */ |
| | | @property (nonatomic, copy, readonly, nullable) NSURL * webViewURL; |
| | | |
| | | /** |
| | | 是否允许 WebKit 长按事件(选择、弹出菜单),默认为 NO。 |
| | | */ |
| | | @property (nonatomic, assign, getter=isOpenWebKitLongPress) BOOL openWebKitLongPress; |
| | | |
| | | /** |
| | | 是否开启长按保存图片,默认为 YES |
| | | */ |
| | | @property (nonatomic, assign, getter=isOpenLongPressSaveImage) BOOL openLongPressSaveImage; |
| | | |
| | | /** |
| | | 是否允许内联播放媒体,默认为 YES。 |
| | | |
| | | @discussion 对于 WKWebView,WebView 初始化之后再设置可能无法生效。 |
| | | */ |
| | | @property (nonatomic, assign) BOOL allowsInlineMediaPlayback; |
| | | |
| | | /** |
| | | 媒体是否需要用户交互才能自动播放,默认为 NO。 |
| | | |
| | | @discussion 对于 WKWebView,WebView 初始化之后再设置可能无法生效。 |
| | | */ |
| | | @property (nonatomic, assign) BOOL mediaPlaybackRequiresUserAction; |
| | | |
| | | /** |
| | | 获取 WebView 是否可以回退。 |
| | | */ |
| | | @property (nonatomic, assign, readonly) BOOL webViewCanGoBack; |
| | | |
| | | /** |
| | | 获取 WebView 是否可以前进。 |
| | | */ |
| | | @property (nonatomic, assign, readonly) BOOL webViewCanGoForward; |
| | | |
| | | #pragma mark - WVWebViewDelegate |
| | | |
| | | /** |
| | | 在加载指定页面之前执行的行为。 |
| | | 会在 webView:shouldStartLoadWithRequest:navigationType: 方法中调用,根据子类具体实现的不同,可能不会调用此 Block。 |
| | | */ |
| | | @property (nonatomic, copy, nullable) BOOL (^shouldStartLoadAction)(UIView<WVWebViewProtocol> * _Nonnull, NSURLRequest * _Nonnull, WKNavigationType); |
| | | |
| | | /** |
| | | 在开始加载新页面前执行的行为。 |
| | | 会在 webViewDidStartLoad: 方法中调用,根据子类具体实现的不同,可能不会调用此 Block。 |
| | | */ |
| | | @property (nonatomic, copy, nullable) void (^didStartLoadAction)(UIView<WVWebViewProtocol> * _Nonnull); |
| | | |
| | | /** |
| | | 在页面加载完毕后执行的行为。 |
| | | 会在 webViewDidStartLoad: 方法中调用,根据子类具体实现的不同,可能不会调用此 Block。 |
| | | */ |
| | | @property (nonatomic, copy, nullable) void (^didFinishLoadAction)(UIView<WVWebViewProtocol> * _Nonnull); |
| | | |
| | | /** |
| | | 在页面加载失败时执行的行为。 |
| | | 会在 webView:didFailLoadWithError: 方法中调用,根据子类具体实现的不同,可能不会调用此 Block。 |
| | | */ |
| | | @property (nonatomic, copy, nullable) void (^didFailLoadAction)(UIView<WVWebViewProtocol> * _Nonnull, NSError * _Nonnull); |
| | | |
| | | /** |
| | | 在接收到 JS 的 console 日志或错误信息时的行为。 |
| | | 会在 webView:didReceiveJSLog:level: 方法中调用,根据子类具体实现的不同,可能不会调用此 Block。 |
| | | 需要 WebView 主动开启 JSLog 级别,才能接收 console 日志。 |
| | | */ |
| | | @property (nonatomic, copy, nullable) void (^didReceiveJSLogAction)(UIView<WVWebViewProtocol> * _Nonnull, NSString * _Nonnull, WVLogLevel); |
| | | |
| | | /** |
| | | WKWebView 的独立进程崩溃时的行为。 |
| | | */ |
| | | @property (nonatomic, copy, nullable) void (^webContentProcessDidTerminateAction)(WVWKWebView * _Nonnull); |
| | | |
| | | #pragma mark - LoadPage |
| | | |
| | | /** |
| | | 加载指定的请求 |
| | | |
| | | @param request 要加载的请求。 |
| | | */ |
| | | - (void)loadPageByRequest:(NSURLRequest * _Nonnull)request; |
| | | |
| | | /** |
| | | 加载指定的 URL。 |
| | | |
| | | @param url 要加载的 URL。 |
| | | */ |
| | | - (void)loadPageByUrl:(NSString * _Nonnull)url; |
| | | |
| | | /** |
| | | 使用 POST 请求加载指定的 URL。 |
| | | |
| | | @param url 要加载的 URL。 |
| | | @param postBody POST 请求内容。 |
| | | */ |
| | | - (void)loadPageByUrl:(NSString * _Nonnull)url postBody:(NSString * _Nullable)postBody; |
| | | |
| | | /** |
| | | 在 isUseWKWebView 为 WVUseWKWebViewCustom 时,决定是否使用 WKWebView。 |
| | | */ |
| | | - (BOOL)decideIsUseWKWebView; |
| | | |
| | | /** |
| | | WebView 回退历史记录。 |
| | | */ |
| | | - (void)webViewGoBack; |
| | | |
| | | /** |
| | | WebView 前进历史记录。 |
| | | */ |
| | | - (void)webViewGoForward; |
| | | |
| | | /** |
| | | WebView 停止加载。 |
| | | */ |
| | | - (void)webViewStopLoading; |
| | | |
| | | /** |
| | | WebView 刷新页面。 |
| | | */ |
| | | - (void)webViewReload; |
| | | |
| | | /** |
| | | 表示当前 ViewController 将要从指定来源唤起,会在下一次发送 WV.Event.APP.Active 事件时附上相关信息。 |
| | | |
| | | @param activeFrom 唤起的来源。 |
| | | @param data 唤起时传递的数据。 |
| | | */ |
| | | - (void)h5ActiveFrom:(NSString * _Nullable)activeFrom withData:(id _Nullable)data; |
| | | |
| | | #pragma mark - 下拉刷新 & 上拉加载 |
| | | |
| | | /** |
| | | 是否启用下拉刷新,默认为 YES。 |
| | | 启用下拉刷新之后,才允许自定义下拉刷新的视图样式。 |
| | | |
| | | @discussion |
| | | 由于 iOS7 支持透明导航栏,需要在 viewDidLayoutSubviews 中配置下拉刷新,才可以正确处理 UIScrollView 的 contentInset。 |
| | | 因此对于透明导航栏,下拉刷新会延迟到 viewDidLayoutSubviews 中初始化。 |
| | | 对于不透明导航,下拉刷新仍然会在 loadView 中初始化。 |
| | | 为了统一这一点,我们额外提供了 configPullToRefreshStyle 方法,供子方法重写下拉刷新的样式配置。 |
| | | */ |
| | | @property (nonatomic, assign, getter=isUsePullToRefresh) BOOL usePullToRefresh; |
| | | |
| | | /** |
| | | 是否启用上拉加载,默认为 YES。 |
| | | 启用上拉加载之后,才允许自定义上拉加载的视图样式。 |
| | | */ |
| | | @property (nonatomic, assign, getter=isUseInfiniteScrolling) BOOL useInfiniteScrolling; |
| | | |
| | | /** |
| | | 是否使用自定义的下拉刷新组件(仅支持 SVPullToRefresh 开源库),默认为 NO,会使用 WVPullToRefresh 和 WVInfiniteScrolling。 |
| | | 请在使用任何下拉刷新或上拉加载前设置,并且不要在中途修改,否则会发生错误。 |
| | | */ |
| | | @property (nonatomic, assign, getter=isUseCustomPullToRefresh) BOOL useCustomPullToRefresh; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * WVWebViewController.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import "WVUIWebViewController.h" |
| | | |
| | | /** |
| | | * 请直接使用 WVUIWebViewController,这个类并不包含任何逻辑。 |
| | | */ |
| | | @interface WVWebViewController : WVUIWebViewController |
| | | @end |
New file |
| | |
| | | /* |
| | | * WVWebViewControllerBasicProtocol.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import "WVViewControllerProtocol.h" |
| | | |
| | | /** |
| | | 已废弃,请直接使用 WVViewControllerProtocol。 |
| | | */ |
| | | DEPRECATED_MSG_ATTRIBUTE("请直接使用 WVViewControllerProtocol") |
| | | @protocol WVWebViewControllerBasicProtocol <WVViewControllerProtocol> |
| | | @end |
New file |
| | |
| | | /* |
| | | * WVWebViewControllerProtocol.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import "WVViewControllerProtocol.h" |
| | | #import "WVWebViewControllerUIProtocol.h" |
| | | #import "WVWebViewToolbar.h" |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | /** |
| | | * 表示基本的 WindVane WebView ViewController 协议,包含 ViewController 额外提供的功能。 |
| | | */ |
| | | @protocol WVWebViewControllerProtocol <WVViewControllerProtocol, WVWebViewControllerUIProtocol> |
| | | |
| | | #pragma mark - WebView |
| | | |
| | | /** |
| | | * 需要在 viewDidLoad 时自动加载的页面请求,会与 loadUrl 同步变化。 |
| | | */ |
| | | @property (nonatomic, copy, nullable) NSURLRequest * loadRequest; |
| | | |
| | | /** |
| | | * 需要在 viewDidLoad 时自动加载的页面地址,会与 loadRequest 同步变化。 |
| | | */ |
| | | @property (nonatomic, copy, nullable) NSString * loadUrl; |
| | | |
| | | /** |
| | | * 自定义导航栏高度 - 用于计算 WebView 高度。 |
| | | */ |
| | | @property (nonatomic, assign) CGFloat navBarHeight; |
| | | |
| | | /** |
| | | * 自定义 TabBar 高度 - 用于计算 WebView 高度。 |
| | | */ |
| | | @property (nonatomic, assign) CGFloat tabBarHeight; |
| | | |
| | | #pragma mark - Status Bar |
| | | |
| | | /** |
| | | 隐藏导航栏时,Status Bar 背景的颜色,默认为 nil。 |
| | | |
| | | @discussion iOS 7 的 Status Bar 在导航栏隐藏的时候会背景透明,与 WebView 中的内容遮盖。 |
| | | 如果希望为 Status Bar 添加一个不透明背景,可以设置此属性为需要的颜色。 |
| | | 自 iOS11 后,iPhoneX 的机型状态栏高度变为 44pt,不再适合自动设置状态栏高度,应当由前端主动填充合适的背景,让状态栏与背景融合起来。 |
| | | */ |
| | | @property (nonatomic, strong, nullable) UIColor * statusBarColor NS_DEPRECATED_IOS(7_0, 10_0); |
| | | |
| | | /** |
| | | [iOS 7 适配] 隐藏导航栏时,为 Status Bar 添加白色背景颜色。 |
| | | |
| | | @discussion 自 iOS11 后,iPhoneX 的机型状态栏高度变为 44pt,不再适合自动设置状态栏高度,应当由前端主动填充合适的背景,让状态栏与背景融合起来。 |
| | | */ |
| | | - (void)supportiOS7WithoutStatusBar NS_DEPRECATED_IOS(7_0, 10_0); |
| | | |
| | | #pragma mark - Toolbar |
| | | |
| | | /** |
| | | * 是否使用带有前进、后退、刷新、停止基本浏览器功能的默认工具栏,默认为 NO。 |
| | | */ |
| | | @property (nonatomic, assign, getter=isUseToolbar) BOOL useToolbar; |
| | | |
| | | /** |
| | | * 工具栏。 |
| | | */ |
| | | @property (nonatomic, strong, readonly, nullable) WVWebViewToolbar * toolbar; |
| | | |
| | | /** |
| | | * 工具栏的高度,默认为 40px。 |
| | | */ |
| | | @property (nonatomic, assign) CGFloat toolbarHeight; |
| | | |
| | | /** |
| | | * 是否动态显示工具栏。 |
| | | */ |
| | | @property (nonatomic, assign) BOOL showToolBarDynamic; |
| | | |
| | | /** |
| | | * 是否仅在发生错误的时候,才使用工具栏,无错误发生的时候,一直隐藏起来。 |
| | | * 仅在 useToolbar=YES 时候生效。 |
| | | */ |
| | | @property (nonatomic, assign, getter=isUseToolbarOnlyError) BOOL useToolbarOnlyError; |
| | | |
| | | /** |
| | | * 隐藏默认的工具栏。 |
| | | */ |
| | | - (void)hiddenToolBar; |
| | | |
| | | /** |
| | | * 显示默认的工具栏。 |
| | | */ |
| | | - (void)showToolBar; |
| | | |
| | | /** |
| | | * 如果需要提供自己的工具栏,请设置 useToolbar=NO,然后自行提供工具栏,并设置以下的属性。 |
| | | * 会自动根据当前 WebView 状态,设置按钮的 enabled。 |
| | | */ |
| | | /** |
| | | * 自定义的回退按钮。 |
| | | */ |
| | | @property (nonatomic, weak, nullable) id customToolBarGoBackButton; |
| | | |
| | | /** |
| | | * 自定义的前进按钮。 |
| | | */ |
| | | @property (nonatomic, weak, nullable) id customToolBarGoForwardButton; |
| | | |
| | | /** |
| | | * 自定义的停止按钮。 |
| | | */ |
| | | @property (nonatomic, weak, nullable) id customToolBarStopLoadingButton; |
| | | |
| | | /** |
| | | * 自定义的刷新按钮。 |
| | | */ |
| | | @property (nonatomic, weak, nullable) id customToolBarRefreshButton; |
| | | |
| | | #pragma mark - 定制加载框 |
| | | |
| | | /** |
| | | * 是否显示加载框,默认为 YES。 |
| | | * 可以设置为 NO 不显示加载框,此时可以使用 KVO 监听 WebView.estimatedProgress 的改变,实现加载进度。 |
| | | */ |
| | | @property (nonatomic, assign, getter=isShowLoadingBox) BOOL showLoadingBox; |
| | | |
| | | /** |
| | | * 使用指定的标题显示加载框。 |
| | | * 允许由子类重写以自定义加载框。 |
| | | */ |
| | | - (void)showLoadingBoxWithTitle:(NSString * _Nullable)title; |
| | | |
| | | #pragma mark - 设备旋转 |
| | | |
| | | /** |
| | | * 支持的设备旋转方向。 |
| | | * 设置为 0 会使用系统默认的设备旋转方向,客户端可能需要自行重写设置方法,才能实现完整的转屏适配。 |
| | | */ |
| | | @property (nonatomic, assign) UIInterfaceOrientationMask interfaceOrientationMask; |
| | | |
| | | /** |
| | | * 首选的设备旋转方向。 |
| | | */ |
| | | @property (nonatomic, assign) UIInterfaceOrientation preferredInterfaceOrientation; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * WVWebViewControllerUIProtocol.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import "WVUIButtonItem.h" |
| | | #import <Foundation/Foundation.h> |
| | | #import <WindVaneCore/WindVaneCore.h> |
| | | |
| | | /** |
| | | 表示 WebView ViewController UI 协议,通过该协议中的方法,实现 UI 相关的 JSBridge。 |
| | | */ |
| | | @protocol WVWebViewControllerUIProtocol <NSObject> |
| | | |
| | | @optional |
| | | |
| | | #pragma mark - Status Bar |
| | | |
| | | /** |
| | | 状态栏的样式,默认不对状态栏样式做变更。 |
| | | */ |
| | | @property (nonatomic, assign) UIStatusBarStyle statusBarStyle; |
| | | |
| | | #pragma mark - Title |
| | | |
| | | /** |
| | | 是否允许 H5 title 发生变更后是否更新导航栏的标题,默认为 YES。 |
| | | 不受 allowsControlNavigationBar 的影响。 |
| | | */ |
| | | @property (nonatomic, assign, getter=isAutoLoadTitle) BOOL autoLoadTitle; |
| | | |
| | | /** |
| | | 导航栏的标题项,注意标题默认不支持为文本标题设置点击回调,默认为 nil。 |
| | | */ |
| | | @property (nonatomic, strong, nullable) WVUIButtonItem * navigationBarTitleItem; |
| | | |
| | | #pragma mark - Navigation Bar |
| | | |
| | | /** |
| | | 是否允许 H5 操纵导航栏,默认为 YES。 |
| | | 请在创建 WebView 之前完成设置。 |
| | | 包括通过 JSBridge 或 meta 设置隐藏、透明等功能,但标题不受影响(仅由 autoLoadTitle 控制)。 |
| | | */ |
| | | @property (nonatomic, assign) BOOL allowsControlNavigationBar; |
| | | |
| | | /** |
| | | 是否允许通过手势关闭当前 ViewController,默认为 WVTristateNotSure,表示未设置。 |
| | | */ |
| | | @property (nonatomic, assign) WVTristate allowsNavigationGestures; |
| | | |
| | | /** |
| | | 导航栏是否被隐藏,默认为 WVTristateNotSure,表示未设置。 |
| | | */ |
| | | @property(nonatomic, assign, getter=isNavigationBarHidden) WVTristate navigationBarHidden; |
| | | |
| | | /** |
| | | 设置导航栏是否被隐藏。 |
| | | |
| | | @param navigationBarHidden 是否隐藏导航栏,使用 WVTristateNotSure 表示恢复客户端默认值。 |
| | | */ |
| | | - (void)setNavigationBarHidden:(WVTristate)navigationBarHidden animated:(BOOL)animated; |
| | | |
| | | /** |
| | | 导航栏的右侧按钮,默认为 nil。 |
| | | */ |
| | | @property (nonatomic, copy, nullable) NSArray<WVUIButtonItem *> * navigationBarRightItems; |
| | | |
| | | /** |
| | | 导航栏的前景色,默认为 nil,表示不设置。 |
| | | */ |
| | | @property (nonatomic, strong, nullable) UIColor * navigationBarForegroundColor; |
| | | |
| | | /** |
| | | 导航栏的背景色,默认为 nil,表示不设置。 |
| | | 如果希望指定透明背景,请设置为 [UIColor wvTransparentColor]。 |
| | | */ |
| | | @property (nonatomic, strong, nullable) UIColor * navigationBarBackgroundColor; |
| | | |
| | | #pragma mark - LoadingBox |
| | | |
| | | /** |
| | | 显示加载框。 |
| | | */ |
| | | - (void)showLoadingBox; |
| | | |
| | | /** |
| | | 隐藏加载框。 |
| | | */ |
| | | - (void)hiddenLoadingBox; |
| | | |
| | | #pragma mark - Navigation |
| | | |
| | | /** |
| | | 关闭当前 ViewController。 |
| | | |
| | | @param historyBack 是否优先回退历史记录。 |
| | | @param data 要传递给前一个 WebView 的数据。 |
| | | |
| | | @return 是否关闭了当前 ViewController。在回退了历史记录,或当前 ViewController 不在 NavigationController 的最顶层时返回 NO。 |
| | | */ |
| | | - (BOOL)pop:(BOOL)historyBack withData:(id _Nullable)data; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * WVWebViewToolbar.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | /** |
| | | * 表示 WebView 的工具栏。 |
| | | */ |
| | | @interface WVWebViewToolbar : UIToolbar |
| | | |
| | | /** |
| | | * 是否使用工具栏最左边的第一个按钮,默认是一个大箭头返回按钮,行为是 pop ViewController,默认为 YES。 |
| | | */ |
| | | @property (nonatomic, assign, getter=isUseFirstButton) BOOL useFirstButton; |
| | | |
| | | /** |
| | | * 工具栏左边第一个按钮的图片。 |
| | | */ |
| | | @property (nonatomic, strong) UIImage * firstButtonImage; |
| | | |
| | | /** |
| | | * 回退按钮的图片。 |
| | | */ |
| | | @property (nonatomic, strong) UIImage * backButtonImage; |
| | | |
| | | /** |
| | | * 前进按钮的图片。 |
| | | */ |
| | | @property (nonatomic, strong) UIImage * forwardButtonImage; |
| | | |
| | | /** |
| | | * 停止按钮的图片。 |
| | | */ |
| | | @property (nonatomic, strong) UIImage * stopButtonImage; |
| | | |
| | | /** |
| | | * 刷新按钮的图片。 |
| | | */ |
| | | @property (nonatomic, strong) UIImage * refreshButtonImage; |
| | | |
| | | /** |
| | | * 工具栏背景图片。 |
| | | */ |
| | | @property (nonatomic, strong) UIImage * backgroundImage; |
| | | |
| | | /** |
| | | * 是否启用回退按钮。 |
| | | */ |
| | | @property (nonatomic, assign) BOOL backButtonEnabled; |
| | | |
| | | /** |
| | | * 是否启用前进按钮。 |
| | | */ |
| | | @property (nonatomic, assign) BOOL forwardButtonEnabled; |
| | | |
| | | /** |
| | | * 是否启用停止按钮。 |
| | | */ |
| | | @property (nonatomic, assign) BOOL stopButtonEnabled; |
| | | |
| | | /** |
| | | * 是否启用刷新按钮。 |
| | | */ |
| | | @property (nonatomic, assign) BOOL refreshButtonEnabled; |
| | | |
| | | /** |
| | | * 使用视图大小和动作目标初始化。 |
| | | */ |
| | | - (instancetype)initWithFrame:(CGRect)frame withTarget:(id)target; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * WindVaneBasic.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2020年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #ifdef __OBJC__ |
| | | |
| | | #import "UIColor+WVUtility.h" |
| | | #import "WVBasic.h" |
| | | #import "WVNotiBar.h" |
| | | #import "WVRuleWebViewController.h" |
| | | #import "WVStandardEventCenter.h" |
| | | #import "WVUIButtonItem.h" |
| | | #import "WVUIIconFontServiceProtocol.h" |
| | | #import "WVUILoadingBox.h" |
| | | #import "WVUIUtil.h" |
| | | #import "WVUIWebViewController+CustomizeUI.h" |
| | | #import "WVUIWebViewController.h" |
| | | #import "WVViewController.h" |
| | | #import "WVViewControllerProtocol.h" |
| | | #import "WVWebViewController.h" |
| | | #import "WVWebViewControllerBasicProtocol.h" |
| | | #import "WVWebViewControllerProtocol.h" |
| | | #import "WVWebViewControllerUIProtocol.h" |
| | | #import "WVWebViewToolbar.h" |
| | | |
| | | #endif /* __OBJC__ */ |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
| | | <plist version="1.0"> |
| | | <dict> |
| | | <key>BuildMachineOSBuild</key> |
| | | <string>19B88</string> |
| | | <key>CFBundleDevelopmentRegion</key> |
| | | <string>en</string> |
| | | <key>CFBundleExecutable</key> |
| | | <string>WindVaneBasic</string> |
| | | <key>CFBundleIdentifier</key> |
| | | <string>com.taobao.windvane.WindVaneBasic</string> |
| | | <key>CFBundleInfoDictionaryVersion</key> |
| | | <string>6.0</string> |
| | | <key>CFBundleName</key> |
| | | <string>WindVaneBasic</string> |
| | | <key>CFBundleShortVersionString</key> |
| | | <string>8.5.0.99-SNAPSHOT</string> |
| | | <key>CFBundleSignature</key> |
| | | <string>????</string> |
| | | <key>CFBundleSupportedPlatforms</key> |
| | | <array> |
| | | <string>iPhoneOS</string> |
| | | </array> |
| | | <key>CFBundleVersion</key> |
| | | <string>8.2.0</string> |
| | | <key>DTCompiler</key> |
| | | <string>com.apple.compilers.llvm.clang.1_0</string> |
| | | <key>DTPlatformBuild</key> |
| | | <string>17B102</string> |
| | | <key>DTPlatformName</key> |
| | | <string>iphoneos</string> |
| | | <key>DTPlatformVersion</key> |
| | | <string>13.2</string> |
| | | <key>DTSDKBuild</key> |
| | | <string>17B102</string> |
| | | <key>DTSDKName</key> |
| | | <string>iphoneos13.2</string> |
| | | <key>DTXcode</key> |
| | | <string>1120</string> |
| | | <key>DTXcodeBuild</key> |
| | | <string>11B500</string> |
| | | <key>MinimumOSVersion</key> |
| | | <string>8.0</string> |
| | | <key>UIDeviceFamily</key> |
| | | <array> |
| | | <integer>1</integer> |
| | | </array> |
| | | </dict> |
| | | </plist> |
New file |
| | |
| | | framework module WindVaneBasic { |
| | | umbrella header "WindVaneBasic.h" |
| | | |
| | | export * |
| | | module * { export * } |
| | | } |
New file |
| | |
| | | /* |
| | | * WindVaneBasicPrivate.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2020年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #ifdef __OBJC__ |
| | | |
| | | #import <WindVaneBasic/WindVaneBasic.h> |
| | | |
| | | #endif /* __OBJC__ */ |
New file |
| | |
| | | /* 2019-03-18 19:08:21 */ |
| | | !function(){!function(e){"use strict";var t={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(t.arrayBuffer)var r=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],n=function(e){return e&&DataView.prototype.isPrototypeOf(e)},o=ArrayBuffer.isView||function(e){return e&&r.indexOf(Object.prototype.toString.call(e))>-1};function a(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function i(e){return"string"!=typeof e&&(e=String(e)),e}function s(e){var r={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return t.iterable&&(r[Symbol.iterator]=function(){return r}),r}function u(e){this.map={},e instanceof u?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function l(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function c(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function f(e){var t=new FileReader,r=c(t);return t.readAsArrayBuffer(e),r}function h(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function d(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e)if("string"==typeof e)this._bodyText=e;else if(t.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(t.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(t.arrayBuffer&&t.blob&&n(e))this._bodyArrayBuffer=h(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!t.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e)&&!o(e))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=h(e)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},t.blob&&(this.blob=function(){var e=l(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?l(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(f)}),this.text=function(){var e,t,r,n=l(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,r=c(t),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},t.formData&&(this.formData=function(){return this.text().then(m)}),this.json=function(){return this.text().then(JSON.parse)},this}u.prototype.append=function(e,t){e=a(e),t=i(t);var r=this.map[e];this.map[e]=r?r+","+t:t},u.prototype.delete=function(e){delete this.map[a(e)]},u.prototype.get=function(e){return e=a(e),this.has(e)?this.map[e]:null},u.prototype.has=function(e){return this.map.hasOwnProperty(a(e))},u.prototype.set=function(e,t){this.map[a(e)]=i(t)},u.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},u.prototype.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),s(e)},u.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),s(e)},u.prototype.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),s(e)},t.iterable&&(u.prototype[Symbol.iterator]=u.prototype.entries);var p=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function y(e,t){var r,n,o=(t=t||{}).body;if(e instanceof y){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new u(e.headers)),this.method=e.method,this.mode=e.mode,o||null==e._bodyInit||(o=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new u(t.headers)),this.method=(r=t.method||this.method||"GET",n=r.toUpperCase(),p.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}function m(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(o))}}),t}function b(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new u(t.headers),this.url=t.url||"",this._initBody(e)}y.prototype.clone=function(){return new y(this,{body:this._bodyInit})},d.call(y.prototype),d.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new u(this.headers),url:this.url})},b.error=function(){var e=new b(null,{status:0,statusText:""});return e.type="error",e};var v=[301,302,303,307,308];b.redirect=function(e,t){if(-1===v.indexOf(t))throw new RangeError("Invalid status code");return new b(null,{status:t,headers:{location:e}})},e.Headers=u,e.Request=y,e.Response=b,e.fetch=function(e,r){return new Promise(function(n,o){var a=new y(e,r),i=new XMLHttpRequest;i.onload=function(){var e,t,r={status:i.status,statusText:i.statusText,headers:(e=i.getAllResponseHeaders()||"",t=new u,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(e){var r=e.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();t.append(n,o)}}),t)};r.url="responseURL"in i?i.responseURL:r.headers.get("X-Request-URL");var o="response"in i?i.response:i.responseText;n(new b(o,r))},i.onerror=function(){o(new TypeError("Network request failed"))},i.ontimeout=function(){o(new TypeError("Network request failed"))},i.open(a.method,a.url,!0),"include"===a.credentials?i.withCredentials=!0:"omit"===a.credentials&&(i.withCredentials=!1),"responseType"in i&&t.blob&&(i.responseType="blob"),a.headers.forEach(function(e,t){i.setRequestHeader(t,e)}),i.send(void 0===a._bodyInit?null:a._bodyInit)})},e.fetch.polyfill=!0}("undefined"!=typeof self?self:this),function(){var e=/^(?:button|image|reset|file)$/i,t=/^(?:input|select|textarea|keygen)/i,r=/(\[[^\[\]]*\])/g;function n(e,t,n){t.match(r);var o=e[t];return o?(Array.isArray(o)||(e[t]=[o]),e[t].push(n)):e[t]=n,e}function o(e,t,r){return r=r.replace(/(\r)?\n/g,"\r\n"),r=(r=encodeURIComponent(r)).replace(/%20/g,"+"),e+(e?"&":"")+encodeURIComponent(t)+"="+r}window.NebulaSerialize=function(r,a){"object"!=typeof a?a={hash:!!a}:void 0===a.hash&&(a.hash=!0);for(var i=a.hash?{}:"",s=a.serializer||(a.hash?n:o),u=r&&r.elements?r.elements:[],l=Object.create(null),c=0;c<u.length;++c){var f=u[c];if((a.disabled||!f.disabled)&&f.name&&t.test(f.nodeName)&&!e.test(f.type)&&(!/submit/.test(f.type)||document.activeElement===f||window.lastClickElement===f)){var h=f.name,d=f.value;if("checkbox"!==f.type&&"radio"!==f.type||f.checked||(d=void 0),a.empty){if("checkbox"===f.type&&!f.checked)continue;if("radio"===f.type&&!f.checked)continue;if("radio"===f.type&&(l[f.name]||f.checked?f.checked&&(l[f.name]=!0):l[f.name]=!1),void 0==d&&"radio"==f.type)continue}else if(!d)continue;if("select-multiple"!==f.type)i=s(i,h,d);else{d=[];for(var p=f.options,y=0;y<p.length;++y){var m=p[y],b=a.empty&&!m.value,v=m.value||b;m.selected&&v&&(i=s(i,h,m.value))}}}}if(a.empty)for(var h in l)l[h]||(i=s(i,h,""));return i}}(),function(){var e="NEBULA_BRIDGE_JS_REPLACE_STRING",t=window.webkit,r=t.messageHandlers.PSDXMLHTTPREQUESTMESSAGE.postMessage,n=t.messageHandlers.PSDXMLHTTPREQUESTMESSAGE;function o(e){return r.apply(n,[e])}var a=document.__lookupSetter__("cookie"),i=document.__lookupGetter__("cookie");function s(e,t){var r=[];if("form"==e.nodeName.toLowerCase()){for(var n=NebulaSerialize(e,{hash:!0,empty:!0}),o=[].slice.call(e.querySelectorAll("input")),a=0;a<o.length;a++){var i=o[a],s=i.type,u=i.name;if("file"==s&&i.files&&i.files.length>0)for(var l=i.files.length,c=0;c<l;c++)"application/x-www-form-urlencoded"!=e.enctype.toLowerCase()&&"text/plain"!=e.enctype.toLowerCase()||t?L[u]&&L[u][c]?r.push({name:u,value:L[u][c]}):r.push({name:u,value:i.files[c]}):r.push({name:u,value:i.files[c].name})}for(var f in n)n.hasOwnProperty(f)&&r.push({name:f,value:n[f]})}return r}function u(e){return new Promise(function(t,r){var n=e.value;if("string"==typeof n)t(e);else if(n instanceof Blob||n instanceof File){var o=new FileReader;o.onload=function(n){var o=n.target.result;o.length>0?(e.value=o,t(e)):r(new Error(""))},o.onerror=function(){r(new Error(""))},o.onabort=function(){r(new Error(""))},o.readAsDataURL(n)}else t(e)})}function l(e){for(var t="",r=new Uint8Array(e),n=r.byteLength,o=0;o<n;o++)t+=String.fromCharCode(r[o]);return window.btoa(t)}a&&i&&Object.defineProperty(document,"cookie",{set:function(r){if("string"==typeof r){var n={};n[b]="cookie",n.cookie=r,n.url=document.location.href,n.msgKt=e,t&&t.messageHandlers&&t.messageHandlers.PSDXMLHTTPREQUESTMESSAGE&&t.messageHandlers.PSDXMLHTTPREQUESTMESSAGE.postMessage&&o(n),a.apply(document,[r])}},get:function(){return i.apply(document,[])},configurable:!1});function c(t){if(t instanceof Error){var r={};r[b]="error",r.errorInfo=t.message,r.msgKt=e,o(r)}}function f(e){var t=e;if(t&&t.nodeName&&"string"==typeof t.nodeName&&"form"==t.nodeName.toLowerCase()){var r=t.method;if("string"!=typeof r&&(r=t.getAttribute("method")),r&&"get"===r.toLowerCase())return!0}return!1}function h(e){var t=e;if(!f(t)){var r=+new Date+""+Math.round(1e5*Math.random()),n=t.getAttribute("action");if(n||(n=""),/X-NEBULAXMLHTTPREQUEST/.test(n))t.setAttribute("action",n.replace(/X-NEBULAXMLHTTPREQUEST=(\d+)/,"X-NEBULAXMLHTTPREQUEST="+r));else{var o=document.createElement("a");if(o.href=n,o.search&&o.search.length>0){var a=o.search;/X-NEBULAXMLHTTPREQUEST/.test(a)?(a=a.replace(/X-NEBULAXMLHTTPREQUEST=(\d+)/,"X-NEBULAXMLHTTPREQUEST="+r),t.setAttribute("action",o.protocol+"//"+o.host+o.pathname+a+o.hash)):t.setAttribute("action",o.protocol+"//"+o.host+o.pathname+o.search+"&X-NEBULAXMLHTTPREQUEST="+r+o.hash)}else t.setAttribute("action",o.protocol+"//"+o.host+o.pathname+"?X-NEBULAXMLHTTPREQUEST="+r+o.hash)}t.setAttribute("data-nebulaId",r)}}var d,p=(d=FormData,window.originFormData=d,function(e){this.realFormData=new d(e),e&&(this.targetForm=e),this.appendData=[]});p.prototype.constructor=window.originFormData,p.prototype.append=function(e,t,r){this.appendData.push({name:e,value:t,fileName:r})},FormData=p;var y={},m="msgRequestUrl",b="type",v={cacheMessage:function(t,r,n,o,a){e===a&&(y[o]={msgId:o,callBack:function(){var e=t;try{return r.apply(e,n)}catch(e){c(e)}}},setTimeout(function(){v.triggerMessageCallBack(o,a)},500))},triggerMessageCallBack:function(t,r){e===r&&y[t]&&(y[t].callBack(),delete y[t])},addFormExtraInfoToElement:function(t,r){if(e===r){var n={};n[b]="FormElement",n.msgKt=r;var a=function(e){if(e&&e.nodeType){for(var t=e;t;){if("form"===t.nodeName.toLowerCase())return t;if(t===document||t===document.documentElement||t===document.body)break;t=t.parentNode}return null}}(t||document.activeElement);if(f(a))return;if(a){var i=a.getAttribute("data-nebulaId"),l=a.getAttribute("action"),h=s(a,!1);return Promise.all(h.map(function(e){return u(e)})).then(function(e){n.msgId=i,n.val=e,n[b]="FormElement",n.FormEnctype=a.enctype,n.AcceptCharset=a.acceptCharset,n.DocumentCharset=document.charset,n[m]=l,o(n)}).catch(function(e){c(e)}),i}}},updateCookies:void 0};window.NebulaXMLHttpRequestMessageBridge=v,Object.freeze(window.NebulaXMLHttpRequestMessageBridge),Object.defineProperty(window,"NebulaXMLHttpRequestMessageBridge",{configurable:!1,writable:!1});var E,w,g=function(e){return"^^^^"+e+"^^^^"},T=["POST","PUT","DELETE","PATCH"],A=/\^\^\^\^(\d+)\^\^\^\^/;XMLHttpRequest.prototype.open=(E=XMLHttpRequest.prototype.open,function(e,t,r,n,o){var a=[].slice.call(arguments),i=!0;a.length>2&&(i=!!a[2]),this.requestAsync=i;var s=+new Date+""+Math.round(1e5*Math.random());if(this.requestId=s,e&&T.indexOf(e.toUpperCase())>-1){var u=document.createElement("a");u.href=t,A.test(u.hash)?u.hash=u.hash.replace(A,g(s)):u.hash&&u.hash.length>0?u.hash=u.hash+g(s):u.hash=g(s),t=u.href}return this.requestUrl=t,a[1]=t,E.apply(this,a)}),XMLHttpRequest.prototype.send=(w=XMLHttpRequest.prototype.send,function(t){var r,n,a,i=this.requestId,f={},h=this,d=[].slice.call(arguments);if(f.msgId=i,f.msgKt=e,f.msgMainUrl=document.location.href,f[m]=this.requestUrl,!t)return w.apply(this,d);if("string"==typeof t&&t.length>0)f.val=t,f[b]="String",o(f);else if(t instanceof Blob){if(f[b]="Blob",this.requestAsync)return r=t,n=function(t){f.val=t,o(f),v.cacheMessage(h,w,d,i,e)},(a=new FileReader).onload=function(e){var t=e.target.result;n(t)},void a.readAsDataURL(r);f.error="NOTSUPPORT",o(f)}else if(t instanceof FormData){if(f[b]="FormData",this.requestAsync){f[b]="FormData";var p=t.appendData;return t.targetForm&&(p=p.concat(s(t.targetForm,!0))),void Promise.all(p.map(function(e){return u(e)})).then(function(r){f.val=r,o(f),v.cacheMessage(h,w,t.realFormData,i,e)}).catch(function(e){c(e)})}f.error="NOTSUPPORT",o(f)}else if(t.nodeType)f[b]="Document",t===document?f.val=(new XMLSerializer).serializeToString(document):f.val=t.toString(),o(f);else if(t instanceof ArrayBuffer)f.val=l(t),f[b]="ArrayBuffer",o(f);else{if(!t.buffer)return w.apply(this,d);f.val=l(t.buffer),f[b]="ArrayBuffer",o(f)}return this.requestAsync?v.cacheMessage(h,w,d,i,e):w.apply(this,d)});var B,L={};window.lastClickElement=null,document.addEventListener("DOMContentLoaded",function(){!function(){for(var t=[].slice.call(document.querySelectorAll("form")),r=t.length-1;r>=0;r--)h(t[r]),t[r].addEventListener("submit",function(t){v.addFormExtraInfoToElement(t.target,e)},!1)}(),document.addEventListener("change",function(e){var t=e.target;if(t.nodeName&&t.nodeName.toLowerCase()&&t.type&&"file"===t.type)for(var r=t,n=0;n<r.files.length;n++)!function(e){u({name:r.name,value:e}).then(function(t){L[r.name]||(L[r.name]=[]),L[r.name].push({name:r.name,value:t.value,fileName:e.name})}).catch(function(e){c(e)})}(r.files[n])},!1),document.addEventListener("click",function(e){window.lastClickElement=e.target},!0)},!1),HTMLFormElement.prototype.submit=(B=HTMLFormElement.prototype.submit,function(){var t=[].slice.call(arguments);s(this,!1),h(this),window.lastClickElement=this,v.addFormExtraInfoToElement(this,e),B.apply(this,t)})}()}(); |
New file |
| | |
| | | /* 2019-07-09 17:41:48 */ |
| | | !function(e,r,n){var t=e.console;if(r&&t&&!t.__isWindVaneLog__){t.__isWindVaneLog__=!0;var a=Object.prototype.toString;if(n>=4){var o=t.log;t.log=function(){o.apply(t,arguments);var e=u(4,arguments);e&&r.postMessage(e)}}if(n>=3){var i=t.info;t.info=function(){i.apply(t,arguments);var e=u(3,arguments);e&&r.postMessage(e)}}if(n>=2){var c=t.warn;t.warn=function(){c.apply(t,arguments);var e=u(2,arguments);e&&r.postMessage(e)}}if(n>=1){var f=t.error;t.error=function(){f.apply(t,arguments);var e=u(1,arguments);e&&r.postMessage(e)}}}function s(e,r){for(var n in r)if(r[n]==e)return'"[Ref '+n+']"'}function l(r,n,t,o){if(null==r)return"null";if(void 0==r)return"undefined";var i;switch(a.call(r)){case"[object String]":case"[object Date]":case"[object Function]":i=r.toString();break;case"[object Boolean]":case"[object Number]":case"[object Regex]":n=!0,i=r.toString();break;case"[object Error]":i=r.stack;break;case"[object Arguments]":case"[object Array]":if(f=s(r,o))return f;o[t]=r,n=!0,i="[";for(var c=0;c<r.length;c++)c>0&&(i+=", "),i+=l(r[c],!1,t+"."+c,o);i+="]";break;default:if(e.HTMLElement&&r instanceof HTMLElement)i=r.outerHTML;else{var f;if(f=s(r,o))return f;if(o[t]=r,r.hasOwnProperty){n=!0,i="{";var u=!0;for(var c in r)if(r.hasOwnProperty(c)){u?u=!1:i+=", ";var g=JSON.stringify(c);i+=g,i+=": ",i+=l(r[c],!1,t+"."+g,o)}i+="}"}else i=a.call(r)}}return n||(i=JSON.stringify(i)),i}function u(e,r){if(0!=r.length){for(var n="",t=0;t<r.length;t++)t>0&&(n+=" "),n+=l(r[t],!0,"",{});return{level:e,log:n}}}}(WV_GLOBALOBJECT,WV_LOGGER,WV_LOGLEVEL); |
New file |
| | |
| | | /* |
| | | * NSData+WVUtility.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | @interface NSData (WVUtility) |
| | | |
| | | #pragma mark - Base64 |
| | | |
| | | /** |
| | | * 从指定 Base64 编码字符串返回 NSData。 |
| | | */ |
| | | + (NSData *)wvDataWithBase64EncodedString:(NSString *)string; |
| | | |
| | | /** |
| | | * 返回使用 Base64 编码后的字符串,允许指定换行宽度。 |
| | | */ |
| | | - (NSString *)wvBase64EncodedStringWithWrapWidth:(NSUInteger)wrapWidth; |
| | | |
| | | /** |
| | | * 返回使用 Base64 编码后的字符串。 |
| | | */ |
| | | - (NSString *)wvBase64EncodedString; |
| | | |
| | | #pragma mark - MD5 |
| | | |
| | | /** |
| | | * 返回当前数据的 MD5 结果。 |
| | | */ |
| | | - (NSString *)wvMD5; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * NSError+WVUtility.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | /** |
| | | * 常见错误的分类。 |
| | | */ |
| | | typedef NS_ENUM(NSInteger, WVErrorKind) { |
| | | /** |
| | | * 未分类错误。 |
| | | */ |
| | | WVErrorKindUnknown, |
| | | /** |
| | | * 可忽略的错误(被用户取消)。 |
| | | */ |
| | | WVErrorKindIgnorable, |
| | | /** |
| | | * 无网络错误。 |
| | | */ |
| | | WVErrorKindNoNetwork, |
| | | /** |
| | | * SSL 错误。 |
| | | */ |
| | | WVErrorKindSSL, |
| | | /** |
| | | * 下载错误。 |
| | | */ |
| | | WVErrorKindDownload, |
| | | }; |
| | | |
| | | /** |
| | | * 提供 NSError 类的扩展方法。 |
| | | */ |
| | | @interface NSError (WVUtility) |
| | | |
| | | /** |
| | | * 返回当前错误的类型。 |
| | | */ |
| | | - (WVErrorKind)wvErrorKind; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * NSMutableDictionary+WVUtility.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | /** |
| | | * 提供 NSMutableDictionary 类的扩展方法。 |
| | | */ |
| | | @interface NSMutableDictionary (WVUtility) |
| | | |
| | | /** |
| | | * 从指定字典中复制指定键的值。 |
| | | */ |
| | | - (void)wvCopyValueFrom:(NSDictionary *)dict withKey:(id<NSCopying>)key; |
| | | |
| | | /** |
| | | * 将指定字典中当前字典中不包含的键,添加到当前字典中。 |
| | | */ |
| | | - (void)wvAddNewEntriesFromDictionary:(NSDictionary *)otherDictionary; |
| | | |
| | | /** |
| | | * 移除指定指定键的对象。 |
| | | */ |
| | | - (void)wvRemoveObjectForKey:(id<NSCopying>)key; |
| | | |
| | | /** |
| | | * 为字典设置指定的键值对,已对 nil 进行检查。 |
| | | */ |
| | | - (void)wvSetNullable:(id)value forKey:(id<NSCopying>)key; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * NSObject+WVUtility.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | /** |
| | | * 提供 NSObject 类的扩展方法。 |
| | | */ |
| | | @interface NSObject (WVUtility) |
| | | |
| | | #pragma mark - Invoke |
| | | |
| | | /** |
| | | * 尝试调用指定方法,并得到返回值。 |
| | | * |
| | | * @param selector 要调用的方法。 |
| | | * |
| | | * @return 方法调用的返回值。 |
| | | */ |
| | | - (id)wvInvoke:(SEL)selector; |
| | | |
| | | /** |
| | | * 尝试调用指定方法,并得到返回值。 |
| | | * |
| | | * @param selector 要调用的方法。 |
| | | * @param object 方法的参数。 |
| | | * |
| | | * @return 方法调用的返回值。 |
| | | */ |
| | | - (id)wvInvoke:(SEL)selector withObject:(id)object; |
| | | |
| | | /** |
| | | * 尝试调用指定方法,并得到返回值。 |
| | | * |
| | | * @param selector 要调用的方法。 |
| | | * @param object1 方法的第一个参数。 |
| | | * @param object2 方法的第二个参数。 |
| | | * |
| | | * @return 方法调用的返回值。 |
| | | */ |
| | | - (id)wvInvoke:(SEL)selector withObject:(id)object1 withObject:(id)object2; |
| | | |
| | | /** |
| | | * 尝试调用指定方法,并得到返回值。 |
| | | * |
| | | * @param selector 要调用的方法。 |
| | | * @param object1 方法的第一个参数。 |
| | | * @param object2 方法的第二个参数。 |
| | | * @param object3 方法的第三个参数。 |
| | | * |
| | | * @return 方法调用的返回值。 |
| | | */ |
| | | - (id)wvInvoke:(SEL)selector withObject:(id)object1 withObject:(id)object2 withObject:(id)object3; |
| | | |
| | | /** |
| | | * 尝试调用指定方法,并得到返回值。 |
| | | * |
| | | * @param selector 要调用的方法。 |
| | | * @param object1 方法的第一个参数。 |
| | | * @param object2 方法的第二个参数。 |
| | | * @param object3 方法的第三个参数。 |
| | | * @param object4 方法的第四个参数。 |
| | | * |
| | | * @return 方法调用的返回值。 |
| | | */ |
| | | - (id)wvInvoke:(SEL)selector withObject:(id)object1 withObject:(id)object2 withObject:(id)object3 withObject:(id)object4; |
| | | |
| | | /** |
| | | * 尝试调用指定方法,并得到返回值。 |
| | | * |
| | | * @param selector 要调用的方法。 |
| | | * |
| | | * @return 方法调用的返回值。 |
| | | */ |
| | | - (BOOL)wvInvokeWithBOOLResult:(SEL)selector; |
| | | |
| | | /** |
| | | * 尝试调用指定方法,并得到返回值。 |
| | | * |
| | | * @param selector 要调用的方法。 |
| | | * |
| | | * @return 方法调用的返回值。 |
| | | */ |
| | | - (NSInteger)wvInvokeWithIntegerResult:(SEL)selector; |
| | | |
| | | #pragma mark - TryInvoke |
| | | |
| | | /** |
| | | * 尝试调用指定方法。 |
| | | * |
| | | * @param selector 要调用的方法。 |
| | | * |
| | | * @return 如果调用成功,则为 YES;否则为 NO。 |
| | | */ |
| | | - (BOOL)wvTryInvoke:(SEL)selector; |
| | | |
| | | /** |
| | | * 尝试调用指定方法,并得到返回值。 |
| | | * |
| | | * @param selector 要调用的方法。 |
| | | * @param result 方法的返回值。 |
| | | * |
| | | * @return 如果调用成功,则为 YES;否则为 NO。 |
| | | */ |
| | | - (BOOL)wvTryInvoke:(SEL)selector withResult:(id *)result; |
| | | |
| | | /** |
| | | * 尝试调用指定方法,并得到返回值。 |
| | | * |
| | | * @param selector 要调用的方法。 |
| | | * @param result 方法的返回值。 |
| | | * |
| | | * @return 如果调用成功,则为 YES;否则为 NO。 |
| | | */ |
| | | - (BOOL)wvTryInvoke:(SEL)selector withBOOLResult:(BOOL *)result; |
| | | |
| | | /** |
| | | * 尝试调用指定方法。 |
| | | * |
| | | * @param selector 要调用的方法。 |
| | | * @param object 方法的参数。 |
| | | * |
| | | * @return 如果调用成功,则为 YES;否则为 NO。 |
| | | */ |
| | | - (BOOL)wvTryInvoke:(SEL)selector withObject:(id)object; |
| | | |
| | | /** |
| | | * 尝试调用指定方法。 |
| | | * |
| | | * @param selector 要调用的方法。 |
| | | * @param value 方法的 BOOL 参数。 |
| | | * |
| | | * @return 如果调用成功,则为 YES;否则为 NO。 |
| | | */ |
| | | - (BOOL)wvTryInvoke:(SEL)selector withBOOL:(BOOL)value; |
| | | |
| | | /** |
| | | * 尝试调用指定方法。 |
| | | * |
| | | * @param selector 要调用的方法。 |
| | | * @param value 方法的 int 参数。 |
| | | * |
| | | * @return 如果调用成功,则为 YES;否则为 NO。 |
| | | */ |
| | | - (BOOL)wvTryInvoke:(SEL)selector withInt:(int)value; |
| | | |
| | | /** |
| | | * 尝试调用指定方法,并得到返回值。 |
| | | * |
| | | * @param selector 要调用的方法。 |
| | | * @param object 方法的参数。 |
| | | * @param result 方法的返回值。 |
| | | * |
| | | * @return 如果调用成功,则为 YES;否则为 NO。 |
| | | */ |
| | | - (BOOL)wvTryInvoke:(SEL)selector withObject:(id)object withBOOLResult:(BOOL *)result; |
| | | |
| | | /** |
| | | * 尝试调用指定方法。 |
| | | * |
| | | * @param selector 要调用的方法。 |
| | | * @param object1 方法的第一个参数。 |
| | | * @param object2 方法的第二个参数。 |
| | | * |
| | | * @return 如果调用成功,则为 YES;否则为 NO。 |
| | | */ |
| | | - (BOOL)wvTryInvoke:(SEL)selector withObject:(id)object1 withObject:(id)object2; |
| | | |
| | | /** |
| | | * 尝试调用指定方法。 |
| | | * |
| | | * @param selector 要调用的方法。 |
| | | * @param object1 方法的第一个参数。 |
| | | * @param object2 方法的第二个参数。 |
| | | * @param object3 方法的第三个参数。 |
| | | * |
| | | * @return 如果调用成功,则为 YES;否则为 NO。 |
| | | */ |
| | | - (BOOL)wvTryInvoke:(SEL)selector withObject:(id)object1 withObject:(id)object2 withObject:(id)object3; |
| | | |
| | | #pragma mark - Swizzle |
| | | |
| | | /** |
| | | * Sizzle 指定的实例方法。 |
| | | * |
| | | * @param originalSelector 要 Swizzle 的原始方法。 |
| | | * @param swizzledSelector Swizzle 后的新方法。 |
| | | * |
| | | * @return Sizzle 是否成功。 |
| | | */ |
| | | + (BOOL)wvSwizzleMethod:(SEL)originalSelector withMethod:(SEL)swizzledSelector; |
| | | |
| | | /** |
| | | * Sizzle 指定的实例方法。 |
| | | * |
| | | * @param originalSelector 要 Swizzle 的原始方法。 |
| | | * @param swizzledClass Swizzle 后的新方法所在的类。 |
| | | * @param swizzledSelector Swizzle 后的新方法。 |
| | | * |
| | | * @return Sizzle 是否成功。 |
| | | */ |
| | | + (BOOL)wvSwizzleMethod:(SEL)originalSelector withClass:(Class)swizzledClass withMethod:(SEL)swizzledSelector; |
| | | |
| | | /** |
| | | * Sizzle 指定的类方法。 |
| | | * |
| | | * @param originalSelector 要 Swizzle 的原始方法。 |
| | | * @param swizzledSelector Swizzle 后的新方法。 |
| | | * |
| | | * @return Sizzle 是否成功。 |
| | | */ |
| | | + (BOOL)wvSwizzleClassMethod:(SEL)originalSelector withClassMethod:(SEL)swizzledSelector; |
| | | |
| | | /** |
| | | * Sizzle 指定的类方法。 |
| | | * |
| | | * @param originalSelector 要 Swizzle 的原始方法。 |
| | | * @param swizzledClass Swizzle 后的新方法所在的类。 |
| | | * @param swizzledSelector Swizzle 后的新方法。 |
| | | * |
| | | * @return Sizzle 是否成功。 |
| | | */ |
| | | + (BOOL)wvSwizzleClassMethod:(SEL)originalSelector withClass:(Class)swizzledClass withClassMethod:(SEL)swizzledSelector; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * NSString+WVUtility.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | /** |
| | | * 返回表示指定整数的字符串。 |
| | | */ |
| | | NS_INLINE NSString * WVStringFromInteger(NSInteger value) { |
| | | return [NSString stringWithFormat:@"%ld", (long)value]; |
| | | } |
| | | |
| | | /** |
| | | * 返回表示指定整数的字符串。 |
| | | */ |
| | | NS_INLINE NSString * WVStringFromUnsignedInteger(NSUInteger value) { |
| | | return [NSString stringWithFormat:@"%lu", (unsigned long)value]; |
| | | } |
| | | |
| | | /** |
| | | * 返回表示指定整数的字符串。 |
| | | */ |
| | | NS_INLINE NSString * WVStringFromLongLong(long long value) { |
| | | return [NSString stringWithFormat:@"%lld", value]; |
| | | } |
| | | |
| | | /** |
| | | * 返回表示指定整数的字符串。 |
| | | */ |
| | | NS_INLINE NSString * WVStringFromUnsignedLongLong(unsigned long long value) { |
| | | return [NSString stringWithFormat:@"%llu", value]; |
| | | } |
| | | |
| | | /** |
| | | * 返回表示指定浮点数的字符串。 |
| | | */ |
| | | NS_INLINE NSString * WVStringFromDouble(double value) { |
| | | return [NSString stringWithFormat:@"%f", value]; |
| | | } |
| | | |
| | | /** |
| | | * 返回表示指定指针的字符串。 |
| | | */ |
| | | NS_INLINE NSString * WVStringFromPointer(id value) { |
| | | return [NSString stringWithFormat:@"%p", value]; |
| | | } |
| | | |
| | | /** |
| | | * 提供 NSString 类的扩展方法。 |
| | | */ |
| | | @interface NSString (WVUtility) |
| | | |
| | | #pragma mark - Test |
| | | |
| | | /** |
| | | * 检查指定的字符串是否是空字符串或 nil。 |
| | | */ |
| | | + (BOOL)wvIsBlank:(NSString *)str; |
| | | |
| | | #pragma mark - Finding |
| | | |
| | | /** |
| | | * 查找指定字符串第一次出现的位置。 |
| | | * |
| | | * @param string 要查找的字符串。 |
| | | * |
| | | * @return 指定字符串第一次出现的位置,如果未找到则返回 NSNotFound。 |
| | | */ |
| | | - (NSUInteger)wvIndexOfString:(NSString *)string; |
| | | |
| | | /** |
| | | * 查找指定字符串第一次出现的位置。 |
| | | * |
| | | * @param string 要查找的字符串。 |
| | | * @param options 字符串查找选项。 |
| | | * |
| | | * @return 指定字符串第一次出现的位置,如果未找到则返回 NSNotFound。 |
| | | */ |
| | | - (NSUInteger)wvIndexOfString:(NSString *)string options:(NSStringCompareOptions)options; |
| | | |
| | | /** |
| | | * 从指定索引开始,查找指定字符串第一次出现的位置。 |
| | | * |
| | | * @param string 要查找的字符串。 |
| | | * @param startIndex 要开始查找的索引。 |
| | | * |
| | | * @return 指定字符串第一次出现的位置,如果未找到则返回 NSNotFound。 |
| | | */ |
| | | - (NSUInteger)wvIndexOfString:(NSString *)string start:(NSUInteger)startIndex; |
| | | |
| | | /** |
| | | * 从指定索引开始,查找指定字符串第一次出现的位置。 |
| | | * |
| | | * @param string 要查找的字符串。 |
| | | * @param options 字符串查找选项。 |
| | | * @param startIndex 要开始查找的索引。 |
| | | * |
| | | * @return 指定字符串第一次出现的位置,如果未找到则返回 NSNotFound。 |
| | | */ |
| | | - (NSUInteger)wvIndexOfString:(NSString *)string options:(NSStringCompareOptions)options start:(NSUInteger)startIndex; |
| | | |
| | | /** |
| | | * 从指定索引开始,查找指定字符集中的字符第一次出现的位置。 |
| | | * |
| | | * @param set 要查找的字符集。 |
| | | * |
| | | * @return 字符集中的字符第一次出现的位置,如果未找到则返回 NSNotFound。 |
| | | */ |
| | | - (NSUInteger)wvIndexOfCharacterFromSet:(NSCharacterSet *)set; |
| | | |
| | | /** |
| | | * 从指定索引开始,查找指定字符集中的字符第一次出现的位置。 |
| | | * |
| | | * @param set 要查找的字符集。 |
| | | * @param start 查找的起始索引。 |
| | | * |
| | | * @return 字符集中的字符第一次出现的位置,如果未找到则返回 NSNotFound。 |
| | | */ |
| | | - (NSUInteger)wvIndexOfCharacterFromSet:(NSCharacterSet *)set startWith:(NSUInteger)start; |
| | | |
| | | /** |
| | | * 从指定范围的第一个字符,查找指定字符集中的字符连续出现的范围。 |
| | | * |
| | | * @param set 要查找的字符集。 |
| | | * @param range 要查找的字符范围。 |
| | | * |
| | | * @return 指定字符集中的字符连续出现的范围,如果未出现则返回 {range.location, 0}。 |
| | | */ |
| | | - (NSRange)wvRangeOfConsecutiveCharacterFromSet:(NSCharacterSet *)set range:(NSRange)range; |
| | | |
| | | #pragma mark - URL |
| | | |
| | | /** |
| | | * 返回经过 URL 编码后的字符串,供编码查询参数使用。 |
| | | */ |
| | | - (NSString *)wvStringByURLEncoded; |
| | | |
| | | /** |
| | | * 返回经过 URL 解码后的字符串,供解码查询参数使用。 |
| | | */ |
| | | - (NSString *)wvStringByURLDecoded; |
| | | |
| | | #pragma mark - Unicode |
| | | |
| | | /** |
| | | * 返回经过 Unicode 解码后的字符串,将 @"\\U5404\\U500b\\U90fd" 这样的字符串转换成原始字符。 |
| | | */ |
| | | - (NSString *)wvStringByUnicodeDecoded; |
| | | |
| | | #pragma mark - Base64 |
| | | |
| | | /** |
| | | * 返回 Base64 解码后的数据。 |
| | | */ |
| | | - (NSData *)wvBase64DecodedData; |
| | | |
| | | #pragma mark - MD5 |
| | | |
| | | /** |
| | | * 返回当前字符串的 MD5 结果。 |
| | | */ |
| | | - (NSString *)wvMD5; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * UIScrollView+WVPullToRefresh.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | // 下拉刷新的状态。 |
| | | typedef NS_ENUM (NSUInteger, WVPullToRefreshState) { |
| | | WVPullToRefreshStateStopped, |
| | | WVPullToRefreshStateTriggered, |
| | | WVPullToRefreshStateLoading, |
| | | WVPullToRefreshStateAll = 10, |
| | | }; |
| | | |
| | | /** |
| | | 下拉刷新的指示器协议。 |
| | | */ |
| | | @protocol WVPullToRefreshIndicatorProtocol <NSObject> |
| | | |
| | | @optional |
| | | |
| | | /** |
| | | 设置指示器的状态。 |
| | | */ |
| | | - (void)setState:(WVPullToRefreshState)state; |
| | | |
| | | /** |
| | | 设置指示器的进度。 |
| | | */ |
| | | - (void)setProgress:(double)progress; |
| | | |
| | | @end |
| | | |
| | | #pragma mark- WVPullToRefreshView |
| | | |
| | | /** |
| | | * WindVane 的下拉刷新视图。 |
| | | */ |
| | | @interface WVPullToRefreshView : UIView |
| | | |
| | | /** |
| | | * 文本颜色。 |
| | | */ |
| | | @property (nonatomic, strong) UIColor * textColor; |
| | | |
| | | /** |
| | | * 活动指示器样式。 |
| | | */ |
| | | @property (nonatomic, assign) UIActivityIndicatorViewStyle activityIndicatorViewStyle; |
| | | |
| | | /** |
| | | * 下拉刷新视图状态。 |
| | | */ |
| | | @property (nonatomic, assign) WVPullToRefreshState state; |
| | | |
| | | /** |
| | | * 标题标签。 |
| | | */ |
| | | @property (nonatomic, strong, readonly) UILabel * titleLabel; |
| | | |
| | | /** |
| | | * 副标题标签。 |
| | | */ |
| | | @property (nonatomic, strong, readonly) UILabel * subtitleLabel; |
| | | |
| | | /** |
| | | * 底部 URL 标签。 |
| | | */ |
| | | @property (nonatomic, strong, readonly) UILabel * bottomLabel; |
| | | |
| | | /** |
| | | * 下拉刷新指示器,默认使用 WVActivityIndicatorView。 |
| | | */ |
| | | @property (nonatomic, strong) UIView<WVPullToRefreshIndicatorProtocol> * indicator; |
| | | |
| | | /** |
| | | * 设置标题。 |
| | | */ |
| | | - (void)setTitle:(NSString *)title forState:(WVPullToRefreshState)state; |
| | | |
| | | /** |
| | | * 设置副标题。 |
| | | */ |
| | | - (void)setSubtitle:(NSString *)subtitle forState:(WVPullToRefreshState)state; |
| | | |
| | | /** |
| | | * 设置自定义视图。 |
| | | */ |
| | | - (void)setCustomView:(UIView *)view forState:(WVPullToRefreshState)state; |
| | | |
| | | /** |
| | | * 开始动画。 |
| | | */ |
| | | - (void)startAnimating; |
| | | |
| | | /** |
| | | * 停止动画。 |
| | | */ |
| | | - (void)stopAnimating; |
| | | |
| | | @end |
| | | |
| | | #pragma mark- UIScrollView (WVPullToRefresh) |
| | | |
| | | /** |
| | | * WindVane 的下拉刷新支持。 |
| | | */ |
| | | @interface UIScrollView (WVPullToRefresh) |
| | | |
| | | /** |
| | | * 是否显示下拉刷新。 |
| | | */ |
| | | @property (nonatomic, assign) BOOL wvShowsPullToRefresh; |
| | | |
| | | /** |
| | | * 下拉刷新视图。 |
| | | */ |
| | | @property (nonatomic, strong, readonly) WVPullToRefreshView * wvPullToRefreshView; |
| | | |
| | | /** |
| | | * 添加下拉刷新。 |
| | | * |
| | | * @param actionHandler 下拉刷新的行为。 |
| | | */ |
| | | - (void)wvAddPullToRefreshWithActionHandler:(void (^)(void))actionHandler; |
| | | |
| | | /** |
| | | * 触发下拉刷新。 |
| | | */ |
| | | - (void)wvTriggerPullToRefresh; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * UIViewController+WVUtility.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | /** |
| | | * 提供 UIViewController 类的扩展方法。 |
| | | */ |
| | | @interface UIViewController (WVUtility) |
| | | |
| | | /** |
| | | * 寻找与指定 ViewController 相关的顶层 ViewController。 |
| | | * |
| | | * @return 顶层 ViewController。 |
| | | */ |
| | | + (UIViewController * _Nullable)wvTopViewController:(UIViewController * _Nullable)viewController; |
| | | |
| | | @end |
New file |
| | |
| | | // |
| | | // WKWebViewConfiguration+WMixView.h |
| | | // Basic |
| | | // |
| | | // Created by lianyu on 2018/8/23. |
| | | // Copyright © 2018年 WindVane. All rights reserved. |
| | | // |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | #import <WebKit/WebKit.h> |
| | | |
| | | @interface WKWebViewConfiguration (WMixView) |
| | | |
| | | /** |
| | | 是否允许使用 MixView,默认为 NO。 |
| | | 必须在初始化 WebView 时完成设置。 |
| | | */ |
| | | @property (nonatomic, assign) BOOL wvAllowsMixView; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * WVBasicConstant.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | #pragma mark Notification |
| | | |
| | | // 表示 WebView 加载的页面 URL 的键。 |
| | | FOUNDATION_EXPORT NSString * _Nonnull const WVWebViewURLKey; |
| | | // 表示 WebView 页面加载失败信息的键。 |
| | | FOUNDATION_EXPORT NSString * _Nonnull const WVWebViewErrorKey; |
| | | |
| | | /** |
| | | * WebView 的页面加载成功通知。 |
| | | * @WVWebViewURLKey 当前 WebView 的页面 URL。 |
| | | */ |
| | | FOUNDATION_EXPORT NSString * _Nonnull const WVWebViewFinishLoadNotification; |
| | | |
| | | /** |
| | | * WebView 的页面加载失败通知。 |
| | | * @WVWebViewURLKey 当前 WebView 的页面 URL。 |
| | | * @WVWebViewErrorKey 加载失败的错误信息。 |
| | | */ |
| | | FOUNDATION_EXPORT NSString * _Nonnull const WVWebViewFailLoadNotification; |
| | | |
| | | /** |
| | | * WebView 的切到后台通知。 |
| | | * @WVWebViewURLKey 当前 WebView 的页面 URL。 |
| | | */ |
| | | FOUNDATION_EXPORT NSString * _Nonnull const WVWebViewDisappearNotification; |
| | | |
| | | /** |
| | | * WebView 的切到前台通知。 |
| | | * @WVWebViewURLKey 当前 WebView 的页面 URL。 |
| | | */ |
| | | FOUNDATION_EXPORT NSString * _Nonnull const WVWebViewAppearNotification; |
| | | |
| | | /** |
| | | * WKWVWebView 受到用户手势操作的通知。 |
| | | */ |
| | | FOUNDATION_EXPORT NSString * _Nonnull const WVWKWebViewReceiveUserActionNotification; |
| | | |
| | | #pragma mark JS Event |
| | | |
| | | // App 激活的 JS 事件名称。 |
| | | FOUNDATION_EXPORT NSString * _Nonnull const WVEventAppActive; |
| | | // App 退到后台的 JS 事件名称。 |
| | | FOUNDATION_EXPORT NSString * _Nonnull const WVEventAppBackground; |
| | | // 页面无限滚动的 JS 事件名称。 |
| | | FOUNDATION_EXPORT NSString * _Nonnull const WVEventPageInfiniteScroll; |
New file |
| | |
| | | /* |
| | | * WVBasicUserConfig.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import "WVUserConfig.h" |
| | | |
| | | // WVBasicUserConfig 已与 WVUserConfig 合并,请直接使用 WVUserConfig 类,这里的方法会逐渐废弃掉。 |
| | | @interface WVBasicUserConfig : NSObject |
| | | |
| | | #pragma mark - 设置方法,请使用 WVUserConfig 类的同名方法 |
| | | |
| | | + (void)setAppKey:(NSString *)appKey; |
| | | + (void)setAppName:(NSString *)appName; |
| | | + (void)setAppVersion:(NSString *)appVersion; |
| | | + (void)setEnvironment:(WVEnvironment)environment; |
| | | + (void)setDebugMode:(BOOL)isDebugMode; |
| | | + (BOOL)isDebugMode; |
| | | + (void)openWindVaneLog; |
| | | + (void)setLogLevel:(WVLogLevel)logLevel; |
| | | + (void)setAppUA:(NSString *)appUA; |
| | | + (void)setDefaultParamForFirstLoad:(NSString *)defaultParam; |
| | | + (void)setConfigAutoUpdate:(BOOL)autoUpdate; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * WVCommonUtil.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import "WVUserConfig.h" |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | // 判断是否是调试模式的宏。 |
| | | #define WV_DEBUG [WVUserConfig isDebugMode] |
| | | // 返回指定名称 selector 的字符串。 |
| | | #define WV_SEL_NAME(NAME) (NSStringFromSelector(@selector(NAME))) |
| | | // 将多行字面量转换为 char *,圆括号必须匹配。 |
| | | #define WV_LITERAL_TO_STRING(...) #__VA_ARGS__ |
| | | #define WV_LITERAL_VALUE_TO_STRING(...) WV_LITERAL_TO_STRING(__VA_ARGS__) |
| | | // 将多行字面量转换为 NSString *,圆括号必须匹配。 |
| | | #define WV_LITERAL_TO_NSSTRING(...) @ #__VA_ARGS__ |
| | | #define WV_LITERAL_VALUE_TO_NSSTRING(...) WV_LITERAL_TO_NSSTRING(__VA_ARGS__) |
| | | // 符号函数。 |
| | | #define SGN_IMPL(X, L) ({ __typeof__(X) __NSX_PASTE__(__x,L) = (X); (__NSX_PASTE__(__x,L) < 0) ? -1 : (__NSX_PASTE__(__x,L) > 0); }) |
| | | #define SGN(X) SGN_IMPL(X, __COUNTER__) |
| | | |
| | | /** |
| | | * 返回两个浮点数是否相等。 |
| | | */ |
| | | NS_INLINE BOOL doubleEquals(double x, double y) { |
| | | return fabs(x - y) < DBL_EPSILON; |
| | | } |
| | | |
| | | /** |
| | | * 返回指定浮点数是否为零。 |
| | | */ |
| | | NS_INLINE BOOL doubleEqualToZero(double x) { |
| | | return fabs(x) < DBL_EPSILON; |
| | | } |
| | | |
| | | /** |
| | | * 将弧度转换为角度。 |
| | | */ |
| | | NS_INLINE double rad2deg(double radians) { |
| | | return radians * 180.0 / M_PI; |
| | | } |
| | | |
| | | // WindVane 网络状态。 |
| | | typedef NS_ENUM(NSInteger, WVNetworkStatus) { |
| | | WVNetworkStatusNone = 0, // 无网络。 |
| | | WVNetworkStatusWiFi = 1, // WiFi 网络。 |
| | | WVNetworkStatus2G = 2, // 2G 网络。 |
| | | WVNetworkStatus3G = 3, // 3G 网络。 |
| | | WVNetworkStatus4G = 4, // 4G 网络。 |
| | | WVNetworkStatusWWAN = 5 // 未知非 WiFi 网络(无法区分 2G/3G/4G)。 |
| | | }; |
| | | |
| | | // URL 的内容类型,其中 WVURLContentMediumSecurity 需要业务方自行设置,其它会自动根据 Domain 配置决定。 |
| | | typedef NS_OPTIONS(NSInteger, WVURLContentType) { |
| | | WVURLContentForbidden = -1, // 要被禁止的内容。 |
| | | WVURLContentInsecurity = 1 << 0, // 不安全的内容(未知的三方域名)。 |
| | | WVURLContentLowSecurity = 1 << 1, // 低安全的内容(白名单内的三方域名)。 |
| | | WVURLContentMediumSecurity = 1 << 2, // 中级安全的内容(较为受控的三方域名)。 |
| | | WVURLContentHighSecurity = 1 << 3, // 高安全的内容(Ali 域名)。 |
| | | }; |
| | | |
| | | @interface WVCommonUtil : NSObject |
| | | |
| | | #pragma mark - Number Util |
| | | |
| | | /** |
| | | * 返回一个随机的 double。 |
| | | * |
| | | * @return 一个随机的 double 值,其范围为 [0, 1)。 |
| | | */ |
| | | + (double)randomDouble; |
| | | |
| | | /** |
| | | * 返回一个随机无符号整数。 |
| | | * |
| | | * @return 一个随机的无符号整数,其范围为 [0, max)。 |
| | | */ |
| | | + (NSUInteger)randomUnsignedInteger:(NSUInteger)max; |
| | | |
| | | #pragma mark - Domain Check |
| | | |
| | | /** |
| | | * 返回指定 URL 的内容类型。 |
| | | */ |
| | | + (WVURLContentType)getURLContentType:(NSString *)url; |
| | | |
| | | /** |
| | | * 检查是否是 Ali 安全域名。 |
| | | */ |
| | | + (BOOL)checkIsSecurityDomain:(NSString *)url; |
| | | |
| | | /** |
| | | * 检查是否是三方域名。 |
| | | */ |
| | | + (BOOL)checkIsThirdPartyDomain:(NSString *)url; |
| | | |
| | | /** |
| | | * 检查是否是黑名单域名。 |
| | | */ |
| | | + (BOOL)checkIsForbiddenDomain:(NSString *)url; |
| | | |
| | | #pragma mark - String Util |
| | | |
| | | /** |
| | | * 利用时间戳、计数器、硬件地址产生的全局唯一标识。 |
| | | */ |
| | | + (NSString *)UUIDString; |
| | | |
| | | /** |
| | | * 修复直接将 JSON 字符串作为 js 使用时,\u2028 和 \u2029 导致 JS 报错的问题。 |
| | | */ |
| | | + (NSString *)fixJSON2JSBug:(NSString *)json; |
| | | |
| | | /** |
| | | * 返回指定的状态码是否表示成功。 |
| | | * |
| | | * @param statusCode 要判断的状态码。 |
| | | * |
| | | * @return 如果指定的状态码表示成功,则为 YES;否则为 NO。 |
| | | */ |
| | | + (BOOL)isStatusCodeSuccess:(NSInteger)statusCode; |
| | | |
| | | @end |
| | | |
| | | #pragma mark - Perform Block |
| | | |
| | | #if defined __cplusplus |
| | | extern "C" { |
| | | #endif |
| | | |
| | | /** |
| | | 如果当前已经是主线程,那么直接调用;否则在主线程异步调用指定 Block。 |
| | | */ |
| | | void WVPerformBlockOnMainThread(dispatch_block_t block); |
| | | |
| | | /** |
| | | 在主线程同步调用指定的 Block。 |
| | | */ |
| | | void WVPerformBlockSyncOnMainThread(dispatch_block_t block); |
| | | |
| | | /** |
| | | 在后台线程异步调用指定 Block。 |
| | | */ |
| | | void WVPerformBlockOnGlobalThread(dispatch_block_t block); |
| | | |
| | | /** |
| | | 在指定 queue 同步调用指定 Block。 |
| | | */ |
| | | void WVPerformBlockSyncOnQueue(dispatch_queue_t queue, dispatch_block_t block); |
| | | |
| | | #if defined __cplusplus |
| | | }; |
| | | #endif |
New file |
| | |
| | | /* |
| | | * WVConstant.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | #pragma mark Version |
| | | |
| | | /* WindVane Version */ |
| | | /****************************************************/ |
| | | #define WINDVANE_VERSION_ORIGIN_VALUE 8.5.0 |
| | | #define WINDVANE_VERSION @"8.5.0" |
| | | /****************************************************/ |
| | | |
| | | #pragma mark - Constant |
| | | |
| | | // 时间常量,单位是秒。 |
| | | FOUNDATION_EXPORT const NSTimeInterval WVMinite; |
| | | FOUNDATION_EXPORT const NSTimeInterval WVHour; |
| | | FOUNDATION_EXPORT const NSTimeInterval WVDay; |
| | | FOUNDATION_EXPORT const NSTimeInterval WVWeek; |
| | | |
| | | // 磁盘空间常量,单位是 byte。 |
| | | FOUNDATION_EXPORT const double WVKilobytes; |
| | | FOUNDATION_EXPORT const double WVMegabytes; |
| | | FOUNDATION_EXPORT const double WVGigabytes; |
| | | |
| | | /* |
| | | * Deprecated Macros |
| | | * #define HTTP_SCHEME @"http://" |
| | | * #define HTTPS_SCHEME @"https://" |
| | | * #define PROTOCOL_SCHEME @"hybrid://" |
| | | * #define WV_JS_EVENT_APP_ACTIVE WVEventAppActive |
| | | * #define WV_JS_EVENT_APP_BACKGROUND WVEventAppBackground |
| | | * #define WV_JS_EVENT_PAGE_INFINITESCROLL WVEventPageInfiniteScroll |
| | | * #define WV_JS_EVENT_APP_ACTIVI WVEventAppActive |
| | | * #define MINITE WVMinite |
| | | * #define HALF_HOUR (WVHour / 2) |
| | | * #define HOUR WVHour |
| | | * #define DAY WVDay |
| | | * #define WEEK WVWeek |
| | | */ |
New file |
| | |
| | | /* |
| | | * WVCore.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | /** |
| | | 初始化 WindVane Core 模块。 |
| | | */ |
| | | @interface WVCore : NSObject |
| | | |
| | | /** |
| | | 初始化 WindVane Core 模块。 |
| | | */ |
| | | + (void)setup; |
| | | |
| | | /** |
| | | WindVane 的初始化时间。 |
| | | */ |
| | | + (NSTimeInterval)initTime; |
| | | |
| | | #pragma mark - UserAgent |
| | | |
| | | /** |
| | | 返回浏览器的默认 UserAgent。 |
| | | |
| | | @return 该方法第一次调用时的默认 UserAgent。 |
| | | */ |
| | | + (NSString * _Nonnull)defaultUserAgent; |
| | | |
| | | /** |
| | | 返回 WindVane 的 UserAgent。 |
| | | |
| | | @return WindVane 的 UserAgent。 |
| | | */ |
| | | + (NSString * _Nonnull)userAgent; |
| | | |
| | | /** |
| | | 要求 WindVane 不要影响客户端的全局 UserAgent,在 WebView 自有 UserAgent 修改失败时,可能会导致 UserAgent 缺失 AliApp 和 WindVane 标记。 |
| | | */ |
| | | + (void)doNotChangeUserAgent; |
| | | |
| | | /** |
| | | 修改全局 UserAgent,多次调用只有第一次生效。 |
| | | 没有特殊必要请不要调用此方法来修改全局 UserAgent,WindVane 会优先使用 WebView 级别的 UserAgent,避免对非 WindVane 的 WebView 产生影响。 |
| | | */ |
| | | + (void)changeUserAgent; |
| | | |
| | | #pragma mark - 其它设置(开关) |
| | | |
| | | /** |
| | | 设置额外的配置。 |
| | | */ |
| | | + (void)setExternalConfig:(NSDictionary * _Nullable)externalConfig; |
| | | |
| | | /** |
| | | 获取额外的配置。 |
| | | */ |
| | | + (NSDictionary * _Nonnull)externalConfig; |
| | | |
| | | /** |
| | | 获取额外的 BOOL 配置。 |
| | | */ |
| | | + (BOOL)externalBOOLConfig:(NSString * _Nonnull)configKey default:(BOOL)defaultValue; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * WVHttpUtil.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | FOUNDATION_EXPORT NSString * _Nonnull const WVHttpVersion1_1; |
| | | |
| | | // 标准 Http 头。 |
| | | FOUNDATION_EXPORT NSString * _Nonnull const WVHttpHeaderAccessControlAllowOrigin; |
| | | FOUNDATION_EXPORT NSString * _Nonnull const WVHttpHeaderCacheControl; |
| | | FOUNDATION_EXPORT NSString * _Nonnull const WVHttpHeaderCookie; |
| | | FOUNDATION_EXPORT NSString * _Nonnull const WVHttpHeaderVia; |
| | | FOUNDATION_EXPORT NSString * _Nonnull const WVHttpHeaderDate; |
| | | FOUNDATION_EXPORT NSString * _Nonnull const WVHttpHeaderLocation; |
| | | FOUNDATION_EXPORT NSString * _Nonnull const WVHttpHeaderReferrer; |
| | | FOUNDATION_EXPORT NSString * _Nonnull const WVHttpHeaderSetCookie; |
| | | FOUNDATION_EXPORT NSString * _Nonnull const WVHttpHeaderUserAgent; |
| | | FOUNDATION_EXPORT NSString * _Nonnull const WVHttpHeaderContentType; |
| | | FOUNDATION_EXPORT NSString * _Nonnull const WVHttpHeaderContentLength; |
| | | |
| | | // HTTP Method 头。 |
| | | FOUNDATION_EXPORT NSString * _Nonnull const WVHttpHeaderMethodPost; |
| | | // HTTP Cache-Control 头,表示不缓存。 |
| | | FOUNDATION_EXPORT NSString * _Nonnull const WVHttpHeaderCacheControlNoStore; |
| | | |
| | | #pragma mark - NSDictionary + WVHttpHeader |
| | | |
| | | /** |
| | | * 提供 Http 头的读取方法。 |
| | | */ |
| | | @interface NSDictionary (WVHttpHeader) |
| | | |
| | | /** |
| | | * 返回 Via 头的数据,不存在则返回 nil。 |
| | | */ |
| | | - (NSString * _Nullable)wvHttpHeaderVia; |
| | | |
| | | /** |
| | | * 返回 Date 头的数据,不存在则返回 nil。 |
| | | */ |
| | | - (NSDate * _Nullable)wvHttpHeaderDate; |
| | | |
| | | /** |
| | | * 返回 Location 头的数据,不存在则返回 nil。 |
| | | */ |
| | | - (NSString * _Nullable)wvHttpHeaderLocation; |
| | | |
| | | /** |
| | | * 返回 Referrer 头的数据,不存在则返回 nil。 |
| | | */ |
| | | - (NSString * _Nullable)wvHttpHeaderReferrer; |
| | | |
| | | /** |
| | | * 返回 Set-Cookie 头的数据,不存在则返回 nil。 |
| | | */ |
| | | - (NSString * _Nullable)wvHttpHeaderSetCookie; |
| | | |
| | | /** |
| | | * 返回 UserAgent 头的数据,不存在则返回 nil。 |
| | | */ |
| | | - (NSString * _Nullable)wvHttpHeaderUserAgent; |
| | | |
| | | /** |
| | | * 返回 ContentType 头的数据,不存在则返回 nil。 |
| | | */ |
| | | - (NSString * _Nullable)wvHttpHeaderContentType; |
| | | |
| | | /** |
| | | * 返回 ContentLength 头的数据,不存在则返回 0。 |
| | | */ |
| | | - (NSUInteger)wvHttpHeaderContentLength; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * WVJSONKit.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import <CoreGraphics/CoreGraphics.h> |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | @interface NSString (WVJSONKitDeserializing) |
| | | |
| | | /** |
| | | * 返回当前 UTF-8 json 字符串对应的对象。 |
| | | */ |
| | | - (id)wvObjectFromJSONString; |
| | | |
| | | @end |
| | | |
| | | @interface NSData (WVJSONKitDeserializing) |
| | | |
| | | /** |
| | | * 返回当前 UTF-8 json 数据对应的对象。 |
| | | */ |
| | | - (id)wvObjectFromJSONData; |
| | | |
| | | @end |
| | | |
| | | @interface NSArray (WVJSONKitSerializing) |
| | | |
| | | /** |
| | | * 返回当前数组对应的 UTF-8 json 字符串。 |
| | | */ |
| | | - (NSString *)wvJSONString; |
| | | |
| | | /** |
| | | * 返回当前数组对应的 UTF-8 json 数据。 |
| | | */ |
| | | - (NSData *)wvJSONData; |
| | | |
| | | @end |
| | | |
| | | // 表示三态的枚举,OC 里 BOOL 就是使用 signed char 表示的。 |
| | | typedef NS_ENUM(signed char, WVTristate) { |
| | | WVTristateNO = 0, // 表示 否。 |
| | | WVTristateYES = 1, // 表示 是。 |
| | | WVTristateNotSure = 2 // 表示 不确定。 |
| | | }; |
| | | |
| | | @interface NSDictionary (WVJSONKitSerializing) |
| | | |
| | | /** |
| | | * 返回当前字典对应的 UTF-8 json 字符串。 |
| | | */ |
| | | - (NSString *)wvJSONString; |
| | | /** |
| | | * 返回当前字典对应的 UTF-8 json 数据。 |
| | | */ |
| | | - (NSData *)wvJSONData; |
| | | |
| | | #pragma mark - Dictionary Value |
| | | |
| | | /** |
| | | * 获取指定键的 BOOL 值,如果不存在或类型错误则返回 NO。 |
| | | */ |
| | | - (BOOL)wvBoolValue:(id)key; |
| | | |
| | | /** |
| | | * 获取指定键的 BOOL 值,如果不存在或类型错误则返回默认值。 |
| | | */ |
| | | - (BOOL)wvBoolValue:(id)key default:(BOOL)defaultValue; |
| | | |
| | | /** |
| | | * 获取指定键的三态枚举值,如果不存在或类型错误则返回 WVTristateNotSure。 |
| | | */ |
| | | - (WVTristate)wvTristateValue:(id)key; |
| | | |
| | | /** |
| | | * 获取指定键的 NSInteger 值,如果不存在或类型错误则返回 0。 |
| | | */ |
| | | - (NSInteger)wvIntegerValue:(id)key; |
| | | |
| | | /** |
| | | * 获取指定键的 NSInteger 值,如果不存在或类型错误则返回默认值。 |
| | | */ |
| | | - (NSInteger)wvIntegerValue:(id)key default:(NSInteger)defaultValue; |
| | | |
| | | /** |
| | | * 获取指定键的 NSUInteger 值,如果不存在或类型错误则返回 0。 |
| | | */ |
| | | - (NSUInteger)wvUnsignedIntegerValue:(id)key; |
| | | |
| | | /** |
| | | * 获取指定键的 NSUInteger 值,如果不存在或类型错误则返回默认值。 |
| | | */ |
| | | - (NSUInteger)wvUnsignedIntegerValue:(id)key default:(NSUInteger)defaultValue; |
| | | |
| | | /** |
| | | * 获取指定键的 long long 值,如果不存在或类型错误则返回 0。 |
| | | */ |
| | | - (long long)wvLongLongValue:(id)key; |
| | | |
| | | /** |
| | | * 获取指定键的 long long 值,如果不存在或类型错误则返回默认值。 |
| | | */ |
| | | - (long long)wvLongLongValue:(id)key default:(long long)defaultValue; |
| | | |
| | | /** |
| | | * 获取指定键的 unsigned long long 值,如果不存在或类型错误则返回 0。 |
| | | */ |
| | | - (unsigned long long)wvUnsignedLongLongValue:(id)key; |
| | | |
| | | /** |
| | | * 获取指定键的 unsigned long long 值,如果不存在或类型错误则返回默认值。 |
| | | */ |
| | | - (unsigned long long)wvUnsignedLongLongValue:(id)key default:(unsigned long long)defaultValue; |
| | | |
| | | /** |
| | | * 获取指定键的 CGFloat 值,如果不存在或类型错误则返回 0.0。 |
| | | */ |
| | | - (CGFloat)wvFloatValue:(id)key; |
| | | |
| | | /** |
| | | * 获取指定键的 CGFloat 值,如果不存在或类型错误则返回默认值。 |
| | | */ |
| | | - (CGFloat)wvFloatValue:(id)key default:(CGFloat)defaultValue; |
| | | |
| | | /** |
| | | * 获取指定键的 double 值,如果不存在或类型错误则返回 0.0。 |
| | | */ |
| | | - (double)wvDoubleValue:(id)key; |
| | | |
| | | /** |
| | | * 获取指定键的 double 值,如果不存在或类型错误则返回默认值。 |
| | | */ |
| | | - (double)wvDoubleValue:(id)key default:(double)defaultValue; |
| | | |
| | | /** |
| | | * 获取指定键的 NSString 值,如果不存在或类型错误则返回 nil。 |
| | | */ |
| | | - (NSString *)wvStringValue:(id)key; |
| | | |
| | | /** |
| | | * 获取指定键的 NSString 值,如果不存在或类型错误则返回默认值。 |
| | | */ |
| | | - (NSString *)wvStringValue:(id)key default:(NSString *)defaultValue; |
| | | |
| | | /** |
| | | * 获取指定键的 NSArray 值,如果不存在或类型错误则返回 nil。 |
| | | */ |
| | | - (NSArray *)wvArrayValue:(id)key; |
| | | |
| | | /** |
| | | * 获取指定键的 NSDictionary 值,如果不存在或类型错误则返回 nil。 |
| | | */ |
| | | - (NSDictionary *)wvDictionaryValue:(id)key; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * WVJavaScriptExecutor.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | /** |
| | | * 允许执行 JavaScript 字符串的协议。 |
| | | */ |
| | | @protocol WVJavaScriptExecutor <NSObject> |
| | | |
| | | /** |
| | | * 执行 JavaScript 字符串,并在执行完毕后调用指定的回调。 |
| | | * 允许在任意线程调用,并总是在主线程回调。 |
| | | */ |
| | | - (void)evaluateJavaScript:(NSString *)javaScriptString completionHandler:(void (^)(id, NSError *))completionHandler; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * WVLog.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import "WVUserConfig.h" |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | #pragma mark - WindVane Modules |
| | | |
| | | // WindVane 模块名称。 |
| | | typedef NS_ENUM(NSInteger, WVModuleName) { |
| | | WVModuleCore, // Core 模块。 |
| | | WVModuleConfig, // Core 模块的配置功能。 |
| | | WVModuleBridge, // Bridge 模块。 |
| | | WVModuleBasic, // Basic 模块。 |
| | | WVModuleAPI, // API 模块。 |
| | | WVModuleTBExt, // TBExtension 模块。 |
| | | WVModuleJS, // JS 模块。 |
| | | WVModuleNoName, // 无模块名称。 |
| | | WVModuleExtra, // 额外模块。 |
| | | }; |
| | | |
| | | #pragma mark - WVExternalLogProtocol |
| | | |
| | | /** |
| | | * WindVane 的外部日志协议,用于将日志输出到外部。 |
| | | */ |
| | | @protocol WVExternalLogProtocol <NSObject> |
| | | |
| | | @required |
| | | |
| | | /** |
| | | 外部日志的级别。 |
| | | 保证在输出日志前正确的检查日志级别。 |
| | | */ |
| | | - (WVLogLevel)logLevel; |
| | | |
| | | /** |
| | | * 输出 Error 日志。 |
| | | */ |
| | | - (void)error:(NSString *)message; |
| | | |
| | | /** |
| | | * 输出 Warn 日志。 |
| | | */ |
| | | - (void)warn:(NSString *)message; |
| | | |
| | | /** |
| | | * 输出 Info 日志。 |
| | | */ |
| | | - (void)info:(NSString *)message; |
| | | |
| | | /** |
| | | * 输出 Debug 日志。 |
| | | */ |
| | | - (void)debug:(NSString *)message; |
| | | |
| | | /** |
| | | * 输出 Verbose 日志。 |
| | | */ |
| | | - (void)verbose:(NSString *)message; |
| | | |
| | | @end |
| | | |
| | | #pragma mark - WVLog |
| | | |
| | | /** |
| | | * WindVane 的日志类。 |
| | | */ |
| | | @interface WVLog : NSObject |
| | | |
| | | /** |
| | | * 检查指定级别的日志是否可以输出。 |
| | | * 一般情况下无需调用此方法,仅当需要做复杂的日志拼接时使用。 |
| | | * |
| | | * @param level 要检查的日志级别。 |
| | | * |
| | | * @return 如果可以输出,则为 YES;否则为 NO。 |
| | | */ |
| | | + (BOOL)checkLogLevel:(WVLogLevel)level; |
| | | |
| | | @end |
| | | |
| | | #pragma mark - WVLog Globacl Functions |
| | | |
| | | #ifdef __cplusplus |
| | | extern "C" { |
| | | #endif |
| | | |
| | | /** |
| | | * 输出 Error 日志。 |
| | | */ |
| | | void WVLogError(WVModuleName module, NSString * format, ...) NS_FORMAT_FUNCTION(2, 3); |
| | | |
| | | /** |
| | | * 输出 Warn 日志。 |
| | | */ |
| | | void WVLogWarn(WVModuleName module, NSString * format, ...) NS_FORMAT_FUNCTION(2, 3); |
| | | |
| | | /** |
| | | * 输出 Info 日志。 |
| | | */ |
| | | void WVLogInfo(WVModuleName module, NSString * format, ...) NS_FORMAT_FUNCTION(2, 3); |
| | | |
| | | /** |
| | | * 输出 Debug 日志。 |
| | | */ |
| | | void WVLogDebug(WVModuleName module, NSString * format, ...) NS_FORMAT_FUNCTION(2, 3); |
| | | |
| | | /** |
| | | * 输出 Verbose 日志。 |
| | | */ |
| | | void WVLogVerbose(WVModuleName module, NSString * format, ...) NS_FORMAT_FUNCTION(2, 3); |
| | | |
| | | #ifdef __cplusplus |
| | | } |
| | | #endif |
New file |
| | |
| | | /* |
| | | * WVNavigation.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | #import <UIKit/UIKit.h> |
| | | #import "WVCommonUtil.h" |
| | | #import <WebKit/WebKit.h> |
| | | |
| | | /** |
| | | 表示当前导航的信息,用于在 WVWebViewDelegate 的回调中获取或设置相关信息。 |
| | | */ |
| | | @interface WVNavigation : NSObject |
| | | |
| | | /** |
| | | 当前导航的请求。 |
| | | */ |
| | | @property (nonatomic, copy, readonly) NSURLRequest * request; |
| | | |
| | | /** |
| | | 是否希望在新窗口中打开页面,例如设置有 target="_blank"。 |
| | | */ |
| | | @property (nonatomic, assign, readonly) BOOL newWindow; |
| | | |
| | | /** |
| | | 当前导航是否是主页面,仅供参考。 |
| | | 对于 WVWebView 来说,由于无法准确获取 iframe 信息,该值在不同的回调中可能会发生变化。 |
| | | */ |
| | | @property (nonatomic, assign, readonly) BOOL mainFrame; |
| | | |
| | | /** |
| | | 当前导航的类型。 |
| | | */ |
| | | @property (nonatomic, assign, readonly) WKNavigationType navigationType; |
| | | |
| | | /** |
| | | 当前导航的 URL 内容类型。 |
| | | */ |
| | | @property (nonatomic, assign) WVURLContentType contentType; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * WVPageMeta.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | @class WVPageMeta; |
| | | |
| | | /** |
| | | * 页面元数据发生改变的回调。 |
| | | * |
| | | * @param pageMeta 全部页面元数据。 |
| | | * @param changedMeta 发生改变的页面元数据的键。 |
| | | * @param initial 是否是当前页面的首次元数据回调。 |
| | | */ |
| | | typedef void (^WVPageMetaChanged)(WVPageMeta * _Nonnull pageMeta, NSSet<NSString *> * _Nonnull changedMeta, BOOL initial); |
| | | |
| | | /** |
| | | * 当前页面的元数据。 |
| | | * 支持两种形式:<meta name="key" content="value"> 或 <meta id="key" value="value"> |
| | | */ |
| | | @interface WVPageMeta : NSObject |
| | | |
| | | /** |
| | | * 返回指定名称的 meta。 |
| | | * |
| | | * @param name meta 的名称。 |
| | | * |
| | | * @return 指定名称的 meta。 |
| | | */ |
| | | - (NSString * _Nullable)objectForName:(NSString * _Nonnull)name; |
| | | |
| | | /** |
| | | * 返回指定键的 meta。 |
| | | * |
| | | * @param key meta 的键。 |
| | | * |
| | | * @return 指定键的 meta。 |
| | | */ |
| | | - (NSString * _Nullable)objectForKeyedSubscript:(NSString * _Nonnull)key; |
| | | |
| | | /** |
| | | * 添加指定的 meta 改变监听。 |
| | | * |
| | | * @param observer meta 改变的监听。 |
| | | */ |
| | | - (void)addObserver:(WVPageMetaChanged _Nonnull)observer; |
| | | |
| | | /** |
| | | * 移除指定的 meta 改变监听。 |
| | | * |
| | | * @param observer meta 改变的监听。 |
| | | */ |
| | | - (void)removeObserver:(WVPageMetaChanged _Nonnull)observer; |
| | | |
| | | /** |
| | | 移除全部的 meta 改变监听。 |
| | | */ |
| | | - (void)removeAllObservers; |
| | | |
| | | #pragma mark - 提取元数据 |
| | | |
| | | /** |
| | | * 返回指定名称 meta 的布尔值。 |
| | | * |
| | | * @param name meta 的名称。 |
| | | * |
| | | * @return 指定名称 meta 的布尔值。 |
| | | */ |
| | | - (BOOL)boolValue:(NSString * _Nonnull)name; |
| | | |
| | | /** |
| | | * 返回指定名称 meta 的布尔值。 |
| | | * |
| | | * @param name meta 的名称。 |
| | | * @param defaultValue 默认值。 |
| | | * |
| | | * @return 指定名称 meta 的布尔值。 |
| | | */ |
| | | - (BOOL)boolValue:(NSString * _Nonnull)name default:(BOOL)defaultValue; |
| | | |
| | | /** |
| | | * 返回指定名称 meta 的 unsigned long long 值。 |
| | | * |
| | | * @param name meta 的名称。 |
| | | * |
| | | * @return 指定名称 meta 的 unsigned long long 值。 |
| | | */ |
| | | - (unsigned long long)unsignedLongLongValue:(NSString * _Nonnull)name; |
| | | |
| | | /** |
| | | * 返回指定名称 meta 的 unsigned long long 值。 |
| | | * |
| | | * @param name meta 的名称。 |
| | | * @param defaultValue 默认值。 |
| | | * |
| | | * @return 指定名称 meta 的 unsigned long long 值。 |
| | | */ |
| | | - (unsigned long long)unsignedLongLongValue:(NSString * _Nonnull)name default:(unsigned long long)defaultValue; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * WVRequestInterceptor.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import "WVNavigation.h" |
| | | #import "WVWebViewProtocol.h" |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | /** |
| | | 表示 WebView 的通用请求拦截器协议,可以在客户端的 WebView 中做通用拦截。 |
| | | */ |
| | | @protocol WVRequestInterceptorProtocol <NSObject> |
| | | |
| | | @required |
| | | |
| | | /** |
| | | 是否拦截指定请求。 |
| | | |
| | | @param webView 当前 WebView |
| | | @param request 当前请求 |
| | | @param navigation 当前导航信息 |
| | | |
| | | @return 如果要拦截指定请求,由拦截器处理,则为 YES;否则为 NO,由 WebView 自行处理。 |
| | | */ |
| | | - (BOOL)webView:(UIView<WVWebViewProtocol> * _Nonnull)webView canInterceptRequest:(NSURLRequest * _Nonnull)request withNavigation:(WVNavigation * _Nonnull)navigation; |
| | | |
| | | @end |
| | | |
| | | /** |
| | | 表示 WebView 的请求拦截器,可以在客户端的 WebView 中做通用拦截。 |
| | | */ |
| | | @interface WVRequestInterceptor : NSObject |
| | | |
| | | /** |
| | | 注册一个前置请求拦截器,会在 WebView Delegate 之前执行拦截。 |
| | | |
| | | @param interceptor 要注册的请求拦截器。 |
| | | */ |
| | | + (void)registerPreRequestInterceptor:(id<WVRequestInterceptorProtocol> _Nonnull)interceptor; |
| | | |
| | | /** |
| | | 注册一个后置请求拦截器,会在 WebView Delegate 之后执行拦截。 |
| | | |
| | | @param interceptor 要注册的请求拦截器。 |
| | | */ |
| | | + (void)registerRequestInterceptor:(id<WVRequestInterceptorProtocol> _Nonnull)interceptor; |
| | | |
| | | @end |
New file |
| | |
| | | // |
| | | // WVSafeAreaAdaptor.h |
| | | // Basic |
| | | // |
| | | // Created by lianyu.ysj on 2017/10/2. |
| | | // Copyright © 2017年 WindVane. All rights reserved. |
| | | // |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | /** |
| | | 包含对安全域区域的适配逻辑。 |
| | | */ |
| | | @interface WVSafeAreaAdaptor : NSObject |
| | | |
| | | /** |
| | | 判断是否是 iOS 11。 |
| | | 貌似有越狱机系统是 iOS11,但调用任何 iOS11 方法都会 Crash,所以需要再额外主动检测一下 API 是否存在。 |
| | | */ |
| | | + (BOOL)isIOS11; |
| | | |
| | | /** |
| | | 返回指定 UIScrollView 的 adjustedContentInset。 |
| | | */ |
| | | + (UIEdgeInsets)adjustedContentInset:(UIScrollView *)scrollView; |
| | | |
| | | /** |
| | | 返回当前是否是异形屏。 |
| | | */ |
| | | + (BOOL)hasNotch; |
| | | |
| | | /** |
| | | 返回当前 UI 方向下的设备 SafeArea 间距,只考虑状态栏和 Home Bar。 |
| | | |
| | | @return 设备 SafeArea 间距,只考虑状态栏和 Home Bar。 |
| | | */ |
| | | + (UIEdgeInsets)currentSafeAreaInsets; |
| | | |
| | | @end |
| | | |
New file |
| | |
| | | /* |
| | | * WVSysVersion.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | /** |
| | | * 返回当前系统版本是否等于指定的值。 |
| | | */ |
| | | NS_INLINE BOOL sysVersionEqualTo(NSString * version) { |
| | | return [[[UIDevice currentDevice] systemVersion] compare:version options:NSNumericSearch] == NSOrderedSame; |
| | | } |
| | | |
| | | /** |
| | | * 返回当前系统版本是否大于指定的值。 |
| | | */ |
| | | NS_INLINE BOOL sysVersionGreaterThan(NSString * version) { |
| | | return [[[UIDevice currentDevice] systemVersion] compare:version options:NSNumericSearch] == NSOrderedDescending; |
| | | } |
| | | |
| | | /** |
| | | * 返回当前系统版本是否大于等于指定的值。 |
| | | */ |
| | | NS_INLINE BOOL sysVersionGreaterThanOrEqualTo(NSString * version) { |
| | | return [[[UIDevice currentDevice] systemVersion] compare:version options:NSNumericSearch] != NSOrderedAscending; |
| | | } |
| | | |
| | | /** |
| | | * 返回当前系统版本是否小于指定的值。 |
| | | */ |
| | | NS_INLINE BOOL sysVersionLessThan(NSString * version) { |
| | | return [[[UIDevice currentDevice] systemVersion] compare:version options:NSNumericSearch] == NSOrderedAscending; |
| | | } |
| | | |
| | | /** |
| | | * 返回当前系统版本是否小于等于指定的值。 |
| | | */ |
| | | NS_INLINE BOOL sysVersionLessThanOrEqualTo(NSString * version) { |
| | | return [[[UIDevice currentDevice] systemVersion] compare:version options:NSNumericSearch] != NSOrderedDescending; |
| | | } |
| | | |
| | | // 用来判断系统版本的宏,相对来说更建议使用内联函数。 |
| | | #define SYS_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame) |
| | | #define SYS_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending) |
| | | #define SYS_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending) |
| | | #define SYS_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending) |
| | | #define SYS_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending) |
| | | #define SYS_LESS_THAN_OR_EQUAL_TO(v) SYS_VERSION_LESS_THAN_OR_EQUAL_TO(v) |
New file |
| | |
| | | // |
| | | // WVTypeConverter.h |
| | | // Core |
| | | // |
| | | // Created by lianyu.ysj on 2018/1/24. |
| | | // Copyright © 2018年 WindVane. All rights reserved. |
| | | // |
| | | |
| | | #import <CoreGraphics/CoreGraphics.h> |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | /** |
| | | 提供了安全的类型转换接口, |
| | | */ |
| | | |
| | | #if defined __cplusplus |
| | | extern "C" { |
| | | #endif |
| | | |
| | | #define WV_SAFE_TYPE_INVOKE(NAME, VALUE, DEFAULT, ...) NAME(VALUE, DEFAULT) |
| | | |
| | | /** |
| | | 安全的转换为 BOOL 类型,如果不存在或类型错误则返回默认值。 |
| | | 具体的转换规则由 value 的实际类型决定。 |
| | | */ |
| | | BOOL wvSafeBOOL(id value, BOOL defaultValue); |
| | | #define WV_SAFE_BOOL(VALUE, ...) WV_SAFE_TYPE_INVOKE(wvSafeBOOL, VALUE, ##__VA_ARGS__, NO) |
| | | |
| | | /** |
| | | 安全的转换为 NSInteger 类型,如果不存在或类型错误则返回默认值。 |
| | | 具体的转换规则由 value 的实际类型决定。 |
| | | */ |
| | | NSInteger wvSafeInteger(id value, NSInteger defaultValue); |
| | | #define WV_SAFE_INTEGER(VALUE, ...) WV_SAFE_TYPE_INVOKE(wvSafeInteger, VALUE, ##__VA_ARGS__, 0) |
| | | |
| | | /** |
| | | 安全的转换为 NSInteger 类型,如果不存在或类型错误则返回默认值。 |
| | | 具体的转换规则由 value 的实际类型决定,字符串会按照十六进制解析。 |
| | | */ |
| | | NSInteger wvSafeHexInteger(id value, NSInteger defaultValue); |
| | | #define WV_SAFE_HEX_INTEGER(VALUE, ...) WV_SAFE_TYPE_INVOKE(wvSafeHexInteger, VALUE, ##__VA_ARGS__, 0) |
| | | |
| | | /** |
| | | 安全的转换为 NSUInteger 类型,如果不存在或类型错误则返回默认值。 |
| | | 具体的转换规则由 value 的实际类型决定。 |
| | | */ |
| | | NSUInteger wvSafeUnsignedInteger(id value, NSUInteger defaultValue); |
| | | #define WV_SAFE_UINTEGER(VALUE, ...) WV_SAFE_TYPE_INVOKE(wvSafeUnsignedInteger, VALUE, ##__VA_ARGS__, 0) |
| | | |
| | | /** |
| | | 安全的转换为 long long 类型,如果不存在或类型错误则返回默认值。 |
| | | 具体的转换规则由 value 的实际类型决定。 |
| | | */ |
| | | long long wvSafeLongLong(id value, long long defaultValue); |
| | | #define WV_SAFE_LLONG(VALUE, ...) WV_SAFE_TYPE_INVOKE(wvSafeLongLong, VALUE, ##__VA_ARGS__, 0LL) |
| | | |
| | | /** |
| | | 安全的转换为 unsigned long long 类型,如果不存在或类型错误则返回默认值。 |
| | | 具体的转换规则由 value 的实际类型决定。 |
| | | */ |
| | | unsigned long long wvSafeUnsignedLongLong(id value, unsigned long long defaultValue); |
| | | #define WV_SAFE_ULLONG(VALUE, ...) WV_SAFE_TYPE_INVOKE(wvSafeUnsignedLongLong, VALUE, ##__VA_ARGS__, 0ULL) |
| | | |
| | | /** |
| | | 安全的转换为 CGFloat 类型,如果不存在或类型错误则返回默认值。 |
| | | 具体的转换规则由 value 的实际类型决定。 |
| | | */ |
| | | CGFloat wvSafeFloat(id value, CGFloat defaultValue); |
| | | #define WV_SAFE_FLOAT(VALUE, ...) WV_SAFE_TYPE_INVOKE(wvSafeFloat, VALUE, ##__VA_ARGS__, 0.0) |
| | | |
| | | /** |
| | | 安全的转换为 double 类型,如果不存在或类型错误则返回默认值。 |
| | | 具体的转换规则由 value 的实际类型决定。 |
| | | */ |
| | | double wvSafeDouble(id value, double defaultValue); |
| | | #define WV_SAFE_DOUBLE(VALUE, ...) WV_SAFE_TYPE_INVOKE(wvSafeDouble, VALUE, ##__VA_ARGS__, 0.0) |
| | | |
| | | /** |
| | | 安全的转换为 NSString 类型,如果不存在或类型错误则返回默认值。 |
| | | */ |
| | | NSString * wvSafeString(id value, NSString * defaultValue); |
| | | #define WV_SAFE_STRING(VALUE, ...) WV_SAFE_TYPE_INVOKE(wvSafeString, VALUE, ##__VA_ARGS__, nil) |
| | | |
| | | /** |
| | | 安全的转换为 NSArray 类型,如果不存在或类型错误则返回默认值。 |
| | | */ |
| | | NSArray * wvSafeArray(id value, NSArray * defaultValue); |
| | | #define WV_SAFE_ARRAY(VALUE, ...) WV_SAFE_TYPE_INVOKE(wvSafeArray, VALUE, ##__VA_ARGS__, nil) |
| | | |
| | | /** |
| | | 安全的转换为 NSDictionary 类型,如果不存在或类型错误则返回默认值。 |
| | | */ |
| | | NSDictionary * wvSafeDictionary(id value, NSDictionary * defaultValue); |
| | | #define WV_SAFE_DICTIONARY(VALUE, ...) WV_SAFE_TYPE_INVOKE(wvSafeDictionary, VALUE, ##__VA_ARGS__, nil) |
| | | |
| | | #if defined __cplusplus |
| | | }; |
| | | #endif |
New file |
| | |
| | | // |
| | | // WVUIConfig.h |
| | | // Core |
| | | // |
| | | // Created by lianyu on 2019/7/12. |
| | | // Copyright © 2019 WindVane. All rights reserved. |
| | | // |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | /** |
| | | WindVane UI 配置项目。 |
| | | */ |
| | | @interface WVUIConfig : NSObject |
| | | |
| | | #pragma mark - ScrollIndicator |
| | | |
| | | /** |
| | | 获取默认是否显示垂直滚动条指示器。 |
| | | */ |
| | | + (BOOL)showsVerticalScrollIndicator; |
| | | |
| | | /** |
| | | 设置默认是否显示垂直滚动条指示器,默认为 YES。 |
| | | */ |
| | | + (void)setShowsVerticalScrollIndicator:(BOOL)showsVerticalScrollIndicator; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * WVURL.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | #pragma mark - WVURLQueryItem |
| | | |
| | | /** |
| | | * URL 的查询项。 |
| | | * 若查询项的 '=' 前不包含内容,那么相应 WVURLQueryItem 的 name 属性为空字符串。 |
| | | * 若查询项的 '=' 后不包含内容,那么相应 WVURLQueryItem 的 value 属性为空字符串。 |
| | | * 若查询项不包含 '=',那么相应 WVURLQueryItem 的 value 属性为 nil。 |
| | | * 若查询项为空(即查询字符串以 '&' 开头、以 '&' 结尾或者包含 '&&' 时),那么相应 WVURLQueryItem 的 name 属性为空字符串,value 属性为 nil。 |
| | | */ |
| | | @interface WVURLQueryItem : NSObject <NSCopying> |
| | | |
| | | /** |
| | | * URL 查询的名称。 |
| | | */ |
| | | @property (nonatomic, copy, readonly, nonnull) NSString * name; |
| | | |
| | | /** |
| | | * URL 查询的值。 |
| | | */ |
| | | @property (nonatomic, copy, readonly, nullable) NSString * value; |
| | | |
| | | /** |
| | | * 返回空的查询项(name 为空字符串,value 为 nil)。 |
| | | */ |
| | | + (WVURLQueryItem * _Nonnull)empty; |
| | | |
| | | /** |
| | | * 使用指定的查询项(name=value)初始化。 |
| | | * |
| | | * @param query URL 的查询项。 |
| | | * |
| | | * @return URL 查询项。 |
| | | */ |
| | | + (instancetype _Nonnull)queryItemWithQuery:(NSString * _Nonnull)query; |
| | | /** |
| | | * 使用指定的查询名称和值初始化。 |
| | | * |
| | | * @param name URL 的查询名称。 |
| | | * @param value URL 的查询值。 |
| | | * |
| | | * @return URL 查询项。 |
| | | */ |
| | | + (instancetype _Nonnull)queryItemWithName:(NSString * _Nonnull)name value:(NSString * _Nullable)value; |
| | | |
| | | /** |
| | | * 使用指定的查询名称和值初始化。 |
| | | * |
| | | * @param name URL 的查询名称。 |
| | | * @param value URL 的查询值。 |
| | | */ |
| | | - (instancetype _Nonnull)initWithName:(NSString * _Nonnull)name value:(NSString * _Nullable)value NS_DESIGNATED_INITIALIZER; |
| | | |
| | | /** |
| | | * 返回当前查询是否为空查询项(name 为空字符串,value 为 nil)。 |
| | | * |
| | | * @return 如果是空查询项,则为 YES;否则为 NO。 |
| | | */ |
| | | - (BOOL)isEmpty; |
| | | |
| | | /** |
| | | * 返回当前查询项是否与指定查询项内容相同。 |
| | | * |
| | | * @param queryItem 要检查的查询项。 |
| | | * |
| | | * @return 如果内容相同,则为 YES;否则为 NO。 |
| | | */ |
| | | - (BOOL)isEqualToQueryItem:(WVURLQueryItem * _Nullable)queryItem; |
| | | |
| | | /** |
| | | * 返回当前查询项的字符串格式。 |
| | | * |
| | | * @return 当前查询项的字符串格式。 |
| | | */ |
| | | - (NSString * _Nonnull)queryString; |
| | | |
| | | @end |
| | | |
| | | #pragma mark - WVURL |
| | | |
| | | // 部分常用的固定 Scheme,参考 http://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml。 |
| | | typedef NS_ENUM(NSInteger, WVURLScheme) { |
| | | // 此枚举中未列出的 Scheme。 |
| | | WVURLSchemeNotListed = -1, |
| | | // 无 Scheme。 |
| | | WVURLSchemeNone = 0, |
| | | // about [RFC6694] |
| | | WVURLSchemeAbout, |
| | | // data [RFC2397] |
| | | WVURLSchemeData, |
| | | // Host-specific file names [RFC1738] |
| | | WVURLSchemeFile, |
| | | // File Transfer Protocol [RFC1738] |
| | | WVURLSchemeFtp, |
| | | // Hypertext Transfer Protocol [RFC7230, Section 2.7.1] |
| | | WVURLSchemeHttp, |
| | | // Hypertext Transfer Protocol Secure [RFC7230, Section 2.7.2] |
| | | WVURLSchemeHttps, |
| | | // Instant Messaging [RFC3860] |
| | | WVURLSchemeIM, |
| | | // Electronic mail address [RFC6068] |
| | | WVURLSchemeMailto, |
| | | // Short Message Service [RFC5724] |
| | | WVURLSchemeSms, |
| | | // telephone [RFC3966] |
| | | WVURLSchemeTel, |
| | | }; |
| | | |
| | | // WVURL 的查询选项。 |
| | | typedef NS_OPTIONS(NSInteger, WVURLQueryOptions) { |
| | | // [追加&替换]查询会追加到起始位置,而不是结束位置。 |
| | | WVURLQueryPrepend = 1 << 0, |
| | | // [追加]如果要追加的查询键已存在,则不再追加。如果与 WVURLQueryCompareItem 一起使用,那么只会生效 WVURLQueryCompareItem。 |
| | | WVURLQueryCompareKey = 1 << 1, |
| | | // [追加]如果要追加的查询键和值已存在,则不再追加。 |
| | | WVURLQueryCompareItem = 1 << 2, |
| | | // [替换]如果要替换的查询不存在,则自动追加。 |
| | | WVURLQueryAutoAppend = 1 << 3, |
| | | // [替换]替换查询的第一次出现,移除其它出现。 |
| | | WVURLQueryReplaceAll = 1 << 4, |
| | | }; |
| | | |
| | | // about:blank 的 URL。 |
| | | FOUNDATION_EXPORT NSString * _Nonnull const WVURLStringBlank; |
| | | |
| | | /** |
| | | * 包含 URL 的操作,格式参照 RFC 3986,提供对 Combo 的支持,但不会做任何编码、解码操作。 |
| | | * url = [<scheme> :] [// <authority>] / <path> [?? <comboPath>] [? <query>] [# <fragment>] |
| | | * |
| | | * 对相同 URL 的多次操作,请使用相应实例方法。 |
| | | */ |
| | | @interface WVURL : NSObject |
| | | |
| | | /** |
| | | * 当前 URL 字符串。 |
| | | */ |
| | | @property (nonatomic, copy, readonly, nonnull) NSString * urlString; |
| | | |
| | | /** |
| | | * 使用指定的字符串得到 WVURL 的新实例。 |
| | | */ |
| | | + (instancetype _Nullable)URLWithString:(NSString * _Nullable)urlString; |
| | | |
| | | /** |
| | | * 使用指定的 NSURL 得到 WVURL 的新实例。 |
| | | */ |
| | | + (instancetype _Nullable)URLWithNSURL:(NSURL * _Nullable)url; |
| | | |
| | | /** |
| | | * 使用指定的 URL 字符串初始化。 |
| | | * |
| | | * @param urlString URL 字符串,不能为 nil。 |
| | | */ |
| | | - (instancetype _Nullable)initWithString:(NSString * _Nonnull)urlString; |
| | | |
| | | /** |
| | | * 检查指定的 URL 是否是空地址,支持 NSURL * 和 NSString *。 |
| | | */ |
| | | + (BOOL)isBlank:(id _Nullable)url; |
| | | |
| | | #pragma mark - Scheme |
| | | |
| | | /** |
| | | * URL 的 scheme。 |
| | | * |
| | | * @discussion scheme 总是由小写字母组成,且不会包含最后的 ':';如果不包含 scheme,则为 nil,scheme 不会为空字符串。 |
| | | */ |
| | | @property (nonatomic, copy, nullable) NSString * scheme; |
| | | |
| | | /** |
| | | * 已定义的 scheme 枚举。 |
| | | */ |
| | | @property (nonatomic, assign) WVURLScheme schemeDefine; |
| | | |
| | | /** |
| | | * 返回当前 url scheme 是否是 http 或 https。 |
| | | */ |
| | | - (BOOL)isHttpOrHttps; |
| | | |
| | | /** |
| | | * 返回当前 url scheme 是否可能是应用 scheme(可以跳转到外部应用)。 |
| | | */ |
| | | - (BOOL)isAppScheme; |
| | | |
| | | /** |
| | | * 返回指定 url scheme 是否是 http 或 https。 |
| | | */ |
| | | + (BOOL)isHttpOrHttps:(NSURL * _Nullable)url; |
| | | |
| | | /** |
| | | * 返回指定 url scheme 是否可能是应用 scheme(可以跳转到外部应用)。 |
| | | */ |
| | | + (BOOL)isAppScheme:(NSURL * _Nullable)url; |
| | | |
| | | /** |
| | | * 返回指定 URL 的 scheme。 |
| | | * |
| | | * @param url 要获取 scheme 的 URL。 |
| | | * |
| | | * @return 指定 URL 的 scheme。 |
| | | */ |
| | | + (NSString * _Nullable)getScheme:(NSString * _Nullable)url; |
| | | |
| | | /** |
| | | * 返回指定 URL 的已定义的 scheme 枚举。 |
| | | * |
| | | * @param url 要获取已定义的 scheme 枚举的 URL。 |
| | | * |
| | | * @return 指定 URL 的已定义的 scheme 枚举。 |
| | | */ |
| | | + (WVURLScheme)getSchemeDefine:(NSString * _Nullable)url; |
| | | |
| | | /** |
| | | * 移除 URL 的 scheme。 |
| | | * |
| | | * @param url 要移除 scheme 的 URL。 |
| | | * |
| | | * @return 移除 scheme 后的 URL。 |
| | | */ |
| | | + (NSString * _Nullable)urlWithoutScheme:(NSString * _Nullable)url; |
| | | |
| | | #pragma mark - Authority |
| | | |
| | | /** |
| | | * URL 的 Authority。 |
| | | * |
| | | * @discussion authority 不会包含起始的 '//';如果不包含 authority,如 'http://',则为 nil;如果包含空 authority,如 'http:///path',则为空字符串。 |
| | | */ |
| | | @property (nonatomic, copy, nullable) NSString * authorityString; |
| | | |
| | | /** |
| | | * URL Authority 中的用户信息部分。 |
| | | * |
| | | * @discussion userInfo 不会包含与 host 分割的 '@';如果 Authority 不包含 '@',则为 nil;如果 '@' 前没有其它字符,则为空字符串。 |
| | | */ |
| | | @property (nonatomic, copy, nullable) NSString * userInfo; |
| | | |
| | | /** |
| | | * URL Authority 中的 Host 部分。 |
| | | * |
| | | * @discussion 如果 Authority 为 nil,那么 host 也为 nil;否则 host 不会为 nil。 |
| | | */ |
| | | @property (nonatomic, copy, nullable) NSString * host; |
| | | |
| | | /** |
| | | * URL Authority 中的端口部分。 |
| | | * |
| | | * @discussion port 不会包含与 host 分割的 ':';如果 Authority 不包含 ':',则为 nil;如果 ':' 后没有其它字符,则为空字符串。 |
| | | * 这里不会对 port 的有效性(是否全部由数字组成)做校验,需要使用方自行处理无效的 port。 |
| | | */ |
| | | @property (nonatomic, copy, nullable) NSString * port; |
| | | |
| | | /** |
| | | * URL Authority 中的端口部分是否有效。 |
| | | */ |
| | | @property (nonatomic, assign, readonly, getter=isPortValid) BOOL portValid; |
| | | |
| | | /** |
| | | * 返回指定的端口是否有效。 |
| | | */ |
| | | + (BOOL)isValidPort:(NSString * _Nullable)port; |
| | | |
| | | #pragma mark - Path |
| | | |
| | | /** |
| | | * URL 的路径字符串。 |
| | | * |
| | | * @discussion 如果不包含 path,则为 nil。 |
| | | */ |
| | | @property (nonatomic, copy, nullable) NSString * pathString; |
| | | |
| | | /** |
| | | * 返回当前 URL 的 MIME Type。 |
| | | */ |
| | | - (NSString * _Nonnull)getMimeType; |
| | | |
| | | /** |
| | | * 返回指定 URL 是否是 HTML URL。 |
| | | */ |
| | | + (BOOL)isHTML:(NSString * _Nullable)url; |
| | | |
| | | /** |
| | | * 返回指定 URL 是否是 JS URL。 |
| | | */ |
| | | + (BOOL)isJS:(NSString * _Nullable)url; |
| | | |
| | | /** |
| | | * 返回指定 path 的 MIME 类型。 |
| | | */ |
| | | + (NSString * _Nullable)getMimeTypeWithPath:(NSString * _Nullable)path; |
| | | |
| | | /** |
| | | * 根据文件内容猜测 MIME 类型。 |
| | | */ |
| | | + (NSString * _Nonnull)getMimiTypeFromData:(NSData * _Nullable)data; |
| | | |
| | | /** |
| | | * 将指定路径拼装到当前路径的末尾,并返回新路径。 |
| | | * 与 [NSString stringByAppendingPathComponent:] 不同的是,NSString 提供的方法会将 http:// 强制改为 http:/,而本方法不会。 |
| | | */ |
| | | + (NSString * _Nullable)stringByAppendingPathComponent:(NSString * _Nullable)basePath withPathComponent:(NSString * _Nullable)pathComponent; |
| | | |
| | | #pragma mark - Combo Path |
| | | |
| | | /** |
| | | * Combo 路径字符串。 |
| | | * |
| | | * @discussion 如果不包含 Combo 路径,则为 nil。 |
| | | */ |
| | | @property (nonatomic, copy, nullable) NSString * comboPathString; |
| | | |
| | | /** |
| | | * Combo 路径数组,数组的每一项对应一个 Combo 路径。 |
| | | * |
| | | * @discussion 如果不包含 Combo 路径,则为 nil,comboPathArray 不会为空数组。 |
| | | */ |
| | | @property (nonatomic, copy, nullable) NSArray<NSString *> * comboPathArray; |
| | | |
| | | /** |
| | | * 返回指定 combo 路径对应的 URL 字符串。 |
| | | */ |
| | | - (NSString * _Nullable)getComboURLString:(NSString * _Nullable)comboPath; |
| | | |
| | | /** |
| | | * 判断指定的 URL 是否是 Combo URL。 |
| | | */ |
| | | + (BOOL)isComboUrl:(NSString * _Nullable)url; |
| | | |
| | | #pragma mark - Query |
| | | |
| | | /** |
| | | * URL 的查询字符串。 |
| | | * |
| | | * @discussion 如果不包含查询,如 'http://host/path',则为 nil;如果包含空查询,如 'http://host/path?',则为空字符串。 |
| | | */ |
| | | @property (nonatomic, copy, nullable) NSString * queryString; |
| | | |
| | | /** |
| | | * URL 的查询数组,数组的每一项都是 WVURLQueryItem 类型。 |
| | | * |
| | | * @discussion 如果不包含查询,如 'http://host/path',则为 nil;如果包含空查询,如 'http://host/path?',则为包含一个 [WVURLQueryItem empty] 对象的数组。 |
| | | * 这里永远不会返回空数组,设置时会被当做 nil 看待。 |
| | | */ |
| | | @property (nonatomic, copy, nullable) NSArray<WVURLQueryItem *> * queryItems; |
| | | |
| | | /** |
| | | * 返回指定 URL 的查询字符串。 |
| | | */ |
| | | + (NSString * _Nullable)urlQuery:(NSString * _Nullable)url; |
| | | |
| | | /** |
| | | * 将查询项数组转换为相应的字典, |
| | | * 同名的查询会取最后一个;值为 nil 的查询,会使用空字符串表示。 |
| | | * |
| | | * @param queryItems 查询项数组。 |
| | | * |
| | | * @return 对应的字典。 |
| | | */ |
| | | + (NSMutableDictionary<NSString *, NSString *> * _Nullable)queryItemsToDictionary:(NSArray<WVURLQueryItem *> * _Nullable)queryItems; |
| | | |
| | | /** |
| | | * 将查询项数组转换为相应的字符串, |
| | | * |
| | | * @param queryItems 查询项数组。 |
| | | * |
| | | * @return 对应的字符串。 |
| | | */ |
| | | + (NSString * _Nullable)queryItemsToString:(NSArray<WVURLQueryItem *> * _Nullable)queryItems; |
| | | |
| | | /** |
| | | * 分析指定的查询字符串。 |
| | | * |
| | | * @param queryString 要分析的查询,为 name1=value1&name2=value2 的格式。 |
| | | */ |
| | | + (NSMutableArray<WVURLQueryItem *> * _Nullable)parseQueryString:(NSString * _Nullable)queryString; |
| | | |
| | | /** |
| | | * 分析指定的查询字符串为字典。 |
| | | * 同名的查询会取最后一个;值为 nil 的查询,会使用空字符串表示。 |
| | | * |
| | | * @param queryString 要分析的查询,为 name1=value1&name2=value2 的格式。 |
| | | */ |
| | | + (NSMutableDictionary<NSString *, NSString *> * _Nullable)parseQueryStringAsDictionary:(NSString * _Nullable)queryString; |
| | | |
| | | #pragma mark Contains Query |
| | | |
| | | /** |
| | | * 返回当前 URL 是否包含指定名称的查询。 |
| | | * |
| | | * @param queryName 要检查的查询名称。 |
| | | * |
| | | * @return 如果包含指定名称和值的查询,则为 YES;否则为 NO。 |
| | | */ |
| | | - (BOOL)containsQuery:(NSString * _Nullable)queryName; |
| | | |
| | | /** |
| | | * 返回当前 URL 是否包含指定查询。 |
| | | * |
| | | * @param queryItem 要判断的查询。 |
| | | * |
| | | * @return 如果包含指定查询,则为 YES;否则为 NO。 |
| | | */ |
| | | - (BOOL)containsQueryItem:(WVURLQueryItem * _Nullable)queryItem; |
| | | |
| | | /** |
| | | * 返回当前 URL 是否包含指定名称和值的查询。 |
| | | * |
| | | * @param queryName 要检查的查询名称。 |
| | | * @param value 要检查的查询值。 |
| | | * |
| | | * @return 如果包含指定名称和值的查询,则为 YES;否则为 NO。 |
| | | */ |
| | | - (BOOL)containsQuery:(NSString * _Nullable)queryName withValue:(NSString * _Nullable)value; |
| | | |
| | | /** |
| | | * 返回当前 URL 是否包含指定的查询。 |
| | | * |
| | | * @param queries 要检查的查询,为 name=value 的格式,只能支持一个查询。 |
| | | * |
| | | * @return 如果包含指定的查询,则为 YES;否则为 NO。 |
| | | */ |
| | | - (BOOL)containsQueries:(NSString * _Nullable)queries; |
| | | |
| | | /** |
| | | * 返回指定 URL 是否包含指定名称的查询。 |
| | | * |
| | | * @param url 要检查的 URL。 |
| | | * @param queryName 要检查的查询名称,不能为 nil。 |
| | | * |
| | | * @return 如果包含指定名称的查询,则为 YES;否则为 NO。 |
| | | */ |
| | | + (BOOL)isUrl:(NSString * _Nullable)url containsQuery:(NSString * _Nullable)queryName; |
| | | |
| | | /** |
| | | * 返回当前 URL 是否包含指定查询。 |
| | | * |
| | | * @param queryItem 要判断的查询。 |
| | | * |
| | | * @return 如果包含指定查询,则为 YES;否则为 NO。 |
| | | */ |
| | | + (BOOL)isUrl:(NSString * _Nullable)url containsQueryItem:(WVURLQueryItem * _Nullable)queryItem; |
| | | |
| | | /** |
| | | * 返回指定 URL 是否包含指定名称和值的查询。 |
| | | * |
| | | * @param url 要检查的 URL。 |
| | | * @param queryName 要检查的查询名称。 |
| | | * @param value 要检查的查询值。 |
| | | * |
| | | * @return 如果包含指定名称和值的查询,则为 YES;否则为 NO。 |
| | | */ |
| | | + (BOOL)isUrl:(NSString * _Nullable)url containsQuery:(NSString * _Nullable)queryName withValue:(NSString * _Nullable)value; |
| | | |
| | | /** |
| | | * 返回当前 URL 是否包含指定的查询。 |
| | | * |
| | | * @param queries 要检查的查询,为 name=value 的格式,只能支持一个查询。 |
| | | * |
| | | * @return 如果包含指定的查询,则为 YES;否则为 NO。 |
| | | */ |
| | | + (BOOL)isUrl:(NSString * _Nullable)url containsQueries:(NSString * _Nullable)queries; |
| | | |
| | | #pragma mark Get Query |
| | | |
| | | /** |
| | | * 返回当前 URL 指定查询第一次出现的值。 |
| | | * |
| | | * @param queryName 查询的名称。 |
| | | * |
| | | * @return 查询第一次出现的值。如果查询不存在,则返回 nil;如果查询存在但值为 nil,则返回空字符串。 |
| | | */ |
| | | - (NSString * _Nullable)getQueryValue:(NSString * _Nullable)queryName; |
| | | |
| | | /** |
| | | * 返回当前 URL 指定查询第一次出现的值。 |
| | | * |
| | | * @param queryName 查询的名称。 |
| | | * @param value 返回查询第一次出现的值。 |
| | | * |
| | | * @return 如果找到了指定的查询,则为 YES;否则为 NO。 |
| | | */ |
| | | - (BOOL)getQuery:(NSString * _Nullable)queryName withValue:(NSString * _Nullable * _Nonnull)value; |
| | | |
| | | /** |
| | | * 返回指定 URL 指定查询第一次出现的值。 |
| | | * |
| | | * @param queryName 查询的名称。 |
| | | * |
| | | * @return 查询第一次出现的值。如果查询不存在,则返回 nil;如果查询存在但值为 nil,则返回空字符串。 |
| | | */ |
| | | + (NSString * _Nullable)url:(NSString * _Nullable)url getQueryValue:(NSString * _Nullable)queryName; |
| | | |
| | | /** |
| | | * 返回指定 URL 指定查询第一次出现的值。 |
| | | * |
| | | * @param queryName 查询的名称。 |
| | | * @param value 返回查询第一次出现的值。 |
| | | * |
| | | * @return 如果找到了指定的查询,则为 YES;否则为 NO。 |
| | | */ |
| | | + (BOOL)url:(NSString * _Nullable)url getQuery:(NSString * _Nullable)queryName withValue:(NSString * _Nullable * _Nonnull)value; |
| | | |
| | | #pragma mark Append Query |
| | | |
| | | /** |
| | | * 向当前 URL 的查询追加指定的查询。 |
| | | * |
| | | * @param queryItem 要追加的查询。 |
| | | */ |
| | | - (void)appendQueryItem:(WVURLQueryItem * _Nullable)queryItem; |
| | | |
| | | /** |
| | | * 向当前 URL 的查询追加指定名称和值的查询。 |
| | | * |
| | | * @param queryItem 要追加的查询。 |
| | | * @param options 追加的选项,可用的选项有 WVURLQueryPrepend、WVURLQueryCompareKey 和 WVURLQueryCompareItem。 |
| | | */ |
| | | - (void)appendQueryItem:(WVURLQueryItem * _Nullable)queryItem options:(WVURLQueryOptions)options; |
| | | |
| | | /** |
| | | * 向当前 URL 的查询追加指定名称和值的查询。 |
| | | * |
| | | * @param queryName 查询的名称。 |
| | | * @param value 查询的值。 |
| | | */ |
| | | - (void)appendQuery:(NSString * _Nullable)queryName withValue:(NSString * _Nullable)value; |
| | | |
| | | /** |
| | | * 向当前 URL 的查询追加指定名称和值的查询。 |
| | | * |
| | | * @param queryName 查询的名称。 |
| | | * @param value 查询的值。 |
| | | * @param options 追加的选项,可用的选项有 WVURLQueryPrepend、WVURLQueryCompareKey 和 WVURLQueryCompareItem。 |
| | | */ |
| | | - (void)appendQuery:(NSString * _Nullable)queryName withValue:(NSString * _Nullable)value options:(WVURLQueryOptions)options; |
| | | |
| | | /** |
| | | * 向当前 URL 的查询追加指定的查询,支持一次性增加单个或多个查询。 |
| | | * |
| | | * @param queries 要追加的查询,为 name1=value1&name2=value2 的格式。 |
| | | */ |
| | | - (void)appendQueries:(NSString * _Nullable)queries; |
| | | |
| | | /** |
| | | * 向当前 URL 的查询追加指定的查询,支持一次性增加单个或多个查询。 |
| | | * |
| | | * @param queries 要追加的查询,为 name1=value1&name2=value2 的格式。 |
| | | * @param options 追加的选项,可用的选项有 WVURLQueryPrepend、WVURLQueryCompareKey 和 WVURLQueryCompareItem。 |
| | | */ |
| | | - (void)appendQueries:(NSString * _Nullable)queries options:(WVURLQueryOptions)options; |
| | | |
| | | /** |
| | | * 向指定 URL 的查询追加指定的查询。 |
| | | * |
| | | * @param url 要追加的 URL。 |
| | | * @param queryItem 要追加的查询。 |
| | | * |
| | | * @return 已追加查询的 URL。 |
| | | */ |
| | | + (NSString * _Nullable)url:(NSString * _Nullable)url appendQueryItem:(WVURLQueryItem * _Nullable)queryItem; |
| | | |
| | | /** |
| | | * 向指定 URL 的查询追加指定的查询。 |
| | | * |
| | | * @param url 要追加的 URL。 |
| | | * @param queryItem 要追加的查询。 |
| | | * @param options 追加的选项,可用的选项有 WVURLQueryPrepend、WVURLQueryCompareKey 和 WVURLQueryCompareItem。 |
| | | * |
| | | * @return 已追加查询的 URL。 |
| | | */ |
| | | + (NSString * _Nullable)url:(NSString * _Nullable)url appendQueryItem:(WVURLQueryItem * _Nullable)queryItem options:(WVURLQueryOptions)options; |
| | | |
| | | /** |
| | | * 向指定 URL 的查询追加指定名称和值的查询。 |
| | | * |
| | | * @param url 要追加的 URL。 |
| | | * @param queryName 要追加的查询名称。 |
| | | * @param value 要追加的查询值。 |
| | | * |
| | | * @return 已追加查询的 URL。 |
| | | */ |
| | | + (NSString * _Nullable)url:(NSString * _Nullable)url appendQuery:(NSString * _Nullable)queryName withValue:(NSString * _Nullable)value; |
| | | |
| | | /** |
| | | * 向指定 URL 的查询追加指定名称和值的查询。 |
| | | * |
| | | * @param url 要追加的 URL。 |
| | | * @param queryName 要追加的查询名称。 |
| | | * @param value 要追加的查询值。 |
| | | * @param options 追加的选项,可用的选项有 WVURLQueryPrepend、WVURLQueryCompareKey 和 WVURLQueryCompareItem。 |
| | | * |
| | | * @return 已追加查询的 URL。 |
| | | */ |
| | | + (NSString * _Nullable)url:(NSString * _Nullable)url appendQuery:(NSString * _Nullable)queryName withValue:(NSString * _Nullable)value options:(WVURLQueryOptions)options; |
| | | |
| | | /** |
| | | * 向指定 URL 的查询追加指定的查询,支持一次性增加单个或多个查询。 |
| | | * |
| | | * @param url 要追加的 URL。 |
| | | * @param queries 要追加的查询,为 name1=value1&name2=value2 的格式。 |
| | | * |
| | | * @return 已追加查询的 URL。 |
| | | */ |
| | | + (NSString * _Nullable)url:(NSString * _Nullable)url appendQueries:(NSString * _Nullable)queries; |
| | | |
| | | /** |
| | | * 向指定 URL 的查询追加指定的查询,支持一次性增加单个或多个查询。 |
| | | * |
| | | * @param url 要追加的 URL。 |
| | | * @param queries 要追加的查询,为 name1=value1&name2=value2 的格式。 |
| | | * @param options 追加的选项,可用的选项有 WVURLQueryPrepend、WVURLQueryCompareKey 和 WVURLQueryCompareItem。 |
| | | * |
| | | * @return 已追加查询的 URL。 |
| | | */ |
| | | + (NSString * _Nullable)url:(NSString * _Nullable)url appendQueries:(NSString * _Nullable)queries options:(WVURLQueryOptions)options; |
| | | ; |
| | | |
| | | #pragma mark Remove Query |
| | | |
| | | /** |
| | | * 移除所有具有指定名称的查询。 |
| | | * |
| | | * @param queryName 查询的名称。 |
| | | */ |
| | | - (void)removeQuery:(NSString * _Nullable)queryName; |
| | | |
| | | /** |
| | | * 移除所有指定名称的空(值为 nil 或空字符串)查询。 |
| | | * |
| | | * @param queryName 查询的名称。 |
| | | */ |
| | | - (void)removeEmptyQuery:(NSString * _Nullable)queryName; |
| | | |
| | | /** |
| | | * 移除所有指定的查询。 |
| | | * |
| | | * @param queryItem 要移除的查询。 |
| | | */ |
| | | - (void)removeQueryItem:(WVURLQueryItem * _Nullable)queryItem; |
| | | |
| | | /** |
| | | * 移除所有指定名称和值的查询。 |
| | | * |
| | | * @param queryName 要移除的查询的名称。 |
| | | * @param value 要移除的查询的值。 |
| | | */ |
| | | - (void)removeQuery:(NSString * _Nullable)queryName withValue:(NSString * _Nullable)value; |
| | | |
| | | /** |
| | | * 移除所有指定名称和值的查询。 |
| | | * |
| | | * @param queries 要移除的查询,为 name=value 的格式,只能支持一个查询。 |
| | | */ |
| | | - (void)removeQueries:(NSString * _Nullable)queries; |
| | | |
| | | /** |
| | | * 从指定的 URL 中移除所有具有指定名称的查询。 |
| | | * |
| | | * @param url 要检查的 URL。 |
| | | * @param queryName 要移除的查询的名称。 |
| | | * |
| | | * @return 移除指定查询后的 URL。 |
| | | */ |
| | | + (NSString * _Nullable)url:(NSString * _Nullable)url removeQuery:(NSString * _Nullable)queryName; |
| | | |
| | | /** |
| | | * 从指定的 URL 中移除所有指定名称的空(值为 nil 或空字符串)查询。 |
| | | * |
| | | * @param url 要检查的 URL。 |
| | | * @param queryName 要移除的查询的名称。 |
| | | * |
| | | * @return 移除指定查询后的 URL。 |
| | | */ |
| | | + (NSString * _Nullable)url:(NSString * _Nullable)url removeEmptyQuery:(NSString * _Nullable)queryName; |
| | | |
| | | /** |
| | | * 从指定的 URL 中移除所有指定查询。 |
| | | * |
| | | * @param url 要检查的 URL。 |
| | | * @param queryItem 要移除的查询。 |
| | | * |
| | | * @return 移除指定查询后的 URL。 |
| | | */ |
| | | + (NSString * _Nullable)url:(NSString * _Nullable)url removeQueryItem:(WVURLQueryItem * _Nullable)queryItem; |
| | | |
| | | /** |
| | | * 从指定的 URL 中移除所有指定名称和值的查询。 |
| | | * |
| | | * @param url 要检查的 URL。 |
| | | * @param queryName 要移除的查询的名称。 |
| | | * @param value 要移除的查询的值。 |
| | | * |
| | | * @return 移除指定查询后的 URL。 |
| | | */ |
| | | + (NSString * _Nullable)url:(NSString * _Nullable)url removeQuery:(NSString * _Nullable)queryName withValue:(NSString * _Nullable)value; |
| | | |
| | | /** |
| | | * 从指定的 URL 中移除所有指定的查询。 |
| | | * |
| | | * @param url 要检查的 URL。 |
| | | * @param queries 要移除的查询,为 name=value 的格式,只能支持一个查询。 |
| | | * |
| | | * @return 移除指定查询后的 URL。 |
| | | */ |
| | | + (NSString * _Nullable)url:(NSString * _Nullable)url removeQueries:(NSString * _Nullable)queries; |
| | | |
| | | #pragma mark Replace Query |
| | | |
| | | /** |
| | | * 将指定的查询替换为指定的值。 |
| | | * |
| | | * @param queryName 查询的名称。 |
| | | * @param value 查询的新值。 |
| | | */ |
| | | - (void)replaceQuery:(NSString * _Nullable)queryName withValue:(NSString * _Nullable)value; |
| | | |
| | | /** |
| | | * 将指定的查询替换为指定的值。 |
| | | * |
| | | * @param queryName 查询的名称。 |
| | | * @param value 查询的新值。 |
| | | * @param options 查询的替换选项,可用的选项有 WVURLQueryPrepend、WVURLQueryAutoAppend 和 WVURLQueryReplaceAll。 |
| | | */ |
| | | - (void)replaceQuery:(NSString * _Nullable)queryName withValue:(NSString * _Nullable)value options:(WVURLQueryOptions)options; |
| | | |
| | | /** |
| | | * 将指定 URL 的的查询替换为指定的值。 |
| | | * |
| | | * @param queryName 查询的名称。 |
| | | * @param value 查询的新值。 |
| | | * |
| | | * @return 替换后的 URL。 |
| | | */ |
| | | + (NSString * _Nullable)url:(NSString * _Nullable)url replaceQuery:(NSString * _Nullable)queryName withValue:(NSString * _Nullable)value; |
| | | |
| | | /** |
| | | * 将指定 URL 的的查询替换为指定的值。 |
| | | * |
| | | * @param queryName 查询的名称。 |
| | | * @param value 查询的新值。 |
| | | * @param options 查询的替换选项,可用的选项有 WVURLQueryPrepend、WVURLQueryAutoAppend 和 WVURLQueryReplaceAll。 |
| | | * |
| | | * @return 替换后的 URL。 |
| | | */ |
| | | + (NSString * _Nullable)url:(NSString * _Nullable)url replaceQuery:(NSString * _Nullable)queryName withValue:(NSString * _Nullable)value options:(WVURLQueryOptions)options; |
| | | |
| | | /** |
| | | * 清空 Query 和 Fragment。 |
| | | */ |
| | | - (void)clearQueryAndFragment; |
| | | |
| | | /** |
| | | * 移除 URL 中的查询参数和 Fragment。 |
| | | */ |
| | | + (NSString * _Nullable)urlWithoutQueryAndFragment:(NSString * _Nullable)url; |
| | | |
| | | #pragma mark - Fragment |
| | | |
| | | /** |
| | | * URL 的 Fragment。 |
| | | * |
| | | * @discussion 如果不包含 Fragment,如 'http://host/path',则为 nil;如果包含空 Fragment,如 'http://host/path#',则为空字符串。 |
| | | */ |
| | | @property (nonatomic, copy, nullable) NSString * fragment; |
| | | |
| | | /** |
| | | * 移除 URL 中的 Fragment。 |
| | | */ |
| | | + (NSString * _Nullable)urlWithoutFragment:(NSString * _Nullable)url; |
| | | |
| | | /** |
| | | * 比较两个 URL 是否相同(忽略 fragment)。 |
| | | * |
| | | * @param url1 要比较的第一个 URL。 |
| | | * @param url2 要比较的第二个 URL。 |
| | | */ |
| | | + (BOOL)compareWithoutFragment:(NSString * _Nullable)url1 withURL:(NSString * _Nullable)url2; |
| | | |
| | | @end |
| | | |
| | | #pragma mark - NSURL (WVURL) |
| | | |
| | | /** |
| | | * 为 NSURL 提供的扩展方法。 |
| | | */ |
| | | @interface NSURL (WVURL) |
| | | |
| | | /** |
| | | * 已定义的 scheme 枚举。 |
| | | */ |
| | | @property (nonatomic, assign, readonly) WVURLScheme wvSchemeDefine; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * WVURLProtocolService.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | // WindVane 请求重写的阶段。 |
| | | typedef NS_ENUM(NSInteger, WVRequestPhase) { |
| | | // 请求导航阶段(WebView shouldStartLoadWithRequest),此时重写会导致 WebView 重新加载请求。 |
| | | WVRequestPhaseNavigation DEPRECATED_MSG_ATTRIBUTE("导航阶段重写改为使用 WVRequestInterceptor,不再使用 WVRequestRewriterProtocol"), |
| | | // 请求加载阶段(NSURLRequest startLoading),此时重写只会改变实际加载的内容。 |
| | | WVRequestPhaseLoading, |
| | | }; |
| | | |
| | | /** |
| | | * WindVane 的请求重写器。 |
| | | */ |
| | | @protocol WVRequestRewriterProtocol <NSObject> |
| | | |
| | | /** |
| | | * 重写指定的请求。 |
| | | * !! 请务必保证此方法稳定、健壮,否则会对所有 Web 页面造成影响 !! |
| | | * |
| | | * @param request 要重写的请求。 |
| | | * |
| | | * @return 如果重写了请求,则为 YES,否则为 NO。 |
| | | */ |
| | | - (BOOL)rewrite:(NSMutableURLRequest *)request phase:(WVRequestPhase)phase; |
| | | |
| | | @end |
| | | |
| | | /** |
| | | * WindVane 的 URLProtocol 服务。 |
| | | */ |
| | | @interface WVURLProtocolService : NSObject |
| | | |
| | | /** |
| | | * 注册一个请求重写器。 |
| | | * |
| | | * @param rewriter 要注册的请求重写器。 |
| | | */ |
| | | + (void)registerRequestRewriter:(id<WVRequestRewriterProtocol>)rewriter; |
| | | |
| | | /** |
| | | * 注册要拦截请求的 UserAgent 标记,具有改标记的 UserAgent 可以使用 WindVane 提供的预加载功能。 |
| | | * |
| | | * @param userAgentMark 要拦截请求的 UserAgent 标记。 |
| | | */ |
| | | + (void)registerUserAgentMark:(NSString *)userAgentMark; |
| | | |
| | | /** |
| | | * 返回是否支持 WKWebView 的 NSURLProtocol 拦截。 |
| | | */ |
| | | + (BOOL)supportWKURLProtocol; |
| | | |
| | | /** |
| | | * 设置是否支持 WKWebView 的 NSURLProtocol 拦截。 |
| | | */ |
| | | + (void)setSupportWKURLProtocol:(BOOL)supportWKURLProtocol; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * WVUserConfig.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | /** |
| | | * WindVane 环境设置。 |
| | | */ |
| | | typedef NS_ENUM(NSUInteger, WVEnvironment) { |
| | | WVEnvironmentDebug = 0, // 预发环境。 |
| | | WVEnvironmentDaily = 1, // 日常环境。 |
| | | WVEnvironmentRelease = 2 // 线上环境。 |
| | | }; |
| | | |
| | | /** |
| | | * WindVane 日志级别。 |
| | | */ |
| | | typedef NS_ENUM(NSInteger, WVLogLevel) { |
| | | WVLogLevelOff = 0, // 关闭日志。 |
| | | WVLogLevelError = 1, // 错误日志。 |
| | | WVLogLevelWarn = 2, // 警告日志。 |
| | | WVLogLevelInfo = 3, // 信息日志。 |
| | | WVLogLevelDebug = 4, // 调试日志。 |
| | | WVLogLevelVerbose = 5 // 冗余日志。 |
| | | }; |
| | | |
| | | /** |
| | | * WindVane 配置项目。 |
| | | */ |
| | | @interface WVUserConfig : NSObject |
| | | |
| | | #pragma mark - 必需配置,一定要正确设置 |
| | | |
| | | /** |
| | | * 设置客户端的 AppKey。AppKey 是一串数字,可以在应用中心 http://mappcenter.alibaba-inc.com/ 申请。 |
| | | */ |
| | | + (void)setAppKey:(NSString *)appKey; |
| | | |
| | | /** |
| | | * 设置是否从安全黑匣子中自动读取 AppKey,与 setAppKey: 方法必须调用其中一个。 |
| | | */ |
| | | + (void)useSafeSecert:(BOOL)isUse; |
| | | |
| | | /** |
| | | * 获取客户端的 AppKey,默认为 @""。 |
| | | */ |
| | | + (NSString *)appKey; |
| | | |
| | | /** |
| | | * 返回 AppKey 是否全部是由数字组成的。 |
| | | */ |
| | | + (BOOL)isValidAppKey; |
| | | |
| | | /** |
| | | * 设置客户端的名称,会在 UserAgent 的 AliApp 部分带上,请务必正确设置。 |
| | | * 可以参考 阿里集团客户端 UserAgent 规范 https://lark.alipay.com/velocity_cross-end-web/docs/wiki_app-ua 。 |
| | | */ |
| | | + (void)setAppName:(NSString *)appName; |
| | | |
| | | /** |
| | | * 获取客户端的名称,默认为 @""。 |
| | | */ |
| | | + (NSString *)appName; |
| | | |
| | | /** |
| | | * 设置客户端的版本号,请与客户端的实际版本号保持一致。 |
| | | */ |
| | | + (void)setAppVersion:(NSString *)appVersion; |
| | | |
| | | /** |
| | | * 获取客户端的版本号,默认使用 info.plist 中的 CFBundleShortVersionString。 |
| | | */ |
| | | + (NSString *)appVersion; |
| | | |
| | | /** |
| | | * 设置 WindVane 环境类型。 |
| | | * WindVane 环境类型请与客户端当前环境保持一致。 |
| | | */ |
| | | + (void)setEnvironment:(WVEnvironment)environment; |
| | | |
| | | /** |
| | | * 获取 WindVane 环境类型,默认为线上环境。 |
| | | */ |
| | | + (WVEnvironment)environment; |
| | | |
| | | /** |
| | | * 返回指定环境的名称。 |
| | | */ |
| | | + (NSString *)getEnvironmentName:(WVEnvironment)env; |
| | | |
| | | #pragma mark - 调试配置,建议在 DEBUG 模式下打开 |
| | | |
| | | /** |
| | | * 设置是否为调试模式,会开启额外的日志、检查和提示。 |
| | | */ |
| | | + (void)setDebugMode:(BOOL)isDebugMode; |
| | | |
| | | /** |
| | | * 获取是否为调试模式,默认为 NO。 |
| | | */ |
| | | + (BOOL)isDebugMode; |
| | | |
| | | /** |
| | | * 打开 WindVane 日志输出,会输出 Debug 及以上级别日志。 |
| | | */ |
| | | + (void)openWindVaneLog; |
| | | |
| | | /** |
| | | * 设置 WindVane 日志级别。 |
| | | */ |
| | | + (void)setLogLevel:(WVLogLevel)logLevel; |
| | | |
| | | /** |
| | | * 获取 WindVane 日志级别,默认为 WVLogLevelOff。 |
| | | */ |
| | | + (WVLogLevel)logLevel; |
| | | |
| | | /** |
| | | * 设置 JavaScript 日志的级别。 |
| | | * 设置后,只会在新创建的 WebView 生效。 |
| | | */ |
| | | + (void)setJSLogLevel:(WVLogLevel)logLevel; |
| | | |
| | | /** |
| | | * 获取 JavaScript 日志的级别,默认为 WVLogLevelOff。 |
| | | */ |
| | | + (WVLogLevel)JSLogLevel; |
| | | |
| | | #pragma mark - 其它配置 |
| | | |
| | | /** |
| | | * 设置客户端的补充 UA,会跟在 WindVane UA 的后面。 |
| | | * 可以参考 http://h5.alibaba-inc.com/windvane/H5Standard.html 。 |
| | | */ |
| | | + (void)setAppUA:(NSString *)appUA; |
| | | |
| | | /** |
| | | * 获取客户端的补充 UA。 |
| | | */ |
| | | + (NSString *)appUA; |
| | | |
| | | /** |
| | | * 设置通过 [WebView loadRequest:] 方法加载页面时带上的默认参数。 |
| | | */ |
| | | + (void)setDefaultParamForFirstLoad:(NSString *)defaultParamForFistLoad; |
| | | |
| | | /** |
| | | * 获取通过 [WebView loadRequest:] 方法加载页面时带上的默认参数。 |
| | | */ |
| | | + (NSString *)defaultParamForFistLoad; |
| | | |
| | | /** |
| | | * 设置自定义的 HTTP 请求头,会额外添加到 WebView 发出的请求头中。 |
| | | */ |
| | | + (void)setCustomHttpHeader:(NSDictionary<NSString *, NSString *> *)header; |
| | | |
| | | /** |
| | | * 获取自定义的 HTTP 请求头,会额外添加到 WebView 发出的请求头中。 |
| | | */ |
| | | + (NSDictionary<NSString *, NSString *> *)customHttpHeader; |
| | | |
| | | /** |
| | | * 设置 TTID。 |
| | | */ |
| | | + (void)setTTid:(NSString *)ttid; |
| | | |
| | | /** |
| | | * 获取 TTID。 |
| | | */ |
| | | + (NSString *)ttid; |
| | | |
| | | /** |
| | | 使用指定的 bundle 和 tableName 实现 WindVane 的本地化。 |
| | | */ |
| | | + (void)localizedWithBundle:(NSBundle *)bundle fromTable:(NSString *)table; |
| | | |
| | | /** |
| | | 获取 sid。 |
| | | */ |
| | | + (NSString *)sid; |
| | | |
| | | /** |
| | | 设置 sid,目前主要供支付功能使用。 |
| | | */ |
| | | + (void)setSid:(NSString *)sid; |
| | | |
| | | #pragma mark - [慎用]WindVane SDK 配置 |
| | | |
| | | /** |
| | | [慎用]设置是否自动更新配置。 |
| | | 请仅当 WindVane 默认配置已可以满足要求,或者会自行设置 WindVane 配置的情况下使用。 |
| | | */ |
| | | + (void)setConfigAutoUpdate:(BOOL)configAutoUpdate; |
| | | |
| | | /** |
| | | 获取是否自动更新配置,默认为 YES。 |
| | | */ |
| | | + (BOOL)configAutoUpdate; |
| | | |
| | | /** |
| | | [慎用]设置 WindVane 的配置基础 URL。 |
| | | 仅当使用独立的 WindVane 配置域名时设置,设置时必须咨询 WindVane SDK iOS 负责人 @炼玉。 |
| | | 格式类似 @"https://wvcfg.alicdn.com/bizcache/5/windvane/" |
| | | */ |
| | | + (void)setConfigBaseURL:(NSString *)baseURL; |
| | | |
| | | /** |
| | | 获取 WindVane 的配置基础 URL。 |
| | | */ |
| | | + (NSString *)configBaseURL; |
| | | |
| | | #pragma mark - 已废弃,删除时间未定 |
| | | |
| | | // 请直接使用 setAppKey: 方法。 |
| | | + (void)setAppKey:(NSString *)key secrect:(NSString *)secrect; |
| | | // WVServer.send 接口相关配置。 |
| | | + (NSString *)appSecrect; |
| | | + (NSString *)nickName; |
| | | + (void)setNickName:(NSString *)nickName; |
| | | + (BOOL)isUseSafeSecert; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * WVWKWebView.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import "WVWebViewDelegate.h" |
| | | #import "WVWebViewProtocol.h" |
| | | #import <WebKit/WebKit.h> |
| | | |
| | | |
| | | NS_CLASS_AVAILABLE_IOS(8_0) |
| | | @interface WVWKWebView : WKWebView <WVWebViewProtocol> |
| | | |
| | | /** |
| | | * 挂载的归属源 UIViewController |
| | | */ |
| | | @property (nonatomic, weak) UIViewController * sourceViewController; |
| | | |
| | | #pragma mark - Load Request |
| | | |
| | | /** |
| | | * 当前加载的请求 |
| | | */ |
| | | @property (nonatomic, readonly, copy) NSURLRequest * request; |
| | | |
| | | #pragma mark - Delegate |
| | | |
| | | /** |
| | | * 当前 WebView 的委托。 |
| | | */ |
| | | @property (nonatomic, weak) id<WVWebViewDelegate> windVaneDelegate; |
| | | |
| | | /** |
| | | * WKWebView 默认的 navigationDelegate 与 UIWebView 无法兼容,因此请使用 windVaneDelegate。 |
| | | */ |
| | | @property (nonatomic, weak) id<WKNavigationDelegate> navigationDelegate DEPRECATED_MSG_ATTRIBUTE("请使用 windVaneDelegate"); |
| | | |
| | | #pragma mark - Life cycle |
| | | |
| | | /** |
| | | * [注意:必须在 ViewController 的 viewWillDisappear 中调用!!!] 释放 WebView 的服务。 |
| | | */ |
| | | - (void)releaseWebViewService; |
| | | |
| | | /** |
| | | * [注意:必须在 ViewController 的 viewWillAppear 中调用!!!] 重新绑定 WebView 的服务。 |
| | | */ |
| | | - (void)bindingWebViewService; |
| | | |
| | | #pragma mark - JSBridge |
| | | |
| | | /** |
| | | * 是否开启 JSBridge 服务,默认为 NO。 |
| | | */ |
| | | @property (nonatomic, assign, getter=isOpenLocalService) BOOL openLocalService; |
| | | |
| | | /** |
| | | 执行一次 WKWebView 的 Cookie 同步。 |
| | | */ |
| | | + (void)syncCookie; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * WVWeakObjectWrapper.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | /** |
| | | * 弱引用的包装类,并支持方法转发。 |
| | | */ |
| | | @interface WVWeakObjectWrapper<ObjectType> : NSProxy |
| | | |
| | | /** |
| | | * 被弱引用的对象。 |
| | | */ |
| | | @property (nonatomic, weak, readonly) ObjectType weakObject; |
| | | |
| | | /** |
| | | * 包装指定的弱引用对象。 |
| | | */ |
| | | + (WVWeakObjectWrapper<ObjectType> *)wrapWeakObject:(ObjectType)weakObject; |
| | | |
| | | /** |
| | | * 使用指定的弱引用对象初始化。 |
| | | */ |
| | | - (instancetype)initWithWeakObject:(ObjectType)weakObject; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * WVWebViewBasicProtocol.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import "WVJavaScriptExecutor.h" |
| | | #import <Foundation/Foundation.h> |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | /** |
| | | * 包含了 WebView 基本功能的协议。 |
| | | */ |
| | | @protocol WVWebViewBasicProtocol <WVJavaScriptExecutor> |
| | | |
| | | /** |
| | | * 与 WebView 关联的 UIScrollView。 |
| | | */ |
| | | @property (nonatomic, readonly, strong, nonnull) UIScrollView * scrollView; |
| | | |
| | | #pragma mark - Loading |
| | | |
| | | /** |
| | | * 加载指定的请求。 |
| | | */ |
| | | - (void)loadRequest:(NSURLRequest * _Nonnull)request; |
| | | |
| | | /** |
| | | * 加载指定的 HTML 字符串和 URL,必须指定可用的 URL。 |
| | | */ |
| | | - (void)loadHTMLString:(NSString * _Nonnull)string baseURL:(NSURL * _Nullable)baseURL; |
| | | |
| | | /** |
| | | * 加载指定的请求,并选择是否添加默认参数(由 [WVUserConfig setDefaultParamForFirstLoad:] 设置)。 |
| | | */ |
| | | - (void)loadRequest:(NSURLRequest * _Nonnull)request withDefaultParam:(BOOL)useDefaultParam; |
| | | |
| | | /** |
| | | * 加载指定的 URL。 |
| | | */ |
| | | - (void)loadURL:(NSString * _Nonnull)url; |
| | | |
| | | /** |
| | | * 加载指定的 URL,并选择是否添加默认参数(由 [WVUserConfig setDefaultParamForFirstLoad:] 设置)。 |
| | | */ |
| | | - (void)loadURL:(NSString * _Nonnull)url withDefaultParam:(BOOL)useDefaultParam; |
| | | |
| | | /** |
| | | * 停止加载。 |
| | | */ |
| | | - (void)stopLoading; |
| | | |
| | | /** |
| | | * 重新加载。 |
| | | */ |
| | | - (void)reload; |
| | | |
| | | /** |
| | | * WebView 当前加载的 URL,是主页面的 URL,而非 iframe。 |
| | | */ |
| | | @property (nonatomic, copy, readonly, nullable) NSURL * URL; |
| | | |
| | | /** |
| | | * WebView 是否正在加载内容。 |
| | | */ |
| | | @property (nonatomic, assign, readonly, getter=isLoading) BOOL loading; |
| | | |
| | | #pragma mark - Navigating |
| | | |
| | | /** |
| | | * 后退历史记录。 |
| | | */ |
| | | - (void)goBack; |
| | | |
| | | /** |
| | | * 前进历史记录。 |
| | | */ |
| | | - (void)goForward; |
| | | |
| | | /** |
| | | * 是否可以后退历史记录。 |
| | | */ |
| | | @property (nonatomic, readonly, getter=canGoBack) BOOL canGoBack; |
| | | |
| | | /** |
| | | * 是否可以前进历史记录。 |
| | | */ |
| | | @property (nonatomic, readonly, getter=canGoForward) BOOL canGoForward; |
| | | |
| | | /** |
| | | * 向当前 WebView 发送事件,并返回事件是否被 JS 取消默认行为。 |
| | | * 允许在任意线程调用,并总是在主线程回调。 |
| | | */ |
| | | - (void)dispatchEvent:(NSString * _Nonnull)eventName withParam:(id _Nullable)param withCallback:(void (^_Nullable)(NSString * _Nonnull eventName, BOOL preventDefault))callback; |
| | | |
| | | // 【不建议使用】执行 JavaScript 字符串,同步执行。 |
| | | - (NSString * _Nullable)stringByEvaluatingJavaScriptFromString:(NSString * _Nonnull)script DEPRECATED_MSG_ATTRIBUTE("请使用 evaluateJavaScript:completionHandler: 方法"); |
| | | |
| | | #pragma mark - Identifier |
| | | |
| | | /** |
| | | * 获取 WebView 当前页面的唯一标识。 |
| | | */ |
| | | - (NSString * _Nonnull)pageIdentifier; |
| | | |
| | | /** |
| | | * 设置 WebView 当前页面的唯一标识。 |
| | | */ |
| | | - (void)setPageIdentifier:(NSString * _Nonnull)pageIdentifier; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * WVWebViewCategory.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import "WVWebViewBasicProtocol.h" |
| | | #import <WebKit/WebKit.h> |
| | | |
| | | #pragma mark - WKWebViewCategory |
| | | |
| | | /** |
| | | * 针对 WKWebview 的 Category. |
| | | */ |
| | | @interface WKWebView (WVWKWebViewCategory) <WVWebViewBasicProtocol> |
| | | |
| | | /** |
| | | * 加载指定的请求,并选择是否添加默认参数(由 [WVUserConfig setDefaultParamForFirstLoad:] 设置)。 |
| | | */ |
| | | - (void)loadRequest:(NSURLRequest *)request withDefaultParam:(BOOL)useDefaultParam; |
| | | |
| | | /** |
| | | * 加载指定的 URL。 |
| | | */ |
| | | - (void)loadURL:(NSString *)url; |
| | | |
| | | /** |
| | | * 加载指定的 URL,并选择是否添加默认参数(由 [WVUserConfig setDefaultParamForFirstLoad:] 设置)。 |
| | | */ |
| | | - (void)loadURL:(NSString *)url withDefaultParam:(BOOL)useDefaultParam; |
| | | |
| | | /** |
| | | * 向当前 WebView 发送事件,并返回事件是否被 JS 取消默认行为。 |
| | | * 允许在任意线程调用,并总是在主线程回调。 |
| | | */ |
| | | - (void)dispatchEvent:(NSString *)eventName withParam:(id)param withCallback:(void (^)(NSString * eventName, BOOL isPreventDefault))callback; |
| | | |
| | | // 执行 JavaScript 字符串,同步执行。 |
| | | // 已废弃,请使用 [WKWebView evaluateJavaScript:completionHandler:] 方法。 |
| | | - (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)script DEPRECATED_ATTRIBUTE; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * WVWebViewDelegate.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import "WVUserConfig.h" |
| | | #import <UIKit/UIKit.h> |
| | | #import <WebKit/WebKit.h> |
| | | |
| | | @protocol WVWebViewProtocol; |
| | | @class WVWKWebView; |
| | | |
| | | /** |
| | | * WindVane 的 WebView 委托。 |
| | | */ |
| | | @protocol WVWebViewDelegate <NSObject, WKNavigationDelegate> |
| | | |
| | | @optional |
| | | |
| | | /** |
| | | * 在加载指定请求之前调用。 |
| | | * |
| | | * @return 如果要加载指定的请求,则返回 YES;否则返回 NO。 |
| | | */ |
| | | - (BOOL)webView:(UIView<WVWebViewProtocol> *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(WKNavigationType)navigationType; |
| | | |
| | | /** |
| | | * 在将要加载指定请求时调用。 |
| | | */ |
| | | - (void)webView:(UIView<WVWebViewProtocol> *)webView didStartProvisionalNavigation:(NSURLRequest *)request; |
| | | |
| | | /** |
| | | * 在开始加载新页面前调用。 |
| | | */ |
| | | - (void)webViewDidStartLoad:(UIView<WVWebViewProtocol> *)webView; |
| | | |
| | | /** |
| | | * 在页面加载完毕后调用。 |
| | | */ |
| | | - (void)webViewDidFinishLoad:(UIView<WVWebViewProtocol> *)webView; |
| | | |
| | | /** |
| | | * 在页面加载失败时调用。 |
| | | */ |
| | | - (void)webView:(UIView<WVWebViewProtocol> *)webView didFailLoadWithError:(NSError *)error; |
| | | |
| | | /** |
| | | * 在接收到 JS 的 console 日志或错误信息时调用。 |
| | | * 需要全局或 WebView 主动开启 JSLog 级别,才能接收 console 日志。 |
| | | */ |
| | | - (void)webView:(UIView<WVWebViewProtocol> *)webView didReceiveJSLog:(NSString *)log level:(WVLogLevel)level; |
| | | |
| | | /** |
| | | * 在 WKWebView 的页面内容处理被终止时调用,一般是 WKWebView 的进程意外退出导致的。 |
| | | * WVWKWebView 已默认对页面做了 reload 操作,请不要再次调用 reload。 |
| | | */ |
| | | - (void)webViewWebContentProcessDidTerminate:(WVWKWebView *)webView; |
| | | |
| | | @end |
| | | |
| | | /** |
| | | * 旧委托,由于拼写错误,已不再建议使用。 |
| | | */ |
| | | @protocol WindVaneUIWbeViewDelegate <WVWebViewDelegate> |
| | | @end |
New file |
| | |
| | | /* |
| | | * WVWebViewProtocol.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import "WVNavigation.h" |
| | | #import "WVWebViewBasicProtocol.h" |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | @class WVPageMeta; |
| | | @protocol WVWebViewDelegate; |
| | | |
| | | // WebView 的 viewport-fit 设置。 |
| | | typedef NS_ENUM(NSInteger, WVWebViewViewportFit) { |
| | | WVWebViewViewportFitAuto, // 自动设置 Viewport。 |
| | | WVWebViewViewportFitContain, // 保证 Viewport 完整可见。 |
| | | WVWebViewViewportFitCover, // 覆盖到物理屏幕的矩形之上。 |
| | | }; |
| | | |
| | | // WebView 可见性。 |
| | | typedef NS_ENUM(NSInteger, WVWebViewVisiblity) { |
| | | WVWebViewVisiblilityUnknown = 0, // 可见性未知。 |
| | | WVWebViewInvisible = 1, // 不可见。 |
| | | WVWebViewVisible = 2, // 可见。 |
| | | }; |
| | | |
| | | /** |
| | | 包含了 WindVane WebView 功能的协议。 |
| | | */ |
| | | @protocol WVWebViewProtocol <NSObject, WVWebViewBasicProtocol> |
| | | |
| | | @required |
| | | |
| | | #pragma mark - Configuration |
| | | |
| | | /** |
| | | 挂载的归属源 UIViewController。 |
| | | */ |
| | | @property (nonatomic, weak, nullable) UIViewController * sourceViewController; |
| | | |
| | | /** |
| | | [仅限 DEBUG 包]JavaScript 日志的级别,默认为 WVLogLevelOff。 |
| | | 请在 WebView 初始化时就设置好,后期再修改不一定能生效。 |
| | | */ |
| | | @property (nonatomic, assign) WVLogLevel JSLogLevel; |
| | | |
| | | /** |
| | | WebView 在所属 ViewController 中的可见性。 |
| | | */ |
| | | @property (nonatomic, assign) WVWebViewVisiblity visibleInViewController; |
| | | |
| | | /** |
| | | WebView 的内容是否允许拖拽超过边缘再回弹,默认为 YES。 |
| | | 需要禁止拖拽效果时,请使用本属性,不要对 ScrollView 的 bounces 属性进行设置。 |
| | | 与 forbiddenPullScroll 属性作用相同,但值恰好相反。 |
| | | */ |
| | | @property (nonatomic, assign) BOOL bounces; |
| | | |
| | | /** |
| | | 是否启用下拉刷新,默认为 NO。 |
| | | 启用下拉刷新之后,才允许自定义下拉刷新的视图样式。 |
| | | */ |
| | | @property (nonatomic, assign, getter=isUsePullToRefresh) BOOL usePullToRefresh; |
| | | |
| | | /** |
| | | 是否使用自定义的下拉刷新组件(仅支持 SVPullToRefresh 开源库),默认为 NO,会使用 WVPullToRefresh 和 WVInfiniteScrolling。 |
| | | 请在使用任何下拉刷新或上拉加载前设置,并且不要在中途修改,否则会发生错误。 |
| | | */ |
| | | @property (nonatomic, assign, getter=isUseCustomPullToRefresh) BOOL useCustomPullToRefresh; |
| | | |
| | | /** |
| | | WebView 的业务代码。 |
| | | */ |
| | | @property (nonatomic, strong, nullable) NSString * bizCode; |
| | | |
| | | /** |
| | | 是否响应点击 status bar 自动滚动到顶端。 |
| | | */ |
| | | @property (nonatomic, assign) BOOL scrollsToTop; |
| | | |
| | | /** |
| | | 是否允许 WebKit 长按事件(选择、弹出菜单),默认为 YES。 |
| | | */ |
| | | @property (nonatomic, assign, getter=isOpenWebKitLongPress) BOOL openWebKitLongPress; |
| | | |
| | | /** |
| | | 是否开启长按保存图片,默认为 YES |
| | | */ |
| | | @property (nonatomic, assign, getter=isOpenLongPressSaveImage) BOOL openLongPressSaveImage; |
| | | |
| | | /** |
| | | 是否允许内联播放媒体,默认为 YES。 |
| | | |
| | | @discussion 对于 WKWebView,必须在 initWithFrame:configuration: 的 configuration 中设置 allowsInlineMediaPlayback,初始化之后再设置可能无法生效。 |
| | | */ |
| | | @property (nonatomic, assign) BOOL allowsInlineMediaPlayback; |
| | | |
| | | /** |
| | | 媒体是否需要用户交互才能自动播放,默认为 NO。 |
| | | |
| | | @discussion 对于 WKWebView,必须在 initWithFrame:configuration: 的 configuration 中设置 mediaPlaybackRequiresUserAction,初始化之后再设置可能无法生效。 |
| | | */ |
| | | @property (nonatomic, assign) BOOL mediaPlaybackRequiresUserAction; |
| | | |
| | | /** |
| | | 是否允许 Air Play,默认为 YES。 |
| | | */ |
| | | @property (nonatomic, assign) BOOL mediaPlaybackAllowsAirPlay; |
| | | |
| | | /** |
| | | 是否要求用户操作后才能弹出键盘,默认为 YES。 |
| | | */ |
| | | @property (nonatomic, assign) BOOL keyboardDisplayRequiresUserAction; |
| | | |
| | | #pragma mark - Request |
| | | |
| | | /** |
| | | 当前加载的请求,是主页面的请求,而非 iframe。 |
| | | WKWebView 中只提供了 URL 属性,因此请优先使用 URL 属性,并总是以 URL 属性为准,request 有时可能并不完全准确(例如服务端 302 时)。 |
| | | */ |
| | | @property (nonatomic, readonly, copy, nullable) NSURLRequest * request; |
| | | |
| | | /** |
| | | 估计的加载进度。 |
| | | |
| | | @discussion 该属性支持 KVO。 |
| | | */ |
| | | @property (nonatomic, assign, readonly) double estimatedProgress; |
| | | |
| | | #pragma mark - Content |
| | | |
| | | /** |
| | | 当前 WebView 加载页面的 title。 |
| | | |
| | | @discussion 该属性支持 KVO。 |
| | | */ |
| | | @property (nonatomic, copy, readonly, nullable) NSString * title; |
| | | |
| | | /** |
| | | 当前导航信息,仅在 WVWebViewDelegate 的回调中生效。 |
| | | */ |
| | | @property (nonatomic, strong, readonly, nullable) WVNavigation * navigation; |
| | | |
| | | /** |
| | | WebView 的可见性,会由 ViewController 的可见性和 WebView 在 ViewController 中的可见性综合计算得到。 |
| | | |
| | | @discussion 该属性支持 KVO。 |
| | | */ |
| | | @property (nonatomic, assign, readonly) WVWebViewVisiblity visiblity; |
| | | |
| | | /** |
| | | WebView 的主页面内容类型,会忽略 iframe 内容的类型。 |
| | | */ |
| | | @property (nonatomic, assign, readonly) WVURLContentType contentType; |
| | | |
| | | /** |
| | | WebView 当前页面内容是否为空,该属性并不会实时反应页面的白屏状况,实时信息请使用 [WebView isPageEmpty:] 方法。 |
| | | */ |
| | | @property (nonatomic, assign, getter=isPageEmpty, readonly) BOOL pageEmpty; |
| | | |
| | | /** |
| | | 检查 WebView 的页面是否为空。 |
| | | |
| | | @param callback 检查结果的回调。 |
| | | */ |
| | | - (void)isPageEmpty:(void (^_Nonnull)(BOOL isPageEmpty))callback; |
| | | |
| | | /** |
| | | 当前页面的元数据。 |
| | | */ |
| | | @property (nonatomic, strong, readonly, nonnull) WVPageMeta * pageMeta; |
| | | |
| | | /** |
| | | 当前页面的 viewport-fit 设置。 |
| | | */ |
| | | @property (nonatomic, assign, readonly) WVWebViewViewportFit viewportFit; |
| | | |
| | | #pragma mark - Delegate |
| | | |
| | | /** |
| | | 当前 WebView 的委托。 |
| | | */ |
| | | @property (nonatomic, weak, nullable) id<WVWebViewDelegate> windVaneDelegate; |
| | | |
| | | #pragma mark - Life cycle |
| | | |
| | | /** |
| | | [注意:必须在 ViewController 的 viewWillDisappear 中调用!!!] 释放 WebView 的服务。 |
| | | */ |
| | | - (void)releaseWebViewService; |
| | | |
| | | /** |
| | | [注意:必须在 ViewController 的 viewWillAppear 中调用!!!] 重新绑定 WebView 的服务。 |
| | | */ |
| | | - (void)bindingWebViewService; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * WVWebViewRecorder.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | #import "WVWebViewProtocol.h" |
| | | |
| | | /** |
| | | * WebView 相关信息的记录。 |
| | | */ |
| | | @interface WVWebViewRecorder : NSObject |
| | | |
| | | /** |
| | | * 返回当前的 WebView 相关信息。 |
| | | */ |
| | | + (NSDictionary * _Nonnull)currentWebViewInfo; |
| | | |
| | | /** |
| | | * 返回所有 WebView。 |
| | | * 该数组包含 WebView 的强引用,不允许直接做强引用。 |
| | | */ |
| | | + (NSArray<UIView<WVWebViewProtocol> *> * _Nonnull)allWebView; |
| | | |
| | | /** |
| | | * 返回所有顶层 WebView。 |
| | | * 可见性为 WVWebViewVisiblilityUnknown 或 WVWebViewVisible。 |
| | | * 该数组包含 WebView 的强引用,不允许直接做强引用。 |
| | | */ |
| | | + (NSArray<UIView<WVWebViewProtocol> *> * _Nonnull)topWebView; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * WindVaneCore.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2020年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #ifdef __OBJC__ |
| | | |
| | | #import "NSData+WVUtility.h" |
| | | #import "NSError+WVUtility.h" |
| | | #import "NSMutableDictionary+WVUtility.h" |
| | | #import "NSObject+WVUtility.h" |
| | | #import "NSString+WVUtility.h" |
| | | #import "UIScrollView+WVPullToRefresh.h" |
| | | #import "UIViewController+WVUtility.h" |
| | | #import "WKWebViewConfiguration+WMixView.h" |
| | | #import "WVBasicConstant.h" |
| | | #import "WVBasicUserConfig.h" |
| | | #import "WVCommonUtil.h" |
| | | #import "WVConstant.h" |
| | | #import "WVCore.h" |
| | | #import "WVHttpUtil.h" |
| | | #import "WVJSONKit.h" |
| | | #import "WVJavaScriptExecutor.h" |
| | | #import "WVLog.h" |
| | | #import "WVNavigation.h" |
| | | #import "WVPageMeta.h" |
| | | #import "WVRequestInterceptor.h" |
| | | #import "WVSafeAreaAdaptor.h" |
| | | #import "WVSysVersion.h" |
| | | #import "WVTypeConverter.h" |
| | | #import "WVUIConfig.h" |
| | | #import "WVURL.h" |
| | | #import "WVURLProtocolService.h" |
| | | #import "WVUserConfig.h" |
| | | #import "WVWKWebView.h" |
| | | #import "WVWeakObjectWrapper.h" |
| | | #import "WVWebViewBasicProtocol.h" |
| | | #import "WVWebViewCategory.h" |
| | | #import "WVWebViewDelegate.h" |
| | | #import "WVWebViewProtocol.h" |
| | | #import "WVWebViewRecorder.h" |
| | | |
| | | #endif /* __OBJC__ */ |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
| | | <plist version="1.0"> |
| | | <dict> |
| | | <key>BuildMachineOSBuild</key> |
| | | <string>19B88</string> |
| | | <key>CFBundleDevelopmentRegion</key> |
| | | <string>en</string> |
| | | <key>CFBundleExecutable</key> |
| | | <string>WindVaneCore</string> |
| | | <key>CFBundleIdentifier</key> |
| | | <string>com.taobao.windvane.WindVaneCore</string> |
| | | <key>CFBundleInfoDictionaryVersion</key> |
| | | <string>6.0</string> |
| | | <key>CFBundleName</key> |
| | | <string>WindVaneCore</string> |
| | | <key>CFBundleShortVersionString</key> |
| | | <string>8.5.0.99-SNAPSHOT</string> |
| | | <key>CFBundleSignature</key> |
| | | <string>????</string> |
| | | <key>CFBundleSupportedPlatforms</key> |
| | | <array> |
| | | <string>iPhoneOS</string> |
| | | </array> |
| | | <key>CFBundleVersion</key> |
| | | <string>8.2.0</string> |
| | | <key>DTCompiler</key> |
| | | <string>com.apple.compilers.llvm.clang.1_0</string> |
| | | <key>DTPlatformBuild</key> |
| | | <string>17B102</string> |
| | | <key>DTPlatformName</key> |
| | | <string>iphoneos</string> |
| | | <key>DTPlatformVersion</key> |
| | | <string>13.2</string> |
| | | <key>DTSDKBuild</key> |
| | | <string>17B102</string> |
| | | <key>DTSDKName</key> |
| | | <string>iphoneos13.2</string> |
| | | <key>DTXcode</key> |
| | | <string>1120</string> |
| | | <key>DTXcodeBuild</key> |
| | | <string>11B500</string> |
| | | <key>MinimumOSVersion</key> |
| | | <string>8.0</string> |
| | | <key>UIDeviceFamily</key> |
| | | <array> |
| | | <integer>1</integer> |
| | | </array> |
| | | </dict> |
| | | </plist> |
New file |
| | |
| | | framework module WindVaneCore { |
| | | umbrella header "WindVaneCore.h" |
| | | |
| | | export * |
| | | module * { export * } |
| | | } |
New file |
| | |
| | | /* 2019-03-18 19:08:21 */ |
| | | !function(){!function(e){"use strict";var t={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(t.arrayBuffer)var r=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],n=function(e){return e&&DataView.prototype.isPrototypeOf(e)},o=ArrayBuffer.isView||function(e){return e&&r.indexOf(Object.prototype.toString.call(e))>-1};function a(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function i(e){return"string"!=typeof e&&(e=String(e)),e}function s(e){var r={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return t.iterable&&(r[Symbol.iterator]=function(){return r}),r}function u(e){this.map={},e instanceof u?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function l(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function c(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function f(e){var t=new FileReader,r=c(t);return t.readAsArrayBuffer(e),r}function h(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function d(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e)if("string"==typeof e)this._bodyText=e;else if(t.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(t.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(t.arrayBuffer&&t.blob&&n(e))this._bodyArrayBuffer=h(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!t.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e)&&!o(e))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=h(e)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},t.blob&&(this.blob=function(){var e=l(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?l(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(f)}),this.text=function(){var e,t,r,n=l(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,r=c(t),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},t.formData&&(this.formData=function(){return this.text().then(m)}),this.json=function(){return this.text().then(JSON.parse)},this}u.prototype.append=function(e,t){e=a(e),t=i(t);var r=this.map[e];this.map[e]=r?r+","+t:t},u.prototype.delete=function(e){delete this.map[a(e)]},u.prototype.get=function(e){return e=a(e),this.has(e)?this.map[e]:null},u.prototype.has=function(e){return this.map.hasOwnProperty(a(e))},u.prototype.set=function(e,t){this.map[a(e)]=i(t)},u.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},u.prototype.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),s(e)},u.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),s(e)},u.prototype.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),s(e)},t.iterable&&(u.prototype[Symbol.iterator]=u.prototype.entries);var p=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function y(e,t){var r,n,o=(t=t||{}).body;if(e instanceof y){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new u(e.headers)),this.method=e.method,this.mode=e.mode,o||null==e._bodyInit||(o=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new u(t.headers)),this.method=(r=t.method||this.method||"GET",n=r.toUpperCase(),p.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}function m(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(o))}}),t}function b(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new u(t.headers),this.url=t.url||"",this._initBody(e)}y.prototype.clone=function(){return new y(this,{body:this._bodyInit})},d.call(y.prototype),d.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new u(this.headers),url:this.url})},b.error=function(){var e=new b(null,{status:0,statusText:""});return e.type="error",e};var v=[301,302,303,307,308];b.redirect=function(e,t){if(-1===v.indexOf(t))throw new RangeError("Invalid status code");return new b(null,{status:t,headers:{location:e}})},e.Headers=u,e.Request=y,e.Response=b,e.fetch=function(e,r){return new Promise(function(n,o){var a=new y(e,r),i=new XMLHttpRequest;i.onload=function(){var e,t,r={status:i.status,statusText:i.statusText,headers:(e=i.getAllResponseHeaders()||"",t=new u,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(e){var r=e.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();t.append(n,o)}}),t)};r.url="responseURL"in i?i.responseURL:r.headers.get("X-Request-URL");var o="response"in i?i.response:i.responseText;n(new b(o,r))},i.onerror=function(){o(new TypeError("Network request failed"))},i.ontimeout=function(){o(new TypeError("Network request failed"))},i.open(a.method,a.url,!0),"include"===a.credentials?i.withCredentials=!0:"omit"===a.credentials&&(i.withCredentials=!1),"responseType"in i&&t.blob&&(i.responseType="blob"),a.headers.forEach(function(e,t){i.setRequestHeader(t,e)}),i.send(void 0===a._bodyInit?null:a._bodyInit)})},e.fetch.polyfill=!0}("undefined"!=typeof self?self:this),function(){var e=/^(?:button|image|reset|file)$/i,t=/^(?:input|select|textarea|keygen)/i,r=/(\[[^\[\]]*\])/g;function n(e,t,n){t.match(r);var o=e[t];return o?(Array.isArray(o)||(e[t]=[o]),e[t].push(n)):e[t]=n,e}function o(e,t,r){return r=r.replace(/(\r)?\n/g,"\r\n"),r=(r=encodeURIComponent(r)).replace(/%20/g,"+"),e+(e?"&":"")+encodeURIComponent(t)+"="+r}window.NebulaSerialize=function(r,a){"object"!=typeof a?a={hash:!!a}:void 0===a.hash&&(a.hash=!0);for(var i=a.hash?{}:"",s=a.serializer||(a.hash?n:o),u=r&&r.elements?r.elements:[],l=Object.create(null),c=0;c<u.length;++c){var f=u[c];if((a.disabled||!f.disabled)&&f.name&&t.test(f.nodeName)&&!e.test(f.type)&&(!/submit/.test(f.type)||document.activeElement===f||window.lastClickElement===f)){var h=f.name,d=f.value;if("checkbox"!==f.type&&"radio"!==f.type||f.checked||(d=void 0),a.empty){if("checkbox"===f.type&&!f.checked)continue;if("radio"===f.type&&!f.checked)continue;if("radio"===f.type&&(l[f.name]||f.checked?f.checked&&(l[f.name]=!0):l[f.name]=!1),void 0==d&&"radio"==f.type)continue}else if(!d)continue;if("select-multiple"!==f.type)i=s(i,h,d);else{d=[];for(var p=f.options,y=0;y<p.length;++y){var m=p[y],b=a.empty&&!m.value,v=m.value||b;m.selected&&v&&(i=s(i,h,m.value))}}}}if(a.empty)for(var h in l)l[h]||(i=s(i,h,""));return i}}(),function(){var e="NEBULA_BRIDGE_JS_REPLACE_STRING",t=window.webkit,r=t.messageHandlers.PSDXMLHTTPREQUESTMESSAGE.postMessage,n=t.messageHandlers.PSDXMLHTTPREQUESTMESSAGE;function o(e){return r.apply(n,[e])}var a=document.__lookupSetter__("cookie"),i=document.__lookupGetter__("cookie");function s(e,t){var r=[];if("form"==e.nodeName.toLowerCase()){for(var n=NebulaSerialize(e,{hash:!0,empty:!0}),o=[].slice.call(e.querySelectorAll("input")),a=0;a<o.length;a++){var i=o[a],s=i.type,u=i.name;if("file"==s&&i.files&&i.files.length>0)for(var l=i.files.length,c=0;c<l;c++)"application/x-www-form-urlencoded"!=e.enctype.toLowerCase()&&"text/plain"!=e.enctype.toLowerCase()||t?L[u]&&L[u][c]?r.push({name:u,value:L[u][c]}):r.push({name:u,value:i.files[c]}):r.push({name:u,value:i.files[c].name})}for(var f in n)n.hasOwnProperty(f)&&r.push({name:f,value:n[f]})}return r}function u(e){return new Promise(function(t,r){var n=e.value;if("string"==typeof n)t(e);else if(n instanceof Blob||n instanceof File){var o=new FileReader;o.onload=function(n){var o=n.target.result;o.length>0?(e.value=o,t(e)):r(new Error(""))},o.onerror=function(){r(new Error(""))},o.onabort=function(){r(new Error(""))},o.readAsDataURL(n)}else t(e)})}function l(e){for(var t="",r=new Uint8Array(e),n=r.byteLength,o=0;o<n;o++)t+=String.fromCharCode(r[o]);return window.btoa(t)}a&&i&&Object.defineProperty(document,"cookie",{set:function(r){if("string"==typeof r){var n={};n[b]="cookie",n.cookie=r,n.url=document.location.href,n.msgKt=e,t&&t.messageHandlers&&t.messageHandlers.PSDXMLHTTPREQUESTMESSAGE&&t.messageHandlers.PSDXMLHTTPREQUESTMESSAGE.postMessage&&o(n),a.apply(document,[r])}},get:function(){return i.apply(document,[])},configurable:!1});function c(t){if(t instanceof Error){var r={};r[b]="error",r.errorInfo=t.message,r.msgKt=e,o(r)}}function f(e){var t=e;if(t&&t.nodeName&&"string"==typeof t.nodeName&&"form"==t.nodeName.toLowerCase()){var r=t.method;if("string"!=typeof r&&(r=t.getAttribute("method")),r&&"get"===r.toLowerCase())return!0}return!1}function h(e){var t=e;if(!f(t)){var r=+new Date+""+Math.round(1e5*Math.random()),n=t.getAttribute("action");if(n||(n=""),/X-NEBULAXMLHTTPREQUEST/.test(n))t.setAttribute("action",n.replace(/X-NEBULAXMLHTTPREQUEST=(\d+)/,"X-NEBULAXMLHTTPREQUEST="+r));else{var o=document.createElement("a");if(o.href=n,o.search&&o.search.length>0){var a=o.search;/X-NEBULAXMLHTTPREQUEST/.test(a)?(a=a.replace(/X-NEBULAXMLHTTPREQUEST=(\d+)/,"X-NEBULAXMLHTTPREQUEST="+r),t.setAttribute("action",o.protocol+"//"+o.host+o.pathname+a+o.hash)):t.setAttribute("action",o.protocol+"//"+o.host+o.pathname+o.search+"&X-NEBULAXMLHTTPREQUEST="+r+o.hash)}else t.setAttribute("action",o.protocol+"//"+o.host+o.pathname+"?X-NEBULAXMLHTTPREQUEST="+r+o.hash)}t.setAttribute("data-nebulaId",r)}}var d,p=(d=FormData,window.originFormData=d,function(e){this.realFormData=new d(e),e&&(this.targetForm=e),this.appendData=[]});p.prototype.constructor=window.originFormData,p.prototype.append=function(e,t,r){this.appendData.push({name:e,value:t,fileName:r})},FormData=p;var y={},m="msgRequestUrl",b="type",v={cacheMessage:function(t,r,n,o,a){e===a&&(y[o]={msgId:o,callBack:function(){var e=t;try{return r.apply(e,n)}catch(e){c(e)}}},setTimeout(function(){v.triggerMessageCallBack(o,a)},500))},triggerMessageCallBack:function(t,r){e===r&&y[t]&&(y[t].callBack(),delete y[t])},addFormExtraInfoToElement:function(t,r){if(e===r){var n={};n[b]="FormElement",n.msgKt=r;var a=function(e){if(e&&e.nodeType){for(var t=e;t;){if("form"===t.nodeName.toLowerCase())return t;if(t===document||t===document.documentElement||t===document.body)break;t=t.parentNode}return null}}(t||document.activeElement);if(f(a))return;if(a){var i=a.getAttribute("data-nebulaId"),l=a.getAttribute("action"),h=s(a,!1);return Promise.all(h.map(function(e){return u(e)})).then(function(e){n.msgId=i,n.val=e,n[b]="FormElement",n.FormEnctype=a.enctype,n.AcceptCharset=a.acceptCharset,n.DocumentCharset=document.charset,n[m]=l,o(n)}).catch(function(e){c(e)}),i}}},updateCookies:void 0};window.NebulaXMLHttpRequestMessageBridge=v,Object.freeze(window.NebulaXMLHttpRequestMessageBridge),Object.defineProperty(window,"NebulaXMLHttpRequestMessageBridge",{configurable:!1,writable:!1});var E,w,g=function(e){return"^^^^"+e+"^^^^"},T=["POST","PUT","DELETE","PATCH"],A=/\^\^\^\^(\d+)\^\^\^\^/;XMLHttpRequest.prototype.open=(E=XMLHttpRequest.prototype.open,function(e,t,r,n,o){var a=[].slice.call(arguments),i=!0;a.length>2&&(i=!!a[2]),this.requestAsync=i;var s=+new Date+""+Math.round(1e5*Math.random());if(this.requestId=s,e&&T.indexOf(e.toUpperCase())>-1){var u=document.createElement("a");u.href=t,A.test(u.hash)?u.hash=u.hash.replace(A,g(s)):u.hash&&u.hash.length>0?u.hash=u.hash+g(s):u.hash=g(s),t=u.href}return this.requestUrl=t,a[1]=t,E.apply(this,a)}),XMLHttpRequest.prototype.send=(w=XMLHttpRequest.prototype.send,function(t){var r,n,a,i=this.requestId,f={},h=this,d=[].slice.call(arguments);if(f.msgId=i,f.msgKt=e,f.msgMainUrl=document.location.href,f[m]=this.requestUrl,!t)return w.apply(this,d);if("string"==typeof t&&t.length>0)f.val=t,f[b]="String",o(f);else if(t instanceof Blob){if(f[b]="Blob",this.requestAsync)return r=t,n=function(t){f.val=t,o(f),v.cacheMessage(h,w,d,i,e)},(a=new FileReader).onload=function(e){var t=e.target.result;n(t)},void a.readAsDataURL(r);f.error="NOTSUPPORT",o(f)}else if(t instanceof FormData){if(f[b]="FormData",this.requestAsync){f[b]="FormData";var p=t.appendData;return t.targetForm&&(p=p.concat(s(t.targetForm,!0))),void Promise.all(p.map(function(e){return u(e)})).then(function(r){f.val=r,o(f),v.cacheMessage(h,w,t.realFormData,i,e)}).catch(function(e){c(e)})}f.error="NOTSUPPORT",o(f)}else if(t.nodeType)f[b]="Document",t===document?f.val=(new XMLSerializer).serializeToString(document):f.val=t.toString(),o(f);else if(t instanceof ArrayBuffer)f.val=l(t),f[b]="ArrayBuffer",o(f);else{if(!t.buffer)return w.apply(this,d);f.val=l(t.buffer),f[b]="ArrayBuffer",o(f)}return this.requestAsync?v.cacheMessage(h,w,d,i,e):w.apply(this,d)});var B,L={};window.lastClickElement=null,document.addEventListener("DOMContentLoaded",function(){!function(){for(var t=[].slice.call(document.querySelectorAll("form")),r=t.length-1;r>=0;r--)h(t[r]),t[r].addEventListener("submit",function(t){v.addFormExtraInfoToElement(t.target,e)},!1)}(),document.addEventListener("change",function(e){var t=e.target;if(t.nodeName&&t.nodeName.toLowerCase()&&t.type&&"file"===t.type)for(var r=t,n=0;n<r.files.length;n++)!function(e){u({name:r.name,value:e}).then(function(t){L[r.name]||(L[r.name]=[]),L[r.name].push({name:r.name,value:t.value,fileName:e.name})}).catch(function(e){c(e)})}(r.files[n])},!1),document.addEventListener("click",function(e){window.lastClickElement=e.target},!0)},!1),HTMLFormElement.prototype.submit=(B=HTMLFormElement.prototype.submit,function(){var t=[].slice.call(arguments);s(this,!1),h(this),window.lastClickElement=this,v.addFormExtraInfoToElement(this,e),B.apply(this,t)})}()}(); |
New file |
| | |
| | | /* |
| | | * NSDate+WVUtility.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | /** |
| | | * 提供 NSDate 类的扩展方法。 |
| | | */ |
| | | @interface NSDate (WVUtility) |
| | | |
| | | /** |
| | | * 获取自 1970 年 1 月 1 日以来的秒数。 |
| | | */ |
| | | + (NSTimeInterval)wvcurrentTimeInterval; |
| | | |
| | | /** |
| | | * 获取自 1970 年 1 月 1 日以来的毫秒数。 |
| | | */ |
| | | + (double)wvCurrentMilliseconds; |
| | | |
| | | /** |
| | | * 将指定的 RFC 1123 格式时间字符串转换为对应的 NSDate。 |
| | | * RFC 1123 的时间格式为 EEE, dd MMM yyyy HH:mm:ss zzz。 |
| | | */ |
| | | + (NSDate *)wvDateWithRFC1123String:(NSString *)date; |
| | | |
| | | /** |
| | | * 将指定的 RFC 6265 格式时间字符串(Cookie 时间)转换为对应的 NSDate。 |
| | | * RFC 6265 的时间格式为一套算法:https://tools.ietf.org/html/rfc6265#section-5.1.1。 |
| | | */ |
| | | + (NSDate *)wvDateWithRFC6265String:(NSString *)date; |
| | | |
| | | /** |
| | | * 获取当前日期自 1970 年 1 月 1 日以来的毫秒数。 |
| | | * |
| | | * @return 当前日期自 1970 年 1 月 1 日以来的毫秒数。 |
| | | */ |
| | | - (double)wvMillisecondsSince1970; |
| | | |
| | | /** |
| | | * 获取此日期自当前时间以来的毫秒数。 |
| | | * 如果此日期早于当前时间,那么会返回负数。 |
| | | * |
| | | * @return 此日期自当前时间以来的毫秒数。 |
| | | */ |
| | | - (double)wvMillisecondsSinceNow; |
| | | |
| | | /** |
| | | * 返回当前日期的年份。 |
| | | */ |
| | | - (NSInteger)wvGetYear; |
| | | |
| | | /** |
| | | * 将当前 NSDate 转换为对应的 ISO 8601 格式日期字符串。 |
| | | * ISO 8601 的日期格式为 yyyy-MM-dd。 |
| | | */ |
| | | - (NSString *)wvStringWithISO8601Format; |
| | | |
| | | /** |
| | | * 将当前 NSDate 转换为对应的 RFC 1123 格式日期字符串。 |
| | | * RFC 1123 的时间格式为 EEE, dd MMM yyyy HH:mm:ss zzz。 |
| | | */ |
| | | - (NSString *)wvStringWithRFC1123Format; |
| | | |
| | | #pragma mark - Date Marking |
| | | |
| | | /** |
| | | * 标记当前时间。 |
| | | * |
| | | * @param token 当前时间的标记。 |
| | | */ |
| | | + (void)wvMarkNow:(NSString *)token; |
| | | |
| | | /** |
| | | * 检查与上一次标记是否已达到指定时间间隔。 |
| | | * |
| | | * @param token 时间的标记。 |
| | | * @param interval 时间间隔。 |
| | | * |
| | | * @return 如果与上一次标记已达到指定时间间隔,则为 YES;若标记不存在或未达到指定时间间隔,则为 NO。 |
| | | */ |
| | | + (BOOL)wvCheckMark:(NSString *)token withInterval:(NSTimeInterval)interval; |
| | | |
| | | /** |
| | | * 检查与上一次标记是否已达到指定时间间隔,如果已达到,则自动重新标记。 |
| | | * |
| | | * @param token 时间的标记。 |
| | | * @param interval 时间间隔。 |
| | | * |
| | | * @return 如果与上一次标记已达到指定时间间隔,则为 YES;若标记不存在或未达到指定时间间隔,则为 NO。 |
| | | */ |
| | | + (BOOL)wvCheckAndMark:(NSString *)token withInterval:(NSTimeInterval)interval; |
| | | |
| | | @end |
| | | |
| | | /** |
| | | * 返回当前时间自 1970 年 1 月 1 日以来的秒数。 |
| | | */ |
| | | NS_INLINE NSTimeInterval currentTimeInterval() { |
| | | return [NSDate wvcurrentTimeInterval]; |
| | | } |
| | | |
| | | /** |
| | | * 返回当前时间自 1970 年 1 月 1 日以来的毫秒数。 |
| | | */ |
| | | NS_INLINE double currentMilliseconds() { |
| | | return [NSDate wvCurrentMilliseconds]; |
| | | } |
| | | |
| | | /** |
| | | * 返回指定 NSTimeInterval 的毫秒表示。 |
| | | */ |
| | | NS_INLINE double toMilliseconds(NSTimeInterval timeInterval) { |
| | | return timeInterval * 1000.0; |
| | | } |
| | | |
| | | /** |
| | | * 返回指定毫秒的 NSTimeInterval 表示。 |
| | | */ |
| | | NS_INLINE double toTimeInterval(double milliseconds) { |
| | | return milliseconds / 1000.0; |
| | | } |
| | | |
| | | /** |
| | | * 返回指定 NSTimeInterval 之间相差的毫秒数。 |
| | | */ |
| | | NS_INLINE double millisecondsBetween(NSTimeInterval fromTime, NSTimeInterval toTime) { |
| | | return toMilliseconds(fromTime - toTime); |
| | | } |
| | | |
| | | /** |
| | | * 返回当前时间与指定 NSTimeInterval 之间相差的毫秒数。 |
| | | */ |
| | | NS_INLINE double millisecondsFromNowTo(NSTimeInterval toTime) { |
| | | return toMilliseconds([NSDate wvcurrentTimeInterval] - toTime); |
| | | } |
New file |
| | |
| | | /* |
| | | * NSMutableArray+WVUtility.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | /** |
| | | * 包含 NSMutableArray 的扩展方法。 |
| | | */ |
| | | @interface NSMutableArray (WVUtility) |
| | | |
| | | /** |
| | | 将指定可能为空的元素添加到数组中。 |
| | | |
| | | @param value 可为空的元素。 |
| | | */ |
| | | - (void)wvAddNullable:(id _Nullable)value; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * WVAssert.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | #import <WindVaneCore/WVCommonUtil.h> |
| | | |
| | | #define WVAssert(condition, ...) \ |
| | | do { \ |
| | | if (WV_DEBUG && (condition) == 0) { \ |
| | | [[NSAssertionHandler currentHandler] handleFailureInFunction:@(__func__) \ |
| | | file:@(__FILE__) \ |
| | | lineNumber:__LINE__ \ |
| | | description:__VA_ARGS__]; \ |
| | | } \ |
| | | } while (false) |
| | | |
| | | /** |
| | | * 检查参数是否存在。 |
| | | */ |
| | | #define WVAssertParam(name) WVAssert(name, @"Parameter '%s' is required", #name) |
| | | |
| | | /** |
| | | * 检查实例是否满足指定类型。 |
| | | */ |
| | | #define WVAssertClass(variable, className) WVAssert([variable isKindOfClass:[className class]], \ |
| | | @"Variable '%s' is not a kind of '%s' class", #variable, #className) |
| | | |
| | | /** |
| | | * 检查实例是否满足指定类型。 |
| | | */ |
| | | #define WVAssertProtocol(variable, protocolName) WVAssert([variable conformsToProtocol:@protocol(protocolName)], \ |
| | | @"Variable '%s' does not conform to protocol '%s'", #variable, #protocolName) |
| | | |
| | | /** |
| | | * 检查是否是在主线程。 |
| | | */ |
| | | #define WVAssertMainThread() WVAssert([NSThread isMainThread], @"Must be called on the main thread") |
| | | |
| | | /** |
| | | * 检查是否为非空字符串。 |
| | | */ |
| | | #define WVAssertNotEmptyString(str) WVAssert(str && str.length, @"Parameter '%s' is nil or empty string", #str) |
| | | |
| | | /** |
| | | * 检查是否不为 nil。 |
| | | */ |
| | | #define WVAssertNotNil(variable) WVAssert(variable != nil, @"Parameter '%s' is nil", #variable) |
New file |
| | |
| | | // |
| | | // WVCachedKey.h |
| | | // Basic |
| | | // |
| | | // Created by lianyu.ysj on 2018/1/18. |
| | | // Copyright © 2018年 WindVane. All rights reserved. |
| | | // |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | // 将一些用到的私有 API 统一加密 |
| | | |
| | | // 锁屏的事件,为了在 iOS8 上对 WebGL 做保护,需要监听锁屏事件 |
| | | #define WV_CACHEDKEY_SCREENLOCK (wvGetKey(0)) |
| | | // WKBrowsingContextController 类,为了另 WKWebView 支持 NSURLProtocol 拦截,需要用到这个类 |
| | | #define WV_CACHEDKEY_WKBROWSINGCONTEXTCONTROLLER (wvGetKey(1)) |
| | | // 注册自定义 scheme 到 WKWebView |
| | | #define WV_CACHEDKEY_REGISTERWKSCHEME (wvGetSelector(2)) |
| | | // 反注册自定义 scheme 到 WKWebView |
| | | #define WV_CACHEDKEY_UNREGISTERWKSCHEME (wvGetSelector(3)) |
| | | // 设置 WKWebView 的 SafeArea 行为 |
| | | #define WV_CACHEDKEY_WKSAFEAREAEDGE (wvGetSelector(4)) |
| | | // 获取 UIWebView 的内部 WebView |
| | | #define WV_CACHEDKEY_UIINTERNALWEBVIEW (wvGetKey(5)) |
| | | // 获取 WebView 是否开启 WebGL |
| | | #define WV_CACHEDKEY_GETWEBGLENABLED (wvGetSelector(6)) |
| | | // 设置 WebView 是否开启 WebGL |
| | | #define WV_CACHEDKEY_SETWEBGLENABLED (wvGetSelector(7)) |
| | | // 设置 WebView 是否记录历史记录 |
| | | #define WV_CACHEDKEY_SETMAINTAINSBACKFORWARDLIST (wvGetSelector(8)) |
| | | // UIWebOverflowScrollView 类,为了清空内容以避免 crash |
| | | #define WV_CACHEDKEY_UIWEBVIEWSCROLLVIEW (wvGetKey(9)) |
| | | // WebView 的导航方法 |
| | | #define WV_CACHEDKEY_WEBVIEW_DECIDEACTION (wvGetSelector(10)) |
| | | // WebView 开始加载 |
| | | #define WV_CACHEDKEY_WEBVIEW_STARTLOAD (wvGetSelector(11)) |
| | | // WebView 结束加载 |
| | | #define WV_CACHEDKEY_WEBVIEW_FINISHLOAD (wvGetSelector(12)) |
| | | // WebView 加载失败 |
| | | #define WV_CACHEDKEY_WEBVIEW_FAILPROVISIONALLOAD (wvGetSelector(13)) |
| | | // WebView 加载失败 |
| | | #define WV_CACHEDKEY_WEBVIEW_FAILLOAD (wvGetSelector(14)) |
| | | // WebView title 发生改变 |
| | | #define WV_CACHEDKEY_WEBVIEW_RECEIVETITLE (wvGetSelector(15)) |
| | | // UIWebViewWebViewDelegate 类 |
| | | #define WV_CACHEDKEY_UIWEBVCIEWDELEGATE (wvGetKey(16)) |
| | | // WebView 创建 JavaScriptContext |
| | | #define WV_CACHEDKEY_WEBVIEW_CREATEJSCONTEXT (wvGetSelector(17)) |
| | | // 发送同步 XHR 时,NSURLProtocol 的线程 RunLoopMode,为了避免 WebThread 没有响应 |
| | | #define WV_CACHEDKEY_SYNC_RUNLOOPMODE (wvGetKey(18)) |
| | | // WKWebView 的 NSURLProtocol 拦截加载器。 |
| | | #define WV_CACHEDKEY_WK_CUSTOM_PROTOCOL_LOADER (wvGetKey(19)) |
| | | // WKWebView 的 ScrollView 类型。 |
| | | #define WV_CACHEDKEY_WKSCROLLVIEW (wvGetKey(20)) |
| | | // WKWebView 的内容 View。 |
| | | #define WV_CACHEDKEY_WKCONTENTVIEW (wvGetKey(21)) |
| | | // 唤起键盘前的校验方法。 |
| | | #define WV_CACHEDKEY_WEBVIEW_KEYBOARD (wvGetSelector(22)) |
| | | // 唤起键盘前的旧校验方法。 |
| | | #define WV_CACHEDKEY_WEBVIEW_KEYBOARD_OLD (wvGetSelector(23)) |
| | | // iOS 12.2 唤起键盘的方法。 |
| | | #define WV_CACHEDKEY_WEBVIEW_KEYBOARD_12_2 (wvGetSelector(24)) |
| | | |
| | | /** |
| | | 返回指定索引的 Key。 |
| | | |
| | | @param index CachedKey 的索引。 |
| | | @return 指定索引的 CachedKey。 |
| | | */ |
| | | NSString * _Nullable wvGetKey(NSUInteger index); |
| | | |
| | | /** |
| | | 返回指定索引的 CachedKey 对应的 SEL。 |
| | | |
| | | @param index CachedKey 的索引。 |
| | | @return 指定索引的 CachedKey 对应的 SEL。 |
| | | */ |
| | | SEL _Nullable wvGetSelector(NSUInteger index); |
New file |
| | |
| | | // |
| | | // WVCommonWebView.h |
| | | // WindVaneBasic |
| | | // |
| | | // Created by lianyu.ysj on 15/3/19. |
| | | // Copyright (c) 2015年 WindVane. All rights reserved. |
| | | // |
| | | |
| | | #import <WindVaneCore/WVNavigation.h> |
| | | #import <WindVaneCore/WVPageMeta.h> |
| | | #import <WindVaneCore/WVWebViewProtocol.h> |
| | | #import <Foundation/Foundation.h> |
| | | #import <WebKit/WebKit.h> |
| | | #import <WindVaneCore/WVJSONKit.h> |
| | | |
| | | // WVWebView 通过 loadRequest 加载的请求的键,这样的请求总是认为主页面。 |
| | | FOUNDATION_EXPORT NSString * const WVWebViewLoadRequestKey; |
| | | // WVWebView 中表示是 mainFrame 的键,用于与 swizzle 失效的情况区分开来。 |
| | | FOUNDATION_EXPORT NSString * const WVWebViewMainFrameKey; |
| | | |
| | | @interface WVCommonWebView : NSObject <WKNavigationDelegate> |
| | | |
| | | #pragma mark - Init |
| | | |
| | | /** |
| | | * 使用指定的 WebView 初始化。 |
| | | */ |
| | | - (instancetype)initWithWebView:(UIView<WVWebViewProtocol> *)webview; |
| | | |
| | | #pragma mark - Configuration |
| | | |
| | | /** |
| | | * WebView 标识符。 |
| | | */ |
| | | @property (nonatomic, copy) NSString * identifier; |
| | | |
| | | /** |
| | | * 关联到的 ViewController。 |
| | | */ |
| | | @property (nonatomic, weak) UIViewController * sourceViewController; |
| | | |
| | | /** |
| | | * WebView 在 ViewController 中的可见性。 |
| | | */ |
| | | @property (nonatomic, assign) WVWebViewVisiblity visibleInViewController; |
| | | |
| | | /** |
| | | WKWebView 的NavigationDelegate 模式。 |
| | | */ |
| | | @property (nonatomic, assign) BOOL navigationDelegateMode; |
| | | |
| | | /** |
| | | * 是否允许 WebKit 长按事件(选择、弹出菜单),默认为 YES。 |
| | | */ |
| | | @property (nonatomic, assign, getter=isOpenWebKitLongPress) BOOL openWebKitLongPress; |
| | | |
| | | /** |
| | | * 是否允许长按保存图片,默认为 YES。 |
| | | */ |
| | | @property (nonatomic, assign, getter=isOpenLongPressSaveImage) BOOL openLongPressSaveImage; |
| | | |
| | | /** |
| | | * 是否启用下拉刷新,默认为 NO。 |
| | | */ |
| | | @property (nonatomic, assign, getter=isUsePullToRefresh) BOOL usePullToRefresh; |
| | | |
| | | /** |
| | | * 是否具有弹性效果。 |
| | | */ |
| | | @property (nonatomic, assign) BOOL bounces; |
| | | |
| | | #pragma mark - Content |
| | | |
| | | /** |
| | | * 当前 frame 标识,供 WVWebView 设置使用。 |
| | | * 如果状态未知,则为 nil;如果是主页面,则使用 WVWebViewMainFrameKey 表示。 |
| | | */ |
| | | @property (nonatomic, copy) NSString * frameId; |
| | | |
| | | /** |
| | | * 当前导航信息,仅在 WVWebViewDelegate 的回调中生效。 |
| | | */ |
| | | @property (nonatomic, strong, readonly) WVNavigation * navigation; |
| | | |
| | | /** |
| | | 首次加载的请求,用于在首次加载失败后 reload 时使用。 |
| | | */ |
| | | @property (nonatomic, strong, readonly) NSURLRequest * firstLoadRequest; |
| | | |
| | | /** |
| | | * 主页面导航信息,页面可能未加载、加载中或已加载。 |
| | | */ |
| | | @property (nonatomic, strong, readonly) WVNavigation * mainNavigation; |
| | | |
| | | /** |
| | | * WebView 的可见性,会由 ViewController 的可见性和 WebView 在 ViewController 中的可见性综合计算得到。 |
| | | * |
| | | * @discussion 该属性支持 KVO。 |
| | | */ |
| | | @property (nonatomic, assign, readonly) WVWebViewVisiblity visiblity; |
| | | |
| | | /** |
| | | * WebView 当前页面内容是否为空,该属性并不会实时反应页面的白屏状况,实时信息请使用 [WebView isPageEmpty:] 方法。 |
| | | */ |
| | | @property (nonatomic, assign, getter=isPageEmpty) WVTristate pageEmpty; |
| | | |
| | | /** |
| | | * 检查 WebView 的页面是否为空。 |
| | | * |
| | | * @param callback 检查结果的回调。 |
| | | */ |
| | | - (void)isPageEmpty:(void (^)(BOOL isPageEmpty))callback; |
| | | |
| | | /** |
| | | 当前页面的 viewport-fit 设置。 |
| | | */ |
| | | @property (nonatomic, assign, readonly) WVWebViewViewportFit viewportFit; |
| | | |
| | | #pragma mark - Delegate |
| | | |
| | | /** |
| | | * WindVane 代理。 |
| | | */ |
| | | @property (nonatomic, weak) id<WVWebViewDelegate> windVaneDelegate; |
| | | |
| | | #pragma mark - Request |
| | | |
| | | /** |
| | | * 估计的加载进度。 |
| | | */ |
| | | @property (nonatomic, assign, readonly) double estimatedProgress; |
| | | |
| | | #pragma mark - WVWebViewDelegate |
| | | |
| | | /** |
| | | * 在加载指定请求之前调用。 |
| | | * |
| | | * @return 如果要加载指定的请求,则返回 YES;否则返回 NO。 |
| | | */ |
| | | - (BOOL)webView:(UIView<WVWebViewProtocol> *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(WKNavigationType)navigationType; |
| | | |
| | | /** |
| | | * 在开始加载新页面前调用。 |
| | | */ |
| | | - (void)webViewDidStartLoad:(UIView<WVWebViewProtocol> *)webView; |
| | | |
| | | /** |
| | | * 在页面加载完毕后调用。 |
| | | */ |
| | | - (void)webViewDidFinishLoad:(UIView<WVWebViewProtocol> *)webView; |
| | | |
| | | /** |
| | | * 在页面加载失败时调用。 |
| | | */ |
| | | - (void)webView:(UIView<WVWebViewProtocol> *)webView didFailLoadWithError:(NSError *)error; |
| | | |
| | | #pragma mark - Life cycle |
| | | |
| | | /** |
| | | * [注意:必须在 ViewController 的 viewWillDisappear 中调用!!!] 释放 WebView 的服务。 |
| | | */ |
| | | - (void)releaseWebViewService; |
| | | |
| | | /** |
| | | * [注意:必须在 ViewController 的 viewWillAppear 中调用!!!] 重新绑定 WebView 的服务。 |
| | | */ |
| | | - (void)bindingWebViewService; |
| | | |
| | | #pragma mark - Navigation |
| | | |
| | | /** |
| | | * 发送 WindVaneReady 事件。 |
| | | */ |
| | | + (void)sendWindVaneReadyEvent:(UIView<WVWebViewBasicProtocol> *)webview; |
| | | |
| | | #pragma mark - View |
| | | |
| | | /** |
| | | * 返回是否支持 SVPullToRefresh。 |
| | | */ |
| | | + (BOOL)isSupportSVPullToRefresh; |
| | | |
| | | /** |
| | | SafeArea 发生变化后,重新调整 contentInset。 |
| | | */ |
| | | - (void)safeAreaInsetsDidChange; |
| | | |
| | | @end |
New file |
| | |
| | | // |
| | | // WVHttpUtil+WVPrivate.h |
| | | // Core |
| | | // |
| | | // Created by lianyu.ysj on 16/8/3. |
| | | // Copyright © 2016年 WindVane. All rights reserved. |
| | | // |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | // 网络库 Http 头。 |
| | | FOUNDATION_EXPORT NSString * _Nonnull const WVHttpHeaderFRefer; |
| | | FOUNDATION_EXPORT NSString * _Nonnull const WVHttpHeaderProtocolType; |
| | | |
| | | // 私有 Http 头。 |
| | | FOUNDATION_EXPORT NSString * _Nonnull const WVHttpHeaderZCacheMonitor; |
| | | FOUNDATION_EXPORT NSString * _Nonnull const WVHttpHeaderZCacheInfo; |
| | | FOUNDATION_EXPORT NSString * _Nonnull const WVHttpHeaderZCacheVerifyTime; |
| | | |
New file |
| | |
| | | /* |
| | | * WVInjector.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2014年 阿里巴巴-无线事业部. All rights reserved. |
| | | */ |
| | | |
| | | #import <WindVaneCore/WVAssert.h> |
| | | #import <pthread.h> |
| | | |
| | | #pragma mark - STATIC_SYNC_PROP |
| | | |
| | | /** |
| | | * 定义静态同步属性。 |
| | | * |
| | | * @param NAME 属性的名称。 |
| | | */ |
| | | #define WV_DEFINE_STATIC_SYNC_PROP(NAME, TYPE) \ |
| | | static pthread_mutex_t _mutex_##NAME = PTHREAD_MUTEX_INITIALIZER; \ |
| | | static TYPE _##NAME; |
| | | |
| | | /** |
| | | * 设置静态同步属性。 |
| | | * |
| | | * @param NAME 属性的名称。 |
| | | * @param VALUE 属性的值。 |
| | | */ |
| | | #define WV_SET_SYNC_PROP(NAME, VALUE) \ |
| | | do { \ |
| | | pthread_mutex_lock(&_mutex_##NAME); \ |
| | | _##NAME = VALUE; \ |
| | | pthread_mutex_unlock(&_mutex_##NAME); \ |
| | | } while (false) |
| | | |
| | | #define WV_ADD_SYNC_PROP_IMPL(NAME, MUTABLE_TYPE, FACTORY, VALUE, L) ({ \ |
| | | BOOL __NSX_PASTE__(__r, L) = NO; \ |
| | | __typeof__(VALUE) __NSX_PASTE__(__value, L) = (VALUE); \ |
| | | pthread_mutex_lock(&_mutex_##NAME); \ |
| | | if (![_##NAME containsObject:__NSX_PASTE__(__value, L)]) { \ |
| | | MUTABLE_TYPE * __NSX_PASTE__(__arr, L) = [MUTABLE_TYPE FACTORY:_##NAME]; \ |
| | | __NSX_PASTE__(__r, L) = YES; \ |
| | | [__NSX_PASTE__(__arr, L) addObject:__NSX_PASTE__(__value, L)]; \ |
| | | _##NAME = __NSX_PASTE__(__arr, L); \ |
| | | } \ |
| | | pthread_mutex_unlock(&_mutex_##NAME); \ |
| | | __NSX_PASTE__(__r, L); \ |
| | | }) |
| | | |
| | | /** |
| | | * 向静态同步数组添加值。 |
| | | * |
| | | * @param NAME 属性的名称。 |
| | | * @param VALUE 要添加的值。 |
| | | */ |
| | | #define WV_ADD_SYNC_ARRAY(NAME, VALUE) WV_ADD_SYNC_PROP_IMPL(NAME, NSMutableArray, arrayWithArray, VALUE, __COUNTER__) |
| | | |
| | | /** |
| | | * 向静态同步集合添加值。 |
| | | * |
| | | * @param NAME 属性的名称。 |
| | | * @param VALUE 要添加的值。 |
| | | */ |
| | | #define WV_ADD_SYNC_SET(NAME, VALUE) WV_ADD_SYNC_PROP_IMPL(NAME, NSMutableSet, setWithSet, VALUE, __COUNTER__) |
| | | |
| | | #define WV_REMOVE_SYNC_PROP_IMPL(NAME, MUTABLE_TYPE, FACTORY, VALUE, L) ({ \ |
| | | __typeof__(VALUE) __NSX_PASTE__(__value, L) = (VALUE); \ |
| | | pthread_mutex_lock(&_mutex_##NAME); \ |
| | | if ([_##NAME containsObject:__NSX_PASTE__(__value, L)]) { \ |
| | | MUTABLE_TYPE * __NSX_PASTE__(__arr, L) = [MUTABLE_TYPE FACTORY:_##NAME]; \ |
| | | [__NSX_PASTE__(__arr, L) removeObject:__NSX_PASTE__(__value, L)]; \ |
| | | _##NAME = __NSX_PASTE__(__arr, L); \ |
| | | } \ |
| | | pthread_mutex_unlock(&_mutex_##NAME); \ |
| | | }) |
| | | |
| | | /** |
| | | * 从静态同步数组移除值。 |
| | | * |
| | | * @param NAME 属性的名称。 |
| | | * @param VALUE 要移除的值。 |
| | | */ |
| | | #define WV_REMOVE_SYNC_ARRAY(NAME, VALUE) WV_REMOVE_SYNC_PROP_IMPL(NAME, NSMutableArray, arrayWithArray, VALUE, __COUNTER__) |
| | | |
| | | #define WV_GET_SYNC_PROP_IMPL(NAME, L) ({ \ |
| | | __typeof__(_##NAME) __NSX_PASTE__(__x, L); \ |
| | | pthread_mutex_lock(&_mutex_##NAME); \ |
| | | __NSX_PASTE__(__x, L) = _##NAME; \ |
| | | pthread_mutex_unlock(&_mutex_##NAME); \ |
| | | __NSX_PASTE__(__x, L); \ |
| | | }) |
| | | |
| | | /** |
| | | * 获取静态同步属性。 |
| | | * |
| | | * @param NAME 属性的名称。 |
| | | */ |
| | | #define WV_GET_SYNC_PROP(NAME) WV_GET_SYNC_PROP_IMPL(NAME, __COUNTER__) |
| | | |
| | | /** |
| | | * 定义一对实例注入方法。 |
| | | * |
| | | * @param NAME 实例注入方法的名称,会自动添加 register/registered 前缀。 |
| | | * @param PROTOCOL 实例要实现的协议。 |
| | | */ |
| | | #define WV_INJECTION_DEFINE(NAME, PROTOCOL) \ |
| | | WV_DEFINE_STATIC_SYNC_PROP(NAME, id<PROTOCOL>) \ |
| | | +(void)register##NAME : (id<PROTOCOL>)handler { \ |
| | | if (!handler) { \ |
| | | return; \ |
| | | } \ |
| | | WVAssertProtocol(handler, PROTOCOL); \ |
| | | WV_SET_SYNC_PROP(NAME, handler); \ |
| | | } \ |
| | | +(id<PROTOCOL>)registered##NAME { \ |
| | | return WV_GET_SYNC_PROP(NAME); \ |
| | | } |
New file |
| | |
| | | // |
| | | // WVPrivateConstant.h |
| | | // Core |
| | | // |
| | | // Created by lianyu.ysj on 16/3/14. |
| | | // Copyright © 2016年 WindVane. All rights reserved. |
| | | // |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | // 【慎用】忽略指定名称的集团 iOS 开发规约扫描规则,由 @晨燕 提供。 |
| | | #define WV_IGNORE_CHECKER(RULE_NAME) __attribute__((annotate("IgnoreChecker:" #RULE_NAME))) |
| | | |
| | | #pragma mark - Notification |
| | | |
| | | // 表示更新完毕的配置名称的键。 |
| | | FOUNDATION_EXPORT NSString * _Nonnull const WVConfigNameKey; |
| | | |
| | | /** |
| | | * 特定配置更新完毕的通知。 |
| | | * @WVConfigNameKey 更新完毕的配置名称。 |
| | | */ |
| | | FOUNDATION_EXPORT NSString * _Nonnull const WVConfigUpdateFinishedNotification; |
New file |
| | |
| | | // |
| | | // WVURLProtocolProcessor.h |
| | | // Core |
| | | // |
| | | // Created by lianyu on 2019/4/24. |
| | | // Copyright © 2019 WindVane. All rights reserved. |
| | | // |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | /** |
| | | WVURLProtocol 的处理器,目前仅用于 Ariver。 |
| | | */ |
| | | @protocol WVURLProtocolProcessor <NSObject> |
| | | |
| | | @required |
| | | |
| | | + (BOOL)canInitWithRequest:(NSURLRequest * _Nonnull)request; |
| | | - (instancetype _Nonnull)initWithRequest:(NSURLRequest * _Nonnull)request cachedResponse:(NSCachedURLResponse * _Nonnull)cachedResponse client:(id<NSURLProtocolClient> _Nonnull)client; |
| | | - (void)startLoading; |
| | | - (void)stopLoading; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * WVURLProtocolService.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2014年 阿里巴巴-无线事业部. All rights reserved. |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | #import <WindVaneCore/WVURLProtocolService.h> |
| | | #import "WVURLProtocolProcessor.h" |
| | | |
| | | /** |
| | | CacheHandler 的 userInfo 中保存额外 header 的键。 |
| | | */ |
| | | FOUNDATION_EXPORT NSString * const WVURLProtocolExternalHeadersKey; |
| | | |
| | | /** |
| | | 缓存的来源的键。 |
| | | */ |
| | | FOUNDATION_EXPORT NSString * const WVURLProtocolCacheFromTypeKey; |
| | | |
| | | /** |
| | | * WVURLProtocol 的数据来源。 |
| | | */ |
| | | typedef NS_ENUM(NSInteger, WVURLProtocolReadFromType) { |
| | | /** |
| | | * 走网络。 |
| | | */ |
| | | WVURLProtocolReadFromNetwork = 1, |
| | | /** |
| | | * 走内存缓存。 |
| | | */ |
| | | WVURLProtocolReadFromMemoryCache = 22, |
| | | /** |
| | | * 走磁盘缓存。 |
| | | */ |
| | | WVURLProtocolReadFromDiskCache = 23, |
| | | // 预加载来源 |
| | | // 来自 PackageApp。 |
| | | // ZCacheResourceFromPackageApp = 3, |
| | | // 来自 ZCache 1.0。 |
| | | // ZCacheResourceFromZCache1 = 4, |
| | | // 来自解 Combo。 |
| | | // ZCacheResourceFromCombo = 8, |
| | | // 来自 ZCache 2.0。 |
| | | // ZCacheResourceFromZCache2 = 9, |
| | | }; |
| | | |
| | | /** |
| | | * WVURLProtocolService 的私有方法。 |
| | | */ |
| | | @interface WVURLProtocolService (WVPrivate) |
| | | |
| | | #pragma mark - Scheme |
| | | |
| | | /** |
| | | * 注册会被拦截的 Scheme。 |
| | | * |
| | | * @param scheme 会被拦截的 Scheme。 |
| | | */ |
| | | + (void)registerScheme:(NSString *)scheme; |
| | | |
| | | /** |
| | | * 返回指定请求的 Scheme 是否会被拦截。 |
| | | */ |
| | | + (BOOL)containsScheme:(NSURLRequest *)request; |
| | | |
| | | #pragma mark - Rewriter |
| | | |
| | | /** |
| | | * 重写指定的请求,后注册的重写器会先被调用。 |
| | | */ |
| | | + (BOOL)rewrite:(NSMutableURLRequest *)request; |
| | | |
| | | #pragma mark - UserAgent |
| | | |
| | | /** |
| | | * 返回指定请求是否包含 UserAgent 标记。 |
| | | * |
| | | * @param request 要检查的请求。 |
| | | * @param checkCustom 是否检查自定义 UserAgent 标记。 |
| | | */ |
| | | + (BOOL)containsUserAgentMark:(NSURLRequest *)request checkCustom:(BOOL)checkCustom; |
| | | |
| | | #pragma mark - PageRequest |
| | | |
| | | /** |
| | | * 将指定请求标记为页面 URL。 |
| | | */ |
| | | + (void)markAsPageURL:(NSString *)urlString; |
| | | |
| | | /** |
| | | * 返回指定的 URL 是否表示页面 URL。 |
| | | * 如果返回了 YES,就会移除此页面的标记。 |
| | | */ |
| | | + (BOOL)isPageURL:(NSString *)urlString; |
| | | |
| | | #pragma mark - WVURLProtocolProcessor |
| | | |
| | | /** |
| | | 注册指定的 URLProtocolProcessor 类,仅限 ARiver 使用。 |
| | | */ |
| | | + (void)registerURLProtocolProcessorClass:(Class<WVURLProtocolProcessor>)processorClass; |
| | | |
| | | /** |
| | | 返回注册指定的 URLProtocolProcessor 类,仅限 ARiver 使用。 |
| | | */ |
| | | + (Class<WVURLProtocolProcessor>)registeredURLProtocolProcessorClass; |
| | | |
| | | @end |
New file |
| | |
| | | // |
| | | // WVUserConfig+WVPrivate.h |
| | | // Core |
| | | // |
| | | // Created by lianyu.ysj on 2017/11/30. |
| | | // Copyright © 2017年 WindVane. All rights reserved. |
| | | // |
| | | |
| | | #import <WindVaneCore/WVUserConfig.h> |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | #define WVLocalizedString(KEY, VALUE) [WVUserConfig localizedStringForKey:(KEY) value:(VALUE)] |
| | | // 基本 |
| | | #define WVLocalizedOK WVLocalizedString(@"WV_OK", @"确定") |
| | | #define WVLocalizedCancel WVLocalizedString(@"WV_Cancel", @"取消") |
| | | // 刷新 |
| | | #define WVLocalizedPageLoading WVLocalizedString(@"WV_PageLoading", @"正在加载") |
| | | #define WVLocalizedPullToRefresh WVLocalizedString(@"WV_PullToRefresh", @"下拉即可刷新...") |
| | | #define WVLocalizedReleaseToRefresh WVLocalizedString(@"WV_ReleaseToRefresh", @"释放即可刷新...") |
| | | #define WVLocalizedPullToRefreshLoading WVLocalizedString(@"WV_PullToRefresh_Loading", @"加载中...") |
| | | // 保存图片 |
| | | #define WVLocalizedAskSaveImage WVLocalizedString(@"WV_AskSaveImage", @"保存图片?") |
| | | #define WVLocalizedSaveImage WVLocalizedString(@"WV_SaveImage", @"保存") |
| | | #define WVLocalizedSaveImageSuccess WVLocalizedString(@"WV_SaveImageSuccess", @"图片保存成功") |
| | | #define WVLocalizedSaveImageFailed WVLocalizedString(@"WV_SaveImageFailed", @"图片保存失败") |
| | | // 拍照上传 |
| | | #define WVLocalizedChoosePhotoSource WVLocalizedString(@"WV_ChoosePhotoSource", @"请选择照片来源") |
| | | #define WVLocalizedChooseCamera WVLocalizedString(@"WV_ChooseCamera", @"拍照") |
| | | #define WVLocalizedChoosePhotoLibrary WVLocalizedString(@"WV_ChoosePhotoLibrary", @"相册") |
| | | #define WVLocalizedChoosePhotoFromLibrary WVLocalizedString(@"WV_ChoosePhotoFromLibrary", @"选取照片") |
| | | #define WVLocalizedChoosePhotoLimit WVLocalizedString(@"WV_ChoosePhotoLimit", @"最多选择%lu张照片") |
| | | #define WVLocalizedChoosePhotoLimitConfirm WVLocalizedString(@"WV_ChoosePhotoLimit_Confirm", @"知道了") |
| | | // 错误信息 |
| | | #define WVLocalizedErrorNoNetwork WVLocalizedString(@"WV_ErrorNoNetwork", @"无法连接到网络") |
| | | #define WVLocalizedErrorSSLError WVLocalizedString(@"WV_ErrorSSLError", @"SSL 连接错误") |
| | | #define WVLocalizedErrorDownloadFailed WVLocalizedString(@"WV_ErrorDownloadFailed", @"下载失败") |
| | | #define WVLocalizedErrorLoadFailed WVLocalizedString(@"WV_ErrorLoadFailed", @"加载失败") |
| | | |
| | | @interface WVUserConfig (WVPrivate) |
| | | |
| | | /** |
| | | 本地化指定的文本。 |
| | | */ |
| | | + (NSString * _Nonnull)localizedStringForKey:(NSString * _Nonnull)key value:(NSString * _Nonnull)value; |
| | | |
| | | @end |
New file |
| | |
| | | // |
| | | // WVWKWebView+WVPrivate.h |
| | | // Basic |
| | | // |
| | | // Created by 郑祯 on 2019/6/25. |
| | | // Copyright © 2019 WindVane. All rights reserved. |
| | | // |
| | | |
| | | #import <WindVaneCore/WVWKWebView.h> |
| | | |
| | | /** |
| | | * WVWKWebView 的私有接口。 |
| | | */ |
| | | @interface WVWKWebView (WVPrivate) |
| | | |
| | | /** |
| | | 是否是预创建的 WebView。 |
| | | */ |
| | | @property (nonatomic, assign, getter=isPreCreate) BOOL preCreate; |
| | | |
| | | /** |
| | | 是否是预渲染的 WebView。 |
| | | */ |
| | | @property (nonatomic, assign, getter=isPreRender) BOOL preRender; |
| | | |
| | | /** |
| | | 页面发生 JS Erorr。 |
| | | */ |
| | | - (void)jsErrorOccurred; |
| | | |
| | | @end |
New file |
| | |
| | | // |
| | | // WVWebViewRecorder+WVPrivate.h |
| | | // WindVaneBasic |
| | | // |
| | | // Created by lianyu.ysj on 16/3/12. |
| | | // Copyright (c) 2015年 WindVane. All rights reserved. |
| | | // |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | #import <WindVaneCore/WVWebViewRecorder.h> |
| | | |
| | | /** |
| | | * WVWebViewRecorder 的私有接口。 |
| | | */ |
| | | @interface WVWebViewRecorder (WVPrivate) |
| | | |
| | | /** |
| | | * 返回共享的实例。 |
| | | */ |
| | | + (instancetype)sharedInstance; |
| | | |
| | | /** |
| | | * 报告打开了一个 WebView。 |
| | | */ |
| | | - (void)reportWebViewOpen:(UIView<WVWebViewProtocol> *)webView; |
| | | |
| | | /** |
| | | * 报告一个 WebView 的显示情况发生了改变。 |
| | | */ |
| | | - (void)reportVisiblityChanged:(UIView<WVWebViewProtocol> *)webView; |
| | | |
| | | /** |
| | | 报告指定 WebView 加载了 URL。 |
| | | |
| | | @param webView 加载 URL 的 WebView。 |
| | | @param url 被加载的 URL。 |
| | | */ |
| | | - (void)reportWebView:(UIView<WVWebViewProtocol> *)webView loadURL:(NSURL *)url; |
| | | |
| | | /** |
| | | * 报告关闭了一个 WebView。 |
| | | */ |
| | | - (void)reportWebViewClose:(UIView<WVWebViewProtocol> *)webView; |
| | | |
| | | /** |
| | | 同步 WKWebView 的 Cookie。 |
| | | */ |
| | | - (void)syncWKWebViewCookie; |
| | | |
| | | /** |
| | | 设置无效的 WKWebView delegate。 |
| | | */ |
| | | - (void)setInvalidWKDelegate:(NSString *)invalidWKDelegate; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * WVWebViewUtil.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2014年 阿里巴巴-无线事业部. All rights reserved. |
| | | */ |
| | | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | /** |
| | | * WebView 的工具类。 |
| | | */ |
| | | @interface WVWebViewUtil : NSObject |
| | | |
| | | /** |
| | | * 自动补全 URL Schema。 |
| | | */ |
| | | + (void)completeUrlScheme:(NSURLRequest *)request withCallback:(void (^)(NSURLRequest *))callback; |
| | | |
| | | /** |
| | | * 缩短 URL 长度。 |
| | | */ |
| | | + (NSString *)shortenUrl:(NSString *)urlString toLength:(NSUInteger)maxLength; |
| | | |
| | | @end |
New file |
| | |
| | | /* |
| | | * WindVaneCorePrivate.h |
| | | * |
| | | * Created by WindVane. |
| | | * Copyright (c) 2020年 阿里巴巴-淘宝技术部. All rights reserved. |
| | | */ |
| | | |
| | | #ifdef __OBJC__ |
| | | |
| | | #import <WindVaneCore/WindVaneCore.h> |
| | | #import <WindVaneCore/NSDate+WVUtility.h> |
| | | #import <WindVaneCore/NSMutableArray+WVUtility.h> |
| | | #import <WindVaneCore/WVAssert.h> |
| | | #import <WindVaneCore/WVCachedKey.h> |
| | | #import <WindVaneCore/WVCommonWebView.h> |
| | | #import <WindVaneCore/WVHttpUtil+WVPrivate.h> |
| | | #import <WindVaneCore/WVInjector.h> |
| | | #import <WindVaneCore/WVPrivateConstant.h> |
| | | #import <WindVaneCore/WVURLProtocolProcessor.h> |
| | | #import <WindVaneCore/WVURLProtocolService+WVPrivate.h> |
| | | #import <WindVaneCore/WVUserConfig+WVPrivate.h> |
| | | #import <WindVaneCore/WVWKWebView+WVPrivate.h> |
| | | #import <WindVaneCore/WVWebViewRecorder+WVPrivate.h> |
| | | #import <WindVaneCore/WVWebViewUtil.h> |
| | | |
| | | #endif /* __OBJC__ */ |
New file |
| | |
| | | /* 2019-07-09 17:41:48 */ |
| | | !function(e,r,n){var t=e.console;if(r&&t&&!t.__isWindVaneLog__){t.__isWindVaneLog__=!0;var a=Object.prototype.toString;if(n>=4){var o=t.log;t.log=function(){o.apply(t,arguments);var e=u(4,arguments);e&&r.postMessage(e)}}if(n>=3){var i=t.info;t.info=function(){i.apply(t,arguments);var e=u(3,arguments);e&&r.postMessage(e)}}if(n>=2){var c=t.warn;t.warn=function(){c.apply(t,arguments);var e=u(2,arguments);e&&r.postMessage(e)}}if(n>=1){var f=t.error;t.error=function(){f.apply(t,arguments);var e=u(1,arguments);e&&r.postMessage(e)}}}function s(e,r){for(var n in r)if(r[n]==e)return'"[Ref '+n+']"'}function l(r,n,t,o){if(null==r)return"null";if(void 0==r)return"undefined";var i;switch(a.call(r)){case"[object String]":case"[object Date]":case"[object Function]":i=r.toString();break;case"[object Boolean]":case"[object Number]":case"[object Regex]":n=!0,i=r.toString();break;case"[object Error]":i=r.stack;break;case"[object Arguments]":case"[object Array]":if(f=s(r,o))return f;o[t]=r,n=!0,i="[";for(var c=0;c<r.length;c++)c>0&&(i+=", "),i+=l(r[c],!1,t+"."+c,o);i+="]";break;default:if(e.HTMLElement&&r instanceof HTMLElement)i=r.outerHTML;else{var f;if(f=s(r,o))return f;if(o[t]=r,r.hasOwnProperty){n=!0,i="{";var u=!0;for(var c in r)if(r.hasOwnProperty(c)){u?u=!1:i+=", ";var g=JSON.stringify(c);i+=g,i+=": ",i+=l(r[c],!1,t+"."+g,o)}i+="}"}else i=a.call(r)}}return n||(i=JSON.stringify(i)),i}function u(e,r){if(0!=r.length){for(var n="",t=0;t<r.length;t++)t>0&&(n+=" "),n+=l(r[t],!0,"",{});return{level:e,log:n}}}}(WV_GLOBALOBJECT,WV_LOGGER,WV_LOGLEVEL); |
| | |
| | | * "auth_code" : (NSString*) [optional] if not set, default search yw_1222.jpg and yw_1222_mwua.jpg |
| | | * @return init result |
| | | */ |
| | | -(BOOL) init:(NSDictionary*) paramDict |
| | | error:(NSError* __autoreleasing*)error; |
| | | |
| | | |
| | | /** |
| | | * get signature |
| | | * @param paramDict <NSString, object> paras |
| | | * "data" : (NSData*) [required] data need to be signed; |
| | | * "appkey" : (NSString*) [required] appkey for sign |
| | | * "env" : (NSNumber*) [optional] 0:online, 1:pre, 2:daily if not set default set online |
| | | * "auth_code" : (NSString*) [optional] if not set, default search yw_1222.jpg and yw_1222_mwua.jpg |
| | | * @return sign result dictionary |
| | | * "x-sign" : (NSString*) [required] sign result |
| | | * "x-sign_ext1" : (NSString*) [optinal] sign extend result |
| | | * "..." : (NSString*) [optinal] sign extend resultN |
| | | */ |
| | | -(NSDictionary*) getSign:(NSDictionary*) paramDict |
| | | error:(NSError* __autoreleasing*)error; |
| | | |
| | | |
| | | /** |
| | | * get mini-wua |
| | | * @param paramDict <NSString, object> paras |
| | | * "env" : (NSNumber*) [optional] 0:online, 1:pre, 2:daily if not set default set online |
| | | * "auth_code" : (NSString*) [optional] if not set, default search yw_1222.jpg and yw_1222_mwua.jpg |
| | | * "extend_paras" : (NSDictionary*) [optional] extra datas e.g. api name, page id, .. |
| | | * @return risk control result dictionary |
| | | * "x-miniwua" : (NSString*) [required] mini wua string result |
| | | * "x-miniwua_ext1" : (NSString*) [optional] wsg extra risk control data1 |
| | | * "x-miniwua_ext2" : (NSString*) [optional] wsg extra risk control data2 |
| | | * "..." : (NSString*) [optional] wsg extra risk control dataN |
| | | */ |
| | | -(NSDictionary*) getMiniWua:(NSDictionary*) paramDict |
| | | error:(NSError* __autoreleasing*)error; |
| | | |
| | | /** |
| | | * get vmp signature with wua |
| | | * @param paramDict <NSString, object> paras |
| | | * "data" : (NSData*) [required] data need to be signed |
| | | * "env" : (NSNumber*) [optional] 0:online, 1:pre, 2:daily if not set default set online |
| | | * "auth_code" : (NSString*) [optional] if not set, default search yw_1222.jpg and yw_1222_mwua.jpg |
| | | * @return wua result content |
| | | * @"wua" : (NSString*) [required] wua data for risk control |
| | | * @"wua_ext1" : (NSString*) [optional] extra wua data1 for risk control |
| | | * @"wua_ext2" : (NSString*) [optional] extra wua data2 for risk control |
| | | * "..." : (NSString*) [optional] extra wua dataN for risk control |
| | | */ |
| | | -(NSDictionary*) getWua:(NSDictionary*) paramDict |
| | | error:(NSError* __autoreleasing*)error; |
| | | |
| | | |
| | | @end |
| | | |
| | | /******************************************************************************************************************** |
| | | * 无线保镖新接口, 后续所有签名均迁移到该接口 |
| | | ********************************************************************************************************************/ |
| | | |
| | | @protocol TBSecurityGuardOpenUnifiedProtocol <NSObject> |
| | | |
| | | /** |
| | | * init MiddleTier Generic Cponent |
| | | * @param paramDict <NSString, object> paras |
| | | * "auth_code" : (NSString*) [optional] if not set, default search yw_1222.jpg and yw_1222_mwua.jpg |
| | | * @return init result |
| | | */ |
| | | -(BOOL) init:(NSDictionary*) paramDict error:(NSError* __autoreleasing*)error; |
| | | |
| | | |
| | |
| | | #import <Foundation/Foundation.h> |
| | | |
| | | |
| | | /** |
| | | * 日志级别 |
| | | */ |
| | | typedef enum { |
| | | kMTOPLogLevelNone = 0, |
| | | kMTOPLogLevelDebug = 1, |
| | | kMTOPLogLevelInfo = 2, |
| | | kMTOPLogLevelWarn = 3, |
| | | kMTOPLogLevelError = 4 |
| | | } TBMTOPLogLevel; |
| | | |
| | | /** |
| | | * 日志入口 |
| | | */ |
| | | @interface TBSDKLogUtil : NSObject |
| | | |
| | | + (void)log:(TBMTOPLogLevel)level file:(const char *)file line:(int)line msg:(NSString *)fmt, ...; |
| | | |
| | | @end |
| | | |
| | | /** |
| | | * 原来的C接口 |
| | | */ |
| | | |
| | | #ifdef __cplusplus |
| | | extern "C" { |
| | | #endif |
| | | |
| | | /** |
| | | * 日志开关函数(保持向后兼容,此函数一直保留) |
| | | */ |
| | | void openSDKSwitchLog(BOOL flag); |
| | | |
| | | /** |
| | | * 开关openSDK的log |
| | | */ |
| | | void openSDKSwitchLog(BOOL logCtr); |
| | | |
| | | /** |
| | | * 打印 log 宏 |
| | | */ |
| | | #define MTOP_LOGD(...) [TBSDKLogUtil log:kMTOPLogLevelDebug file:__FILE__ line:__LINE__ msg:__VA_ARGS__] |
| | | |
| | | #define MTOP_LOGI(...) [TBSDKLogUtil log:kMTOPLogLevelInfo file:__FILE__ line:__LINE__ msg:__VA_ARGS__] |
| | | |
| | | #define MTOP_LOGW(...) [TBSDKLogUtil log:kMTOPLogLevelWarn file:__FILE__ line:__LINE__ msg:__VA_ARGS__] |
| | | |
| | | #define MTOP_LOGE(...) [TBSDKLogUtil log:kMTOPLogLevelError file:__FILE__ line:__LINE__ msg:__VA_ARGS__] |
| | | |
| | | #ifdef __cplusplus |
| | | } |
| | | #endif |
| | | |
| | | |
| | | /** |
| | | * MTOP日志级别 |
| | | */ |
| | | typedef NS_OPTIONS(NSUInteger, TBSDKMTOPLogLevel) { |
| | | kMTOPLogDebug = 4, |
| | | kMTOPLogInfo = 3, |
| | | kMTOPLogWarnning = 2, |
| | | kMTOPLogError = 1 |
| | | }; |
| | | |
| | | |
| | | /** |
| | | * MTOP日志打印入口 |
| | | */ |
| | | @interface TBSDKLogUtil : NSObject |
| | | |
| | | + (void)log:(TBSDKMTOPLogLevel)level file:(const char *)file func:(const char *)func line:(int)line msg:(NSString *)fmt, ...; |
| | | |
| | | @end |
| | | |
| | | #define MTOP_LOGD(...) [TBSDKLogUtil log:kMTOPLogDebug file:__FILE__ func:__func__ line:__LINE__ msg:__VA_ARGS__]; |
| | | |
| | | #define MTOP_LOGI(...) [TBSDKLogUtil log:kMTOPLogInfo file:__FILE__ func:__func__ line:__LINE__ msg:__VA_ARGS__]; |
| | | |
| | | #define MTOP_LOGW(...) [TBSDKLogUtil log:kMTOPLogWarnning file:__FILE__ func:__func__ line:__LINE__ msg:__VA_ARGS__]; |
| | | |
| | | #define MTOP_LOGE(...) [TBSDKLogUtil log:kMTOPLogError file:__FILE__ func:__func__ line:__LINE__ msg:__VA_ARGS__]; |
| | | |
| | |
| | | @protocol TBSDKSignProtocol <NSObject> |
| | | |
| | | /** |
| | | * 老签名接口 |
| | | * 老签名接口v5.1 |
| | | */ |
| | | - (NSString *)signWithAppkey:(NSString *)appkey |
| | | withAuthCode:(NSString *)authcode |
| | |
| | | withHeaders:(NSDictionary *)headers; |
| | | |
| | | /** |
| | | * 新签名接口 |
| | | * 新签名接口v6.2/6.3 |
| | | */ |
| | | - (NSDictionary *)getSecurityFactors:(NSString *)appkey |
| | | withAuthCode:(NSString *)authcode |
| | |
| | | */ |
| | | extern int const OPEN_SECURITYBODY_FLAG_FORMAT_MINI_MTOP; |
| | | |
| | | ///** |
| | | // * alipay 人机格式 |
| | | // */ |
| | | //extern int const OPEN_SECURITYBODY_FLAG_FORMAT_ALIPAY; |
| | | |
| | | /** |
| | | * 使用 白盒加密人机数据,没有特别需求不要指定 |
| | | */ |
| | |
| | | #define SYS_HTTP_HEADER_EXTTYPE @"x-exttype" |
| | | #define SYS_HTTP_HEADER_SECURITY_APPKEY @"x-s-appkey" |
| | | #define SYS_HTTP_HEADER_ACT @"x-act" |
| | | |
| | | #define SYS_HTTP_HEADER_ROUTER_ID @"x-router-id" |
| | | #define SYS_HTTP_HEADER_PLACE_ID @"x-place-id" |
| | | |
| | | /** |
| | | * security guard headers |
| | |
| | | #define SYS_HTTP_HEADER_SGEXT @"x-sgext" |
| | | #define SYS_HTTP_HEADER_BAXIA_VERSION @"x-bx-version" |
| | | |
| | | #define CUSTOM_HTTP_UTDID @"custom-utdid" |
| | | /** |
| | | * 协议版本 |
| | | */ |
| | | #define M_PV_INNER @"6.2" |
| | | #define M_PV_OPEN @"1.3" |
| | | |
| | | #define M_PV_INNER_OLD @"5.2" |
| | | |
| | | #define SYS_PARAMETER_DATA @"data" |
| | | |
| | |
| | | <plist version="1.0"> |
| | | <dict> |
| | | <key>BuildMachineOSBuild</key> |
| | | <string>17G65</string> |
| | | <string>18A391</string> |
| | | <key>CFBundleDevelopmentRegion</key> |
| | | <string>en</string> |
| | | <key>CFBundleExecutable</key> |
| | |
| | | <key>CFBundlePackageType</key> |
| | | <string>FMWK</string> |
| | | <key>CFBundleShortVersionString</key> |
| | | <string>5.4.36</string> |
| | | <string>5.4.40</string> |
| | | <key>CFBundleSignature</key> |
| | | <string>????</string> |
| | | <key>CFBundleSupportedPlatforms</key> |
| | |
| | | <key>CFBundleName</key> |
| | | <string>SGMain</string> |
| | | <key>CFBundleShortVersionString</key> |
| | | <string>5.4.173</string> |
| | | <string>5.4.190</string> |
| | | <key>CFBundleSupportedPlatforms</key> |
| | | <array> |
| | | <string>iPhoneOS</string> |
| | |
| | | <key>CFBundleName</key> |
| | | <string>SGMiddleTier</string> |
| | | <key>CFBundleShortVersionString</key> |
| | | <string>5.4.7</string> |
| | | <string>5.4.12</string> |
| | | <key>CFBundleSupportedPlatforms</key> |
| | | <array> |
| | | <string>iPhoneOS</string> |
| | |
| | | <key>CFBundleName</key> |
| | | <string>SGSecurityBody</string> |
| | | <key>CFBundleShortVersionString</key> |
| | | <string>5.4.99</string> |
| | | <string>5.4.110</string> |
| | | <key>CFBundleSupportedPlatforms</key> |
| | | <array> |
| | | <string>iPhoneOS</string> |
| | |
| | | env: (int) env |
| | | error: (NSError* __autoreleasing*) error; |
| | | |
| | | |
| | | |
| | | /// 进入某个风险场景之后,调用该接口,传递具体的场景以及检测数据 |
| | | /// @param scene 具体的风险场景 |
| | | /// @param riskParam 风险场景传递的参数 |
| | | /// @param error 错误码 |
| | | - (BOOL) enterRiskScene: (int) scene |
| | | riskParam: (NSDictionary *) riskParam |
| | | error: (NSError* __autoreleasing*) error; |
| | | |
| | | |
| | | /// 离开某个风险场景时,需要调用该接口 |
| | | /// @param scene 具体的风险场景 |
| | | /// @param error 错误码 |
| | | - (BOOL) leaveRiskScene: (int) scene |
| | | error: (NSError* __autoreleasing*) error; |
| | | |
| | | |
| | | /// 新的获取WUA的接口 |
| | | /// @param authCode 图片后缀,传null使用默认图片yw_1222.jpg |
| | | /// @param extendParam 业务传入的自定义参数,保存在jaqParam |
| | | /// @param flag 决定生成的 wua 的格式,本参数必选,见文档 |
| | | /// @param env wua 的环境参数,本参数必选,见文档 |
| | | /// @param error 错误码 |
| | | - (NSString*) getSecurityBodyDataEx: (NSString*) authCode |
| | | extendParam: (NSDictionary*) extendParam |
| | | flag: (int) flag |
| | | env: (int) env |
| | | error: (NSError* __autoreleasing*) error; |
| | | |
| | | @end |
| | |
| | | * 获取位置信息格式 |
| | | */ |
| | | extern int const OPEN_SECURITYBODY_FLAG_FORMAT_GET_LOC_DATA; |
| | | |
| | | /** |
| | | * LBS风险场景标识 |
| | | */ |
| | | extern int const OPEN_SECURITYBODY_SCENE_LBSRISK; |
| | | |
| | | /** |
| | | * 实人认证风险场景标识 |
| | | */ |
| | | extern int const OPEN_SECURITYBODY_SCENE_FACERISK; |
| | |
| | | <key>CFBundleName</key> |
| | | <string>SecurityGuardSDK</string> |
| | | <key>CFBundleShortVersionString</key> |
| | | <string>5.4.173</string> |
| | | <string>5.4.190</string> |
| | | <key>CFBundleSupportedPlatforms</key> |
| | | <array> |
| | | <string>iPhoneOS</string> |