From 8c7f2d68075a74f20093c7fb0bb6b2a54ff3457c Mon Sep 17 00:00:00 2001 From: Justin Beharry Date: Wed, 3 Aug 2022 12:55:53 -0400 Subject: Make get buttons into a variable and create a getter --- Example Apps/Example ObjC/RemoteControlManager.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Example Apps') diff --git a/Example Apps/Example ObjC/RemoteControlManager.m b/Example Apps/Example ObjC/RemoteControlManager.m index d30cb9ad7..ef9f8efd9 100644 --- a/Example Apps/Example ObjC/RemoteControlManager.m +++ b/Example Apps/Example ObjC/RemoteControlManager.m @@ -35,6 +35,7 @@ @property (strong, nonatomic) NSNumber *hasConsent; @property (strong, nonatomic) SDLClimateControlData *climateData; @property (copy, nonatomic, readwrite) NSString *climateDataString; +@property (strong, nonatomic, readonly) NSArray *remoteButtons; @end @@ -83,7 +84,7 @@ NSString *errorMessage = @"The climate module id was not set or consent was not given"; [AlertManager sendAlertWithManager:self.sdlManager image:nil textField1:errorMessage textField2:nil]; } - self.sdlManager.screenManager.softButtonObjects = [self sdlex_getButtons]; + self.sdlManager.screenManager.softButtonObjects = self.remoteButtons; } - (NSString *)climateDataString { @@ -194,7 +195,7 @@ }]; } -- (NSArray*)sdlex_getButtons { +- (NSArray *)remoteButtons { SDLSoftButtonObject *acOnButton = [[SDLSoftButtonObject alloc] initWithName:@"AC On" text:@"AC On" artwork:nil handler:^(SDLOnButtonPress * _Nullable buttonPress, SDLOnButtonEvent * _Nullable buttonEvent) { if (buttonPress == nil) { return; } [self sdlex_turnOnAC]; -- cgit v1.2.1