diff options
Diffstat (limited to 'Example Apps/Example Swift/ProxyManager.swift')
-rw-r--r-- | Example Apps/Example Swift/ProxyManager.swift | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Example Apps/Example Swift/ProxyManager.swift b/Example Apps/Example Swift/ProxyManager.swift index 9cbee5d6b..efd364784 100644 --- a/Example Apps/Example Swift/ProxyManager.swift +++ b/Example Apps/Example Swift/ProxyManager.swift @@ -46,7 +46,8 @@ extension ProxyManager { /// - Parameter connectionType: The type of transport layer to use. func start(with proxyTransportType: ProxyTransportType) { delegate?.didChangeProxyState(ProxyState.searching) - sdlManager = SDLManager(configuration: proxyTransportType == .iap ? ProxyManager.connectIAP() : ProxyManager.connectTCP(), delegate: self) + + sdlManager = SDLManager(configuration: (proxyTransportType == .iap) ? ProxyManager.iapConfiguration : ProxyManager.tcpConfiguration, delegate: self) startManager() } @@ -71,7 +72,7 @@ private extension ProxyManager { /// Configures an iAP transport layer. /// /// - Returns: A SDLConfiguration object - class func connectIAP() -> SDLConfiguration { + class var iapConfiguration: SDLConfiguration { let lifecycleConfiguration = SDLLifecycleConfiguration(appName: ExampleAppName, fullAppId: ExampleFullAppId) return setupManagerConfiguration(with: lifecycleConfiguration) } @@ -79,7 +80,7 @@ private extension ProxyManager { /// Configures a TCP transport layer with the IP address and port of the remote SDL Core instance. /// /// - Returns: A SDLConfiguration object - class func connectTCP() -> SDLConfiguration { + class var tcpConfiguration: SDLConfiguration { let lifecycleConfiguration = SDLLifecycleConfiguration(appName: ExampleAppName, fullAppId: ExampleFullAppId, ipAddress: AppUserDefaults.shared.ipAddress!, port: UInt16(AppUserDefaults.shared.port!)!) return setupManagerConfiguration(with: lifecycleConfiguration) } @@ -287,12 +288,12 @@ private extension ProxyManager { // Primary graphic if imageFieldSupported(imageFieldName: .graphic) { - screenManager.primaryGraphic = areImagesVisible ? SDLArtwork(image: UIImage(named: ExampleAppLogoName)!.withRenderingMode(.alwaysOriginal), persistent: false, as: .PNG) : nil + screenManager.primaryGraphic = areImagesVisible ? SDLArtwork(image: UIImage(named: ExampleAppLogoName)!.withRenderingMode(.alwaysOriginal), persistent: true, as: .PNG) : nil } // Secondary graphic if imageFieldSupported(imageFieldName: .secondaryGraphic) { - screenManager.secondaryGraphic = areImagesVisible ? SDLArtwork(image: UIImage(named: CarBWIconImageName)!, persistent: false, as: .PNG) : nil + screenManager.secondaryGraphic = areImagesVisible ? SDLArtwork(image: UIImage(named: CarBWIconImageName)!, persistent: true, as: .PNG) : nil } screenManager.endUpdates(completionHandler: { (error) in |