diff options
author | Joel Fischer <joeljfischer@gmail.com> | 2017-10-31 09:16:11 -0400 |
---|---|---|
committer | Joel Fischer <joeljfischer@gmail.com> | 2017-10-31 09:16:11 -0400 |
commit | 804bd41fde5a89023eed68f3b3ad573e22f49efa (patch) | |
tree | d46e735948978bdc91f2f330c5ab8d32739bde8f | |
parent | 918be7104c1775ee48c3c9a5b4d183e6dba163ef (diff) | |
parent | 293fafe0ef47b3ae667f67c118cf726c3fc657e3 (diff) | |
download | sdl_ios-804bd41fde5a89023eed68f3b3ad573e22f49efa.tar.gz |
Merge branch 'develop'5.0.0-rc.2
-rw-r--r-- | .swift-version | 1 | ||||
-rw-r--r-- | CHANGELOG.md | 5 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | SmartDeviceLink-iOS.podspec | 8 | ||||
-rw-r--r-- | SmartDeviceLink.podspec | 4 | ||||
-rw-r--r-- | SmartDeviceLink/Info.plist | 2 | ||||
-rw-r--r-- | SmartDeviceLink/SDLFocusableItemLocator.m | 58 | ||||
-rw-r--r-- | SmartDeviceLink/SDLLogTargetOSLog.m | 12 | ||||
-rw-r--r-- | SmartDeviceLink/SDLProxy.m | 2 | ||||
-rw-r--r-- | SmartDeviceLink/SDLStreamingMediaLifecycleManager.m | 7 | ||||
-rw-r--r-- | SmartDeviceLinkSwift/Info.plist | 2 | ||||
-rw-r--r-- | SmartDeviceLink_Example/Info.plist | 2 |
12 files changed, 58 insertions, 47 deletions
diff --git a/.swift-version b/.swift-version new file mode 100644 index 000000000..5186d0706 --- /dev/null +++ b/.swift-version @@ -0,0 +1 @@ +4.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index c3da178d4..848fef0eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# 5.0.0 Release Candidate 2 (changes since RC 1) +### Bug Fixes +* Fixed podspec +* Focus manager will only activate on iOS 9+, it uses APIs only available on iOS 9+ + # 5.0.0 Release Notes ### Breaking Changes * `SDLProxy.streamingMediaManager` is now removed. If you wish to use a streaming media manager, you must use `SDLManager.streamingMediaManager`. The streaming media manager has been entirely redesigned and now takes into account both phone and head unit app lifecycles [SDL-0033](https://github.com/smartdevicelink/sdl_ios/issues/583). There is now a streaming media configuration added to `SDLConfiguration`. @@ -44,7 +44,7 @@ You can install this library using [Cocoapods](https://cocoapods.org/pods/SmartD In your podfile, you want to add `pod 'SmartDeviceLink', '~> 5.0'`. Then run `pod install` inside your terminal. With Cocoapods, we support iOS 8.0+. ###### Swift -If you are building a Swift app, then add this instead `pod 'SmartDeviceLink-iOS/Swift', '~> 2.0'`. Then run `pod install` in your terminal. +If you are building a Swift app, then add this instead `pod 'SmartDeviceLink-iOS/Swift', '~> 5.0'`. Then run `pod install` in your terminal. ##### Carthage diff --git a/SmartDeviceLink-iOS.podspec b/SmartDeviceLink-iOS.podspec index c70d63493..fc5374ec4 100644 --- a/SmartDeviceLink-iOS.podspec +++ b/SmartDeviceLink-iOS.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "SmartDeviceLink-iOS" -s.version = "5.0.0-rc.1" +s.version = "5.0.0-rc.2" s.summary = "Connect your app with cars!" s.homepage = "https://github.com/smartdevicelink/SmartDeviceLink-iOS" s.license = { :type => "New BSD", :file => "LICENSE" } @@ -45,6 +45,7 @@ ss.public_header_files = [ 'SmartDeviceLink/SDLButtonCapabilities.h', 'SmartDeviceLink/SDLButtonEventMode.h', 'SmartDeviceLink/SDLButtonName.h', +'SmartDeviceLink/SDLButtonPress.h', 'SmartDeviceLink/SDLButtonPressMode.h', 'SmartDeviceLink/SDLCarModeStatus.h', 'SmartDeviceLink/SDLChangeRegistration.h', @@ -336,9 +337,4 @@ ss.public_header_files = [ ] end -s.subspec 'Swift' do |ss| -ss.dependency 'SmartDeviceLink-iOS/Default' -ss.source_files = 'SmartDeviceLinkSwift/*.swift' -end - end diff --git a/SmartDeviceLink.podspec b/SmartDeviceLink.podspec index 530963e9f..2f9abc98f 100644 --- a/SmartDeviceLink.podspec +++ b/SmartDeviceLink.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "SmartDeviceLink" -s.version = "5.0.0-rc.1" +s.version = "5.0.0-rc.2" s.summary = "Connect your app with cars!" s.homepage = "https://github.com/smartdevicelink/SmartDeviceLink-iOS" s.license = { :type => "New BSD", :file => "LICENSE" } @@ -28,7 +28,6 @@ ss.public_header_files = [ 'SmartDeviceLink/SDLAirbagStatus.h', 'SmartDeviceLink/SDLAlert.h', 'SmartDeviceLink/SDLAlertManeuver.h', -'SmartDeviceLink/SDLButtonPress.h', 'SmartDeviceLink/SDLAlertManeuverResponse.h', 'SmartDeviceLink/SDLAlertResponse.h', 'SmartDeviceLink/SDLButtonPressResponse.h', @@ -46,6 +45,7 @@ ss.public_header_files = [ 'SmartDeviceLink/SDLButtonCapabilities.h', 'SmartDeviceLink/SDLButtonEventMode.h', 'SmartDeviceLink/SDLButtonName.h', +'SmartDeviceLink/SDLButtonPress.h', 'SmartDeviceLink/SDLButtonPressMode.h', 'SmartDeviceLink/SDLCarModeStatus.h', 'SmartDeviceLink/SDLChangeRegistration.h', diff --git a/SmartDeviceLink/Info.plist b/SmartDeviceLink/Info.plist index 07647dc1c..6301a85d0 100644 --- a/SmartDeviceLink/Info.plist +++ b/SmartDeviceLink/Info.plist @@ -15,7 +15,7 @@ <key>CFBundlePackageType</key> <string>FMWK</string> <key>CFBundleShortVersionString</key> - <string>5.0.0-rc.1</string> + <string>5.0.0-rc.2</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> diff --git a/SmartDeviceLink/SDLFocusableItemLocator.m b/SmartDeviceLink/SDLFocusableItemLocator.m index c4b22103a..391f43178 100644 --- a/SmartDeviceLink/SDLFocusableItemLocator.m +++ b/SmartDeviceLink/SDLFocusableItemLocator.m @@ -53,16 +53,18 @@ NS_ASSUME_NONNULL_BEGIN } - (void)updateInterfaceLayout { - self.focusableViews = [[NSMutableArray alloc] init]; - [self sdl_parseViewHierarchy:self.projectionWindow.subviews.lastObject]; - - // If there is a preferred view bring that into top of the array - NSUInteger preferredViewIndex = [self.focusableViews indexOfObject:self.projectionWindow.subviews.lastObject.preferredFocusedView]; - if (preferredViewIndex != NSNotFound && self.focusableViews.count > 1) { - [self.focusableViews exchangeObjectAtIndex:preferredViewIndex withObjectAtIndex:0]; - } + if (@available(iOS 9.0, *)) { + self.focusableViews = [[NSMutableArray alloc] init]; + [self sdl_parseViewHierarchy:self.projectionWindow.subviews.lastObject]; + + // If there is a preferred view bring that into top of the array + NSUInteger preferredViewIndex = [self.focusableViews indexOfObject:self.projectionWindow.subviews.lastObject.preferredFocusedView]; + if (preferredViewIndex != NSNotFound && self.focusableViews.count > 1) { + [self.focusableViews exchangeObjectAtIndex:preferredViewIndex withObjectAtIndex:0]; + } - [self sdl_sendHapticRPC]; + [self sdl_sendHapticRPC]; + } } /** @@ -75,25 +77,27 @@ NS_ASSUME_NONNULL_BEGIN SDLLogW(@"Error: Cannot parse nil view"); return; } - - NSArray *focusableSubviews = [currentView.subviews filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(UIView * _Nullable evaluatedObject, NSDictionary<NSString *,id> * _Nullable bindings) { - return (evaluatedObject.canBecomeFocused || [evaluatedObject isKindOfClass:[UIButton class]]); - }]]; - - BOOL isButton = [currentView isKindOfClass:[UIButton class]]; - if ((currentView.canBecomeFocused || isButton) && focusableSubviews.count == 0) { - //if current view is focusable and it doesn't have any focusable sub views then add the current view and return - [self.focusableViews addObject:currentView]; - return; - } else if (currentView.subviews.count > 0) { - // if current view has focusable sub views parse them recursively - NSArray<UIView *> *subviews = currentView.subviews; - - for (UIView *childView in subviews) { - [self sdl_parseViewHierarchy:childView]; + + if (@available(iOS 9.0, *)) { + NSArray *focusableSubviews = [currentView.subviews filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(UIView * _Nullable evaluatedObject, NSDictionary<NSString *,id> * _Nullable bindings) { + return (evaluatedObject.canBecomeFocused || [evaluatedObject isKindOfClass:[UIButton class]]); + }]]; + + BOOL isButton = [currentView isKindOfClass:[UIButton class]]; + if ((currentView.canBecomeFocused || isButton) && focusableSubviews.count == 0) { + //if current view is focusable and it doesn't have any focusable sub views then add the current view and return + [self.focusableViews addObject:currentView]; + return; + } else if (currentView.subviews.count > 0) { + // if current view has focusable sub views parse them recursively + NSArray<UIView *> *subviews = currentView.subviews; + + for (UIView *childView in subviews) { + [self sdl_parseViewHierarchy:childView]; + } + } else { + return; } - } else { - return; } } diff --git a/SmartDeviceLink/SDLLogTargetOSLog.m b/SmartDeviceLink/SDLLogTargetOSLog.m index 425582577..e5d87c293 100644 --- a/SmartDeviceLink/SDLLogTargetOSLog.m +++ b/SmartDeviceLink/SDLLogTargetOSLog.m @@ -45,12 +45,14 @@ NS_ASSUME_NONNULL_BEGIN } - (void)logWithLog:(SDLLogModel *)log formattedLog:(NSString *)stringLog { - NSString *moduleName = log.moduleName ? log.moduleName : @""; - if (self.clients[moduleName] == nil) { - self.clients[moduleName] = os_log_create("com.sdl.log", moduleName.UTF8String); - } + if (@available(iOS 10.0, *)) { + NSString *moduleName = log.moduleName ? log.moduleName : @""; + if (self.clients[moduleName] == nil) { + self.clients[moduleName] = os_log_create("com.sdl.log", moduleName.UTF8String); + } - os_log_with_type(self.clients[moduleName], [self oslogLevelForSDLLogLevel:log.level], "%{public}@", log.message); + os_log_with_type(self.clients[moduleName], [self oslogLevelForSDLLogLevel:log.level], "%{public}@", log.message); + } } - (void)teardownLogger { diff --git a/SmartDeviceLink/SDLProxy.m b/SmartDeviceLink/SDLProxy.m index d16b79d09..24e5a76bd 100644 --- a/SmartDeviceLink/SDLProxy.m +++ b/SmartDeviceLink/SDLProxy.m @@ -41,7 +41,7 @@ typedef NSString SDLVehicleMake; typedef void (^URLSessionTaskCompletionHandler)(NSData *data, NSURLResponse *response, NSError *error); typedef void (^URLSessionDownloadTaskCompletionHandler)(NSURL *location, NSURLResponse *response, NSError *error); -NSString *const SDLProxyVersion = @"5.0.0-rc.1"; +NSString *const SDLProxyVersion = @"5.0.0-rc.2"; const float StartSessionTime = 10.0; const float NotifyProxyClosedDelay = 0.1; const int PoliciesCorrelationId = 65535; diff --git a/SmartDeviceLink/SDLStreamingMediaLifecycleManager.m b/SmartDeviceLink/SDLStreamingMediaLifecycleManager.m index 638419701..82999c973 100644 --- a/SmartDeviceLink/SDLStreamingMediaLifecycleManager.m +++ b/SmartDeviceLink/SDLStreamingMediaLifecycleManager.m @@ -107,9 +107,12 @@ typedef void(^SDLVideoCapabilityResponseHandler)(SDLVideoStreamingCapability *_N SDLLogV(@"Creating StreamingLifecycleManager"); _connectionManager = connectionManager; - if (configuration.window != nil) { - _focusableItemManager = [[SDLFocusableItemLocator alloc] initWithWindow:configuration.window connectionManager:_connectionManager]; + if (@available(iOS 9.0, *)) { + if (configuration.window != nil) { + _focusableItemManager = [[SDLFocusableItemLocator alloc] initWithWindow:configuration.window connectionManager:_connectionManager]; + } } + _touchManager = [[SDLTouchManager alloc] initWithHitTester:(id)_focusableItemManager]; _videoEncoderSettings = configuration.customVideoEncoderSettings ?: SDLH264VideoEncoder.defaultVideoEncoderSettings; diff --git a/SmartDeviceLinkSwift/Info.plist b/SmartDeviceLinkSwift/Info.plist index ffc483be8..53d86fe8c 100644 --- a/SmartDeviceLinkSwift/Info.plist +++ b/SmartDeviceLinkSwift/Info.plist @@ -15,7 +15,7 @@ <key>CFBundlePackageType</key> <string>FMWK</string> <key>CFBundleShortVersionString</key> - <string>2.0-rc.1</string> + <string>2.0-rc.2</string> <key>CFBundleVersion</key> <string>$(CURRENT_PROJECT_VERSION)</string> <key>NSPrincipalClass</key> diff --git a/SmartDeviceLink_Example/Info.plist b/SmartDeviceLink_Example/Info.plist index 9be60deb1..938661bf1 100644 --- a/SmartDeviceLink_Example/Info.plist +++ b/SmartDeviceLink_Example/Info.plist @@ -15,7 +15,7 @@ <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> - <string>5.0.0-rc.1</string> + <string>5.0.0-rc.2</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> |