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

Commit

Permalink
Upgrade iOS deployment target to 9.0 (#2641)
Browse files Browse the repository at this point in the history
* Upgrade iOS deployment target to 9.0

* Upgrade iOS deployment target to 9.0

* Upgrade iOS deployment target to 9.0
  • Loading branch information
wqyfavor authored and jianhan-he committed Jul 3, 2019
1 parent 67bad4f commit 29a600a
Show file tree
Hide file tree
Showing 15 changed files with 57 additions and 165 deletions.
2 changes: 1 addition & 1 deletion WeexSDK.podspec
Expand Up @@ -29,7 +29,7 @@ Pod::Spec.new do |s|
"doumafang " => "doumafang@gmail.com"
}
s.platform = :ios
s.ios.deployment_target = '8.0'
s.ios.deployment_target = '9.0'

# use for public
# s.source = {
Expand Down
2 changes: 1 addition & 1 deletion ios/playground/Podfile
@@ -1,5 +1,5 @@
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
platform :ios, '9.0'
#inhibit_all_warnings!

def common
Expand Down
17 changes: 9 additions & 8 deletions ios/playground/WeexDemo.xcodeproj/project.pbxproj
Expand Up @@ -463,6 +463,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
Expand Down Expand Up @@ -735,7 +736,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -774,7 +775,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
Expand All @@ -799,7 +800,7 @@
);
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
INFOPLIST_FILE = WeexDemo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_LDFLAGS = (
"$(inherited)",
Expand Down Expand Up @@ -829,7 +830,7 @@
);
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
INFOPLIST_FILE = WeexDemo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_LDFLAGS = (
"$(inherited)",
Expand All @@ -847,7 +848,7 @@
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
INFOPLIST_FILE = WeexDemoTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.taobao.WeexDemoTests;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -860,7 +861,7 @@
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
INFOPLIST_FILE = WeexDemoTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.taobao.WeexDemoTests;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -890,7 +891,7 @@
);
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
INFOPLIST_FILE = "WeexUITestDemo-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MODULE_NAME = NO;
OTHER_LDFLAGS = (
Expand Down Expand Up @@ -920,7 +921,7 @@
GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES;
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
INFOPLIST_FILE = "WeexUITestDemo-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MODULE_NAME = NO;
OTHER_LDFLAGS = (
Expand Down
16 changes: 8 additions & 8 deletions ios/sdk/WeexSDK.xcodeproj/project.pbxproj
Expand Up @@ -3457,7 +3457,7 @@
CLANG_ENABLE_MODULES = NO;
CODE_SIGN_IDENTITY = "iPhone Developer";
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand All @@ -3469,7 +3469,7 @@
buildSettings = {
CLANG_ENABLE_MODULES = NO;
CODE_SIGN_IDENTITY = "iPhone Developer";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -3573,7 +3573,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = "";
Expand Down Expand Up @@ -3627,7 +3627,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
OTHER_CFLAGS = (
"-fembed-bitcode",
Expand Down Expand Up @@ -3676,7 +3676,7 @@
);
INFOPLIST_FILE = WeexSDK/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MACH_O_TYPE = staticlib;
OTHER_CFLAGS = (
Expand Down Expand Up @@ -3732,7 +3732,7 @@
);
INFOPLIST_FILE = WeexSDK/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MACH_O_TYPE = staticlib;
OTHER_CFLAGS = (
Expand Down Expand Up @@ -3787,7 +3787,7 @@
);
INFOPLIST_FILE = "WeexSDK-Dynamic/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
OTHER_LDFLAGS = (
"-ObjC",
Expand Down Expand Up @@ -3834,7 +3834,7 @@
);
INFOPLIST_FILE = "WeexSDK-Dynamic/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
OTHER_LDFLAGS = (
"-ObjC",
Expand Down
23 changes: 5 additions & 18 deletions ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m
Expand Up @@ -546,11 +546,7 @@ - (void)createInstance:(NSString *)instanceIdString
__weak typeof(self) weakSelf = self;
[self callJSMethod:@"createInstanceContext" args:@[instanceIdString, newOptions, data?:@[]] onContext:nil completion:^(JSValue *instanceContextEnvironment) {
if (sdkInstance.pageName) {
if (@available(iOS 8.0, *)) {
[sdkInstance.instanceJavaScriptContext.javaScriptContext setName:sdkInstance.pageName];
} else {
// Fallback
}
[sdkInstance.instanceJavaScriptContext.javaScriptContext setName:sdkInstance.pageName];
}
weakSelf.jsBridge.javaScriptContext[@"wxExtFuncInfo"]= nil;

Expand Down Expand Up @@ -683,16 +679,11 @@ - (NSString *)_pareJSBundleType:(NSString*)instanceIdString jsBundleString:(NSSt
NSString * bundleType = nil;
WXSDKInstance * instance = [WXSDKManager instanceForID:instanceIdString];
NSURLComponents * urlComponent = [NSURLComponents componentsWithString:instance.pageName?:@""];
if (@available(iOS 8.0, *)) {
for (NSURLQueryItem * queryItem in urlComponent.queryItems) {
if ([queryItem.name isEqualToString:@"bundleType"] && [@[@"Vue", @"Rax", @"vue", @"rax"] containsObject:queryItem.value]) {
bundleType = queryItem.value;
return bundleType;
}
for (NSURLQueryItem * queryItem in urlComponent.queryItems) {
if ([queryItem.name isEqualToString:@"bundleType"] && [@[@"Vue", @"Rax", @"vue", @"rax"] containsObject:queryItem.value]) {
bundleType = queryItem.value;
return bundleType;
}
} else {
// Fallback on earlier versions
return bundleType;
}

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

if (WX_SYS_VERSION_LESS_THAN(@"8.0")) {
// solve iOS7 memory problem
context[@"nativeSet"] = [WXPolyfillSet class];
}
context[@"console"][@"error"] = ^(){
[WXBridgeContext handleConsoleOutputWithArgument:[JSContext currentArguments] logLevel:WXLogFlagError];
};
Expand Down
11 changes: 2 additions & 9 deletions ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.mm
Expand Up @@ -110,13 +110,8 @@ - (void)setWeexInstanceId:(NSString *)weexInstanceId

- (void)executeJSFramework:(NSString *)frameworkScript
{

WXAssertParam(frameworkScript);
if (WX_SYS_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) {
[_jsContext evaluateScript:frameworkScript withSourceURL:[NSURL URLWithString:@"weex-main-jsfm.js"]];
}else{
[_jsContext evaluateScript:frameworkScript];
}
[_jsContext evaluateScript:frameworkScript withSourceURL:[NSURL URLWithString:@"weex-main-jsfm.js"]];
}

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

_jsContext = [[JSContext alloc] init];
if (WX_SYS_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) {
_jsContext.name = @"Weex Context";
}
_jsContext.name = @"Weex Context";

[WXBridgeContext mountContextEnvironment:_jsContext];

Expand Down
5 changes: 1 addition & 4 deletions ios/sdk/WeexSDK/Sources/Component/WXVideoComponent.m
Expand Up @@ -112,10 +112,7 @@ - (void)dealloc

- (BOOL)greater8SysVer
{
//return NO;
NSString *reqSysVer = @"8.0";
NSString *currSysVer = [[UIDevice currentDevice] systemVersion];
return [currSysVer compare:reqSysVer options:NSNumericSearch] != NSOrderedAscending;
return YES;
}

- (void)observeValueForKeyPath:(NSString *)keyPath
Expand Down
51 changes: 4 additions & 47 deletions ios/sdk/WeexSDK/Sources/Controller/WXRootViewController.m
Expand Up @@ -48,65 +48,22 @@ - (id)initWithSourceURL:(NSURL *)sourceURL
//reduced pop/push animation in iOS 7
- (UIViewController *)popViewControllerAnimated:(BOOL)animated
{
if (WX_SYS_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0"))
return [super popViewControllerAnimated:animated];

__weak typeof(self) weakSelf = self;
[self addOperationBlock:^{
if ([self.viewControllers count] > 0 ) {
UIViewController *viewController = [super popViewControllerAnimated:NO];
if (!viewController) {
weakSelf.operationInProcess = NO;
}
}
}];

return nil;
return [super popViewControllerAnimated:animated];
}

- (NSArray<UIViewController *> *)popToViewController:(UIViewController *)viewController animated:(BOOL)animated
{
if (WX_SYS_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0"))
return [super popToViewController:viewController animated:animated];

__weak typeof(self) weakSelf = self;
[self addOperationBlock:^{
if ([weakSelf.viewControllers containsObject:viewController]) {
NSArray *viewControllers = [super popToViewController:viewController animated:NO];
if (viewControllers.count == 0) {
weakSelf.operationInProcess = NO;
}
} else {
weakSelf.operationInProcess = NO;
}
}];

return nil;
return [super popToViewController:viewController animated:animated];
}

- (NSArray<UIViewController *> *)popToRootViewControllerAnimated:(BOOL)animated
{
if (WX_SYS_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0"))
return [super popToRootViewControllerAnimated:animated];

__weak typeof(self) weakSelf = self;
[self addOperationBlock:^{
NSArray *viewControllers = [super popToRootViewControllerAnimated:NO];
if (viewControllers.count == 0) {
weakSelf.operationInProcess = NO;
}
}];
return nil;
return [super popToRootViewControllerAnimated:animated];
}

- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated
{
if (WX_SYS_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0"))
return [super pushViewController:viewController animated:animated];

[self addOperationBlock:^{
[super pushViewController:viewController animated:NO];
}];
return [super pushViewController:viewController animated:animated];
}

- (void)addOperationBlock:(OperationBlock)operation
Expand Down
16 changes: 7 additions & 9 deletions ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.m
Expand Up @@ -1010,15 +1010,13 @@ - (void)fireTouchEvent:(NSString *)eventName withTouches:(NSSet<UITouch *> *)tou
NSDictionary *resultTouch = [_component touchResultWithScreenLocation:screenLocation pageLocation:pageLocation identifier:touch.wx_identifier];
NSMutableDictionary * mutableResultTouch = [resultTouch mutableCopy];

if (WX_SYS_VERSION_GREATER_THAN_OR_EQUAL_TO(@"9.0")) {
float value = touch.force*60;
float maxValue = touch.maximumPossibleForce*60;
if (touch.maximumPossibleForce) {
// the forece value will be range 1 from 0.
[mutableResultTouch setObject:[NSNumber numberWithFloat:value/maxValue] forKey:@"force"];
}else {
[mutableResultTouch setObject:[NSNumber numberWithFloat:0.0] forKey:@"force"];
}
float value = touch.force*60;
float maxValue = touch.maximumPossibleForce*60;
if (touch.maximumPossibleForce) {
// the forece value will be range 1 from 0.
[mutableResultTouch setObject:[NSNumber numberWithFloat:value/maxValue] forKey:@"force"];
}else {
[mutableResultTouch setObject:[NSNumber numberWithFloat:0.0] forKey:@"force"];
}

if (mutableResultTouch) { // component is nil, mutableResultTouch will be nil
Expand Down
14 changes: 2 additions & 12 deletions ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.m
Expand Up @@ -101,12 +101,7 @@ + (NSThread *)jsThread
dispatch_once(&onceToken, ^{
WXBridgeThread = [[NSThread alloc] initWithTarget:[[self class]sharedManager] selector:@selector(_runLoopThread) object:nil];
[WXBridgeThread setName:WX_BRIDGE_THREAD_NAME];
if(WX_SYS_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) {
[WXBridgeThread setQualityOfService:[[NSThread mainThread] qualityOfService]];
} else {
[WXBridgeThread setThreadPriority:[[NSThread mainThread] threadPriority]];
}

[WXBridgeThread setQualityOfService:[[NSThread mainThread] qualityOfService]];
[WXBridgeThread start];
});

Expand All @@ -119,12 +114,7 @@ + (NSThread *)backupJsThread
dispatch_once(&onceToken, ^{
WXBackupBridgeThread = [[NSThread alloc] initWithTarget:[[self class]sharedManager] selector:@selector(_runLoopThread) object:nil];
[WXBackupBridgeThread setName:WX_BACKUP_BRIDGE_THREAD_NAME];
if(WX_SYS_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) {
[WXBackupBridgeThread setQualityOfService:[[NSThread mainThread] qualityOfService]];
} else {
[WXBackupBridgeThread setThreadPriority:[[NSThread mainThread] threadPriority]];
}

[WXBackupBridgeThread setQualityOfService:[[NSThread mainThread] qualityOfService]];
[WXBackupBridgeThread start];
});

Expand Down
7 changes: 1 addition & 6 deletions ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.mm
Expand Up @@ -159,12 +159,7 @@ + (NSThread *)componentThread
dispatch_once(&onceToken, ^{
WXComponentThread = [[NSThread alloc] initWithTarget:[self sharedManager] selector:@selector(_runLoopThread) object:nil];
[WXComponentThread setName:WX_COMPONENT_THREAD_NAME];
if(WX_SYS_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) {
[WXComponentThread setQualityOfService:[[NSThread mainThread] qualityOfService]];
} else {
[WXComponentThread setThreadPriority:[[NSThread mainThread] threadPriority]];
}

[WXComponentThread setQualityOfService:[[NSThread mainThread] qualityOfService]];
[WXComponentThread start];
});

Expand Down
6 changes: 0 additions & 6 deletions ios/sdk/WeexSDK/Sources/Model/WXComponent.mm
Expand Up @@ -261,12 +261,6 @@ - (void)dealloc
[_panGesture removeTarget:nil action:NULL];
}

if (bNeedRemoveEvents) {
if (WX_SYS_VERSION_LESS_THAN(@"9.0")) {
[self _removeAllEvents];
}
}

if (_bindingExpressions != nullptr) {
for (WXJSExpression* expr : *_bindingExpressions) {
if (expr != nullptr) {
Expand Down

0 comments on commit 29a600a

Please sign in to comment.