Unverified Commit 2e4bbb75 authored by Chris Bracken's avatar Chris Bracken Committed by GitHub

[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
parent 2eee0b57
...@@ -129,7 +129,7 @@ ...@@ -129,7 +129,7 @@
</constraints> </constraints>
</view> </view>
<connections> <connections>
<outlet property="incrementLabel" destination="qaB-rs-mWp" id="bFY-of-WoI"/> <outlet property="countLabel" destination="qaB-rs-mWp" id="bFY-of-WoI"/>
<outlet property="incrementButton" destination="6yL-sX-bUL" id="aQR-ap-BrT"/> <outlet property="incrementButton" destination="6yL-sX-bUL" id="aQR-ap-BrT"/>
</connections> </connections>
</viewController> </viewController>
......
...@@ -7,19 +7,19 @@ ...@@ -7,19 +7,19 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
@interface PlatformViewController () @interface PlatformViewController ()
@property(weak, nonatomic) IBOutlet UILabel* incrementLabel; @property(weak, nonatomic) IBOutlet UILabel* countLabel;
@end @end
@implementation PlatformViewController @implementation PlatformViewController
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
[self setIncrementLabelText]; [self updateCountLabelText];
} }
- (IBAction)handleIncrement:(id)sender { - (IBAction)handleIncrement:(id)sender {
self.counter++; self.counter++;
[self setIncrementLabelText]; [self updateCountLabelText];
} }
- (IBAction)switchToFlutterView:(id)sender { - (IBAction)switchToFlutterView:(id)sender {
...@@ -27,10 +27,10 @@ ...@@ -27,10 +27,10 @@
[self dismissViewControllerAnimated:NO completion:nil]; [self dismissViewControllerAnimated:NO completion:nil];
} }
- (void)setIncrementLabelText { - (void)updateCountLabelText {
NSString* text = [NSString stringWithFormat:@"Button tapped %d %@.", self.counter, NSString* text = [NSString stringWithFormat:@"Button tapped %d %@.", self.counter,
(self.counter == 1) ? @"time" : @"times"]; (self.counter == 1) ? @"time" : @"times"];
self.incrementLabel.text = text; self.countLabel.text = text;
} }
@end @end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment