Skip to content
This repository was archived by the owner on Jun 3, 2021. It is now read-only.

Commit 29a600a

Browse files
wqyfavorjianhan-he
wqyfavor
authored andcommitted
Upgrade iOS deployment target to 9.0 (#2641)
* Upgrade iOS deployment target to 9.0 * Upgrade iOS deployment target to 9.0 * Upgrade iOS deployment target to 9.0
1 parent 67bad4f commit 29a600a

File tree

15 files changed

+57
-165
lines changed

15 files changed

+57
-165
lines changed

WeexSDK.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Pod::Spec.new do |s|
2929
"doumafang " => "doumafang@gmail.com"
3030
}
3131
s.platform = :ios
32-
s.ios.deployment_target = '8.0'
32+
s.ios.deployment_target = '9.0'
3333

3434
# use for public
3535
# s.source = {

ios/playground/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
source 'https://github.com/CocoaPods/Specs.git'
2-
platform :ios, '8.0'
2+
platform :ios, '9.0'
33
#inhibit_all_warnings!
44

55
def common

ios/playground/WeexDemo.xcodeproj/project.pbxproj

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,7 @@
463463
developmentRegion = English;
464464
hasScannedForEncodings = 0;
465465
knownRegions = (
466+
English,
466467
en,
467468
Base,
468469
);
@@ -735,7 +736,7 @@
735736
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
736737
GCC_WARN_UNUSED_FUNCTION = YES;
737738
GCC_WARN_UNUSED_VARIABLE = YES;
738-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
739+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
739740
MTL_ENABLE_DEBUG_INFO = YES;
740741
ONLY_ACTIVE_ARCH = YES;
741742
SDKROOT = iphoneos;
@@ -774,7 +775,7 @@
774775
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
775776
GCC_WARN_UNUSED_FUNCTION = YES;
776777
GCC_WARN_UNUSED_VARIABLE = YES;
777-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
778+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
778779
MTL_ENABLE_DEBUG_INFO = NO;
779780
SDKROOT = iphoneos;
780781
TARGETED_DEVICE_FAMILY = "1,2";
@@ -799,7 +800,7 @@
799800
);
800801
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
801802
INFOPLIST_FILE = WeexDemo/Info.plist;
802-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
803+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
803804
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
804805
OTHER_LDFLAGS = (
805806
"$(inherited)",
@@ -829,7 +830,7 @@
829830
);
830831
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
831832
INFOPLIST_FILE = WeexDemo/Info.plist;
832-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
833+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
833834
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
834835
OTHER_LDFLAGS = (
835836
"$(inherited)",
@@ -847,7 +848,7 @@
847848
buildSettings = {
848849
BUNDLE_LOADER = "$(TEST_HOST)";
849850
INFOPLIST_FILE = WeexDemoTests/Info.plist;
850-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
851+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
851852
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
852853
PRODUCT_BUNDLE_IDENTIFIER = com.taobao.WeexDemoTests;
853854
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -860,7 +861,7 @@
860861
buildSettings = {
861862
BUNDLE_LOADER = "$(TEST_HOST)";
862863
INFOPLIST_FILE = WeexDemoTests/Info.plist;
863-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
864+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
864865
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
865866
PRODUCT_BUNDLE_IDENTIFIER = com.taobao.WeexDemoTests;
866867
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -890,7 +891,7 @@
890891
);
891892
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
892893
INFOPLIST_FILE = "WeexUITestDemo-Info.plist";
893-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
894+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
894895
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
895896
MODULE_NAME = NO;
896897
OTHER_LDFLAGS = (
@@ -920,7 +921,7 @@
920921
GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES;
921922
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
922923
INFOPLIST_FILE = "WeexUITestDemo-Info.plist";
923-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
924+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
924925
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
925926
MODULE_NAME = NO;
926927
OTHER_LDFLAGS = (

ios/sdk/WeexSDK.xcodeproj/project.pbxproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3457,7 +3457,7 @@
34573457
CLANG_ENABLE_MODULES = NO;
34583458
CODE_SIGN_IDENTITY = "iPhone Developer";
34593459
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
3460-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
3460+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
34613461
OTHER_LDFLAGS = "-ObjC";
34623462
PRODUCT_NAME = "$(TARGET_NAME)";
34633463
SKIP_INSTALL = YES;
@@ -3469,7 +3469,7 @@
34693469
buildSettings = {
34703470
CLANG_ENABLE_MODULES = NO;
34713471
CODE_SIGN_IDENTITY = "iPhone Developer";
3472-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
3472+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
34733473
OTHER_LDFLAGS = "-ObjC";
34743474
PRODUCT_NAME = "$(TARGET_NAME)";
34753475
SKIP_INSTALL = YES;
@@ -3573,7 +3573,7 @@
35733573
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
35743574
GCC_WARN_UNUSED_FUNCTION = YES;
35753575
GCC_WARN_UNUSED_VARIABLE = YES;
3576-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
3576+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
35773577
MTL_ENABLE_DEBUG_INFO = YES;
35783578
ONLY_ACTIVE_ARCH = YES;
35793579
OTHER_CFLAGS = "";
@@ -3627,7 +3627,7 @@
36273627
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
36283628
GCC_WARN_UNUSED_FUNCTION = YES;
36293629
GCC_WARN_UNUSED_VARIABLE = YES;
3630-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
3630+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
36313631
MTL_ENABLE_DEBUG_INFO = NO;
36323632
OTHER_CFLAGS = (
36333633
"-fembed-bitcode",
@@ -3676,7 +3676,7 @@
36763676
);
36773677
INFOPLIST_FILE = WeexSDK/Info.plist;
36783678
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
3679-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
3679+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
36803680
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
36813681
MACH_O_TYPE = staticlib;
36823682
OTHER_CFLAGS = (
@@ -3732,7 +3732,7 @@
37323732
);
37333733
INFOPLIST_FILE = WeexSDK/Info.plist;
37343734
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
3735-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
3735+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
37363736
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
37373737
MACH_O_TYPE = staticlib;
37383738
OTHER_CFLAGS = (
@@ -3787,7 +3787,7 @@
37873787
);
37883788
INFOPLIST_FILE = "WeexSDK-Dynamic/Info.plist";
37893789
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
3790-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
3790+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
37913791
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
37923792
OTHER_LDFLAGS = (
37933793
"-ObjC",
@@ -3834,7 +3834,7 @@
38343834
);
38353835
INFOPLIST_FILE = "WeexSDK-Dynamic/Info.plist";
38363836
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
3837-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
3837+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
38383838
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
38393839
OTHER_LDFLAGS = (
38403840
"-ObjC",

ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -546,11 +546,7 @@ - (void)createInstance:(NSString *)instanceIdString
546546
__weak typeof(self) weakSelf = self;
547547
[self callJSMethod:@"createInstanceContext" args:@[instanceIdString, newOptions, data?:@[]] onContext:nil completion:^(JSValue *instanceContextEnvironment) {
548548
if (sdkInstance.pageName) {
549-
if (@available(iOS 8.0, *)) {
550-
[sdkInstance.instanceJavaScriptContext.javaScriptContext setName:sdkInstance.pageName];
551-
} else {
552-
// Fallback
553-
}
549+
[sdkInstance.instanceJavaScriptContext.javaScriptContext setName:sdkInstance.pageName];
554550
}
555551
weakSelf.jsBridge.javaScriptContext[@"wxExtFuncInfo"]= nil;
556552

@@ -683,16 +679,11 @@ - (NSString *)_pareJSBundleType:(NSString*)instanceIdString jsBundleString:(NSSt
683679
NSString * bundleType = nil;
684680
WXSDKInstance * instance = [WXSDKManager instanceForID:instanceIdString];
685681
NSURLComponents * urlComponent = [NSURLComponents componentsWithString:instance.pageName?:@""];
686-
if (@available(iOS 8.0, *)) {
687-
for (NSURLQueryItem * queryItem in urlComponent.queryItems) {
688-
if ([queryItem.name isEqualToString:@"bundleType"] && [@[@"Vue", @"Rax", @"vue", @"rax"] containsObject:queryItem.value]) {
689-
bundleType = queryItem.value;
690-
return bundleType;
691-
}
682+
for (NSURLQueryItem * queryItem in urlComponent.queryItems) {
683+
if ([queryItem.name isEqualToString:@"bundleType"] && [@[@"Vue", @"Rax", @"vue", @"rax"] containsObject:queryItem.value]) {
684+
bundleType = queryItem.value;
685+
return bundleType;
692686
}
693-
} else {
694-
// Fallback on earlier versions
695-
return bundleType;
696687
}
697688

698689
// find first character that is not space or new line character
@@ -1238,10 +1229,6 @@ + (void)mountContextEnvironment:(JSContext*)context
12381229
}
12391230
};
12401231

1241-
if (WX_SYS_VERSION_LESS_THAN(@"8.0")) {
1242-
// solve iOS7 memory problem
1243-
context[@"nativeSet"] = [WXPolyfillSet class];
1244-
}
12451232
context[@"console"][@"error"] = ^(){
12461233
[WXBridgeContext handleConsoleOutputWithArgument:[JSContext currentArguments] logLevel:WXLogFlagError];
12471234
};

ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.mm

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,8 @@ - (void)setWeexInstanceId:(NSString *)weexInstanceId
110110

111111
- (void)executeJSFramework:(NSString *)frameworkScript
112112
{
113-
114113
WXAssertParam(frameworkScript);
115-
if (WX_SYS_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) {
116-
[_jsContext evaluateScript:frameworkScript withSourceURL:[NSURL URLWithString:@"weex-main-jsfm.js"]];
117-
}else{
118-
[_jsContext evaluateScript:frameworkScript];
119-
}
114+
[_jsContext evaluateScript:frameworkScript withSourceURL:[NSURL URLWithString:@"weex-main-jsfm.js"]];
120115
}
121116

122117
- (JSValue *)callJSMethod:(NSString *)method args:(NSArray *)args
@@ -423,9 +418,7 @@ - (void)createDefaultContext
423418
__weak typeof(self) weakSelf = self;
424419

425420
_jsContext = [[JSContext alloc] init];
426-
if (WX_SYS_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) {
427-
_jsContext.name = @"Weex Context";
428-
}
421+
_jsContext.name = @"Weex Context";
429422

430423
[WXBridgeContext mountContextEnvironment:_jsContext];
431424

ios/sdk/WeexSDK/Sources/Component/WXVideoComponent.m

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,7 @@ - (void)dealloc
112112

113113
- (BOOL)greater8SysVer
114114
{
115-
//return NO;
116-
NSString *reqSysVer = @"8.0";
117-
NSString *currSysVer = [[UIDevice currentDevice] systemVersion];
118-
return [currSysVer compare:reqSysVer options:NSNumericSearch] != NSOrderedAscending;
115+
return YES;
119116
}
120117

121118
- (void)observeValueForKeyPath:(NSString *)keyPath

ios/sdk/WeexSDK/Sources/Controller/WXRootViewController.m

Lines changed: 4 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -48,65 +48,22 @@ - (id)initWithSourceURL:(NSURL *)sourceURL
4848
//reduced pop/push animation in iOS 7
4949
- (UIViewController *)popViewControllerAnimated:(BOOL)animated
5050
{
51-
if (WX_SYS_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0"))
52-
return [super popViewControllerAnimated:animated];
53-
54-
__weak typeof(self) weakSelf = self;
55-
[self addOperationBlock:^{
56-
if ([self.viewControllers count] > 0 ) {
57-
UIViewController *viewController = [super popViewControllerAnimated:NO];
58-
if (!viewController) {
59-
weakSelf.operationInProcess = NO;
60-
}
61-
}
62-
}];
63-
64-
return nil;
51+
return [super popViewControllerAnimated:animated];
6552
}
6653

6754
- (NSArray<UIViewController *> *)popToViewController:(UIViewController *)viewController animated:(BOOL)animated
6855
{
69-
if (WX_SYS_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0"))
70-
return [super popToViewController:viewController animated:animated];
71-
72-
__weak typeof(self) weakSelf = self;
73-
[self addOperationBlock:^{
74-
if ([weakSelf.viewControllers containsObject:viewController]) {
75-
NSArray *viewControllers = [super popToViewController:viewController animated:NO];
76-
if (viewControllers.count == 0) {
77-
weakSelf.operationInProcess = NO;
78-
}
79-
} else {
80-
weakSelf.operationInProcess = NO;
81-
}
82-
}];
83-
84-
return nil;
56+
return [super popToViewController:viewController animated:animated];
8557
}
8658

8759
- (NSArray<UIViewController *> *)popToRootViewControllerAnimated:(BOOL)animated
8860
{
89-
if (WX_SYS_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0"))
90-
return [super popToRootViewControllerAnimated:animated];
91-
92-
__weak typeof(self) weakSelf = self;
93-
[self addOperationBlock:^{
94-
NSArray *viewControllers = [super popToRootViewControllerAnimated:NO];
95-
if (viewControllers.count == 0) {
96-
weakSelf.operationInProcess = NO;
97-
}
98-
}];
99-
return nil;
61+
return [super popToRootViewControllerAnimated:animated];
10062
}
10163

10264
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated
10365
{
104-
if (WX_SYS_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0"))
105-
return [super pushViewController:viewController animated:animated];
106-
107-
[self addOperationBlock:^{
108-
[super pushViewController:viewController animated:NO];
109-
}];
66+
return [super pushViewController:viewController animated:animated];
11067
}
11168

11269
- (void)addOperationBlock:(OperationBlock)operation

ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.m

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,15 +1010,13 @@ - (void)fireTouchEvent:(NSString *)eventName withTouches:(NSSet<UITouch *> *)tou
10101010
NSDictionary *resultTouch = [_component touchResultWithScreenLocation:screenLocation pageLocation:pageLocation identifier:touch.wx_identifier];
10111011
NSMutableDictionary * mutableResultTouch = [resultTouch mutableCopy];
10121012

1013-
if (WX_SYS_VERSION_GREATER_THAN_OR_EQUAL_TO(@"9.0")) {
1014-
float value = touch.force*60;
1015-
float maxValue = touch.maximumPossibleForce*60;
1016-
if (touch.maximumPossibleForce) {
1017-
// the forece value will be range 1 from 0.
1018-
[mutableResultTouch setObject:[NSNumber numberWithFloat:value/maxValue] forKey:@"force"];
1019-
}else {
1020-
[mutableResultTouch setObject:[NSNumber numberWithFloat:0.0] forKey:@"force"];
1021-
}
1013+
float value = touch.force*60;
1014+
float maxValue = touch.maximumPossibleForce*60;
1015+
if (touch.maximumPossibleForce) {
1016+
// the forece value will be range 1 from 0.
1017+
[mutableResultTouch setObject:[NSNumber numberWithFloat:value/maxValue] forKey:@"force"];
1018+
}else {
1019+
[mutableResultTouch setObject:[NSNumber numberWithFloat:0.0] forKey:@"force"];
10221020
}
10231021

10241022
if (mutableResultTouch) { // component is nil, mutableResultTouch will be nil

ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.m

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,7 @@ + (NSThread *)jsThread
101101
dispatch_once(&onceToken, ^{
102102
WXBridgeThread = [[NSThread alloc] initWithTarget:[[self class]sharedManager] selector:@selector(_runLoopThread) object:nil];
103103
[WXBridgeThread setName:WX_BRIDGE_THREAD_NAME];
104-
if(WX_SYS_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) {
105-
[WXBridgeThread setQualityOfService:[[NSThread mainThread] qualityOfService]];
106-
} else {
107-
[WXBridgeThread setThreadPriority:[[NSThread mainThread] threadPriority]];
108-
}
109-
104+
[WXBridgeThread setQualityOfService:[[NSThread mainThread] qualityOfService]];
110105
[WXBridgeThread start];
111106
});
112107

@@ -119,12 +114,7 @@ + (NSThread *)backupJsThread
119114
dispatch_once(&onceToken, ^{
120115
WXBackupBridgeThread = [[NSThread alloc] initWithTarget:[[self class]sharedManager] selector:@selector(_runLoopThread) object:nil];
121116
[WXBackupBridgeThread setName:WX_BACKUP_BRIDGE_THREAD_NAME];
122-
if(WX_SYS_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) {
123-
[WXBackupBridgeThread setQualityOfService:[[NSThread mainThread] qualityOfService]];
124-
} else {
125-
[WXBackupBridgeThread setThreadPriority:[[NSThread mainThread] threadPriority]];
126-
}
127-
117+
[WXBackupBridgeThread setQualityOfService:[[NSThread mainThread] qualityOfService]];
128118
[WXBackupBridgeThread start];
129119
});
130120

ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.mm

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,7 @@ + (NSThread *)componentThread
159159
dispatch_once(&onceToken, ^{
160160
WXComponentThread = [[NSThread alloc] initWithTarget:[self sharedManager] selector:@selector(_runLoopThread) object:nil];
161161
[WXComponentThread setName:WX_COMPONENT_THREAD_NAME];
162-
if(WX_SYS_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) {
163-
[WXComponentThread setQualityOfService:[[NSThread mainThread] qualityOfService]];
164-
} else {
165-
[WXComponentThread setThreadPriority:[[NSThread mainThread] threadPriority]];
166-
}
167-
162+
[WXComponentThread setQualityOfService:[[NSThread mainThread] qualityOfService]];
168163
[WXComponentThread start];
169164
});
170165

ios/sdk/WeexSDK/Sources/Model/WXComponent.mm

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -261,12 +261,6 @@ - (void)dealloc
261261
[_panGesture removeTarget:nil action:NULL];
262262
}
263263

264-
if (bNeedRemoveEvents) {
265-
if (WX_SYS_VERSION_LESS_THAN(@"9.0")) {
266-
[self _removeAllEvents];
267-
}
268-
}
269-
270264
if (_bindingExpressions != nullptr) {
271265
for (WXJSExpression* expr : *_bindingExpressions) {
272266
if (expr != nullptr) {

0 commit comments

Comments
 (0)