summaryrefslogtreecommitdiff
path: root/Example Apps/Example Swift/ProxyManager.swift
diff options
context:
space:
mode:
authorKujtim Shala <kshala@ford.com>2019-09-13 19:51:39 +0200
committerKujtim Shala <kshala@ford.com>2019-09-13 19:51:39 +0200
commitce156b1ace4685978e90941ac3870910f9913242 (patch)
treeecae98516fabda09204e9587144ec20896697cbb /Example Apps/Example Swift/ProxyManager.swift
parentf265d4f0708b7e7e3432cb1fd8236f51f0bb8e0e (diff)
downloadsdl_ios-ce156b1ace4685978e90941ac3870910f9913242.tar.gz
Refactored the library to use the new display capability
Diffstat (limited to 'Example Apps/Example Swift/ProxyManager.swift')
-rw-r--r--Example Apps/Example Swift/ProxyManager.swift20
1 files changed, 9 insertions, 11 deletions
diff --git a/Example Apps/Example Swift/ProxyManager.swift b/Example Apps/Example Swift/ProxyManager.swift
index 77d4f7976..ac3913955 100644
--- a/Example Apps/Example Swift/ProxyManager.swift
+++ b/Example Apps/Example Swift/ProxyManager.swift
@@ -271,16 +271,14 @@ private extension ProxyManager {
screenManager.textField2 = isTextVisible ? "Swift \(ExampleAppText)" : nil
screenManager.textField3 = isTextVisible ? vehicleDataManager.vehicleOdometerData : nil
- if sdlManager.systemCapabilityManager.displayCapabilities?.graphicSupported.boolValue ?? false {
- // Primary graphic
- if imageFieldSupported(imageFieldName: .graphic) {
- screenManager.primaryGraphic = areImagesVisible ? SDLArtwork(image: UIImage(named: ExampleAppLogoName)!.withRenderingMode(.alwaysOriginal), persistent: false, as: .PNG) : nil
- }
-
- // Secondary graphic
- if imageFieldSupported(imageFieldName: .secondaryGraphic) {
- screenManager.secondaryGraphic = areImagesVisible ? SDLArtwork(image: UIImage(named: CarBWIconImageName)!, persistent: false, as: .PNG) : nil
- }
+ // Primary graphic
+ if imageFieldSupported(imageFieldName: .graphic) {
+ screenManager.primaryGraphic = areImagesVisible ? SDLArtwork(image: UIImage(named: ExampleAppLogoName)!.withRenderingMode(.alwaysOriginal), persistent: false, as: .PNG) : nil
+ }
+
+ // Secondary graphic
+ if imageFieldSupported(imageFieldName: .secondaryGraphic) {
+ screenManager.secondaryGraphic = areImagesVisible ? SDLArtwork(image: UIImage(named: CarBWIconImageName)!, persistent: false, as: .PNG) : nil
}
screenManager.endUpdates(completionHandler: { (error) in
@@ -305,6 +303,6 @@ private extension ProxyManager {
/// - Parameter imageFieldName: The name for the image field
/// - Returns: True if the image field is supported, false if not
func imageFieldSupported(imageFieldName: SDLImageFieldName) -> Bool {
- return sdlManager.systemCapabilityManager.displayCapabilities?.imageFields?.first { $0.name == imageFieldName } != nil ? true : false
+ return sdlManager.systemCapabilityManager.defaultMainWindowCapability?.imageFields?.first { $0.name == imageFieldName } != nil ? true : false
}
}