diff options
author | Kujtim Shala <kshala@ford.com> | 2019-09-13 19:51:39 +0200 |
---|---|---|
committer | Kujtim Shala <kshala@ford.com> | 2019-09-13 19:51:39 +0200 |
commit | ce156b1ace4685978e90941ac3870910f9913242 (patch) | |
tree | ecae98516fabda09204e9587144ec20896697cbb /Example Apps/Example Swift/ProxyManager.swift | |
parent | f265d4f0708b7e7e3432cb1fd8236f51f0bb8e0e (diff) | |
download | sdl_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.swift | 20 |
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 } } |