From 2e4bbb75031fc087c97d0abc7f7fb112c9a8a65a Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Tue, 27 Feb 2024 14:49:09 -0800 Subject: [PATCH] [iOS] Fix naming in platform_view example (#144247) This applies minor cosmetic cleanups noticed while landing fix/tests in another patch. Renames `incrementLabel` to `countLabel` and `setIncrementLabel` to `updateCountLabel`, since it's not setting it to a specific value but rather updating itself based on the current state of the `count` ivar. No tests since this patch introduces no semantic changes. Related: https://github.com/flutter/flutter/pull/132028 --- .../ios/Runner/Base.lproj/Main.storyboard | 2 +- .../platform_view/ios/Runner/PlatformViewController.m | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/platform_view/ios/Runner/Base.lproj/Main.storyboard b/examples/platform_view/ios/Runner/Base.lproj/Main.storyboard index 683d7d0f625..14d6e6d8fac 100644 --- a/examples/platform_view/ios/Runner/Base.lproj/Main.storyboard +++ b/examples/platform_view/ios/Runner/Base.lproj/Main.storyboard @@ -129,7 +129,7 @@ - + diff --git a/examples/platform_view/ios/Runner/PlatformViewController.m b/examples/platform_view/ios/Runner/PlatformViewController.m index 6e813af0e15..cfa647f6d81 100644 --- a/examples/platform_view/ios/Runner/PlatformViewController.m +++ b/examples/platform_view/ios/Runner/PlatformViewController.m @@ -7,19 +7,19 @@ #import @interface PlatformViewController () -@property(weak, nonatomic) IBOutlet UILabel* incrementLabel; +@property(weak, nonatomic) IBOutlet UILabel* countLabel; @end @implementation PlatformViewController - (void)viewDidLoad { [super viewDidLoad]; - [self setIncrementLabelText]; + [self updateCountLabelText]; } - (IBAction)handleIncrement:(id)sender { self.counter++; - [self setIncrementLabelText]; + [self updateCountLabelText]; } - (IBAction)switchToFlutterView:(id)sender { @@ -27,10 +27,10 @@ [self dismissViewControllerAnimated:NO completion:nil]; } -- (void)setIncrementLabelText { +- (void)updateCountLabelText { NSString* text = [NSString stringWithFormat:@"Button tapped %d %@.", self.counter, (self.counter == 1) ? @"time" : @"times"]; - self.incrementLabel.text = text; + self.countLabel.text = text; } @end