Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
joeljfischer committed Oct 31, 2017
2 parents 918be71 + 293fafe commit 804bd41
Show file tree
Hide file tree
Showing 12 changed files with 58 additions and 47 deletions.
1 change: 1 addition & 0 deletions .swift-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4.0
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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`.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 2 additions & 6 deletions SmartDeviceLink-iOS.podspec
Original file line number Diff line number Diff line change
@@ -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" }
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions SmartDeviceLink.podspec
Original file line number Diff line number Diff line change
@@ -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" }
Expand All @@ -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',
Expand All @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion SmartDeviceLink/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
58 changes: 31 additions & 27 deletions SmartDeviceLink/SDLFocusableItemLocator.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,18 @@ - (instancetype)initWithWindow:(UIWindow *)window connectionManager:(id<SDLConne
}

- (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];
}
}

/**
Expand All @@ -75,25 +77,27 @@ - (void)sdl_parseViewHierarchy:(UIView *)currentView {
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;
}
}

Expand Down
12 changes: 7 additions & 5 deletions SmartDeviceLink/SDLLogTargetOSLog.m
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@ - (BOOL)setupLogger {
}

- (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 {
Expand Down
2 changes: 1 addition & 1 deletion SmartDeviceLink/SDLProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
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;
Expand Down
7 changes: 5 additions & 2 deletions SmartDeviceLink/SDLStreamingMediaLifecycleManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,12 @@ - (instancetype)initWithConnectionManager:(id<SDLConnectionManagerType>)connecti
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;
Expand Down
2 changes: 1 addition & 1 deletion SmartDeviceLinkSwift/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion SmartDeviceLink_Example/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 804bd41

Please sign in to comment.