Skip to content

Commit 2e4bbb7

Browse files
authored
[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: flutter/flutter#132028
1 parent 2eee0b5 commit 2e4bbb7

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

examples/platform_view/ios/Runner/Base.lproj/Main.storyboard

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
</constraints>
130130
</view>
131131
<connections>
132-
<outlet property="incrementLabel" destination="qaB-rs-mWp" id="bFY-of-WoI"/>
132+
<outlet property="countLabel" destination="qaB-rs-mWp" id="bFY-of-WoI"/>
133133
<outlet property="incrementButton" destination="6yL-sX-bUL" id="aQR-ap-BrT"/>
134134
</connections>
135135
</viewController>

examples/platform_view/ios/Runner/PlatformViewController.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,30 @@
77
#import <Foundation/Foundation.h>
88

99
@interface PlatformViewController ()
10-
@property(weak, nonatomic) IBOutlet UILabel* incrementLabel;
10+
@property(weak, nonatomic) IBOutlet UILabel* countLabel;
1111
@end
1212

1313
@implementation PlatformViewController
1414

1515
- (void)viewDidLoad {
1616
[super viewDidLoad];
17-
[self setIncrementLabelText];
17+
[self updateCountLabelText];
1818
}
1919

2020
- (IBAction)handleIncrement:(id)sender {
2121
self.counter++;
22-
[self setIncrementLabelText];
22+
[self updateCountLabelText];
2323
}
2424

2525
- (IBAction)switchToFlutterView:(id)sender {
2626
[self.delegate didUpdateCounter:self.counter];
2727
[self dismissViewControllerAnimated:NO completion:nil];
2828
}
2929

30-
- (void)setIncrementLabelText {
30+
- (void)updateCountLabelText {
3131
NSString* text = [NSString stringWithFormat:@"Button tapped %d %@.", self.counter,
3232
(self.counter == 1) ? @"time" : @"times"];
33-
self.incrementLabel.text = text;
33+
self.countLabel.text = text;
3434
}
3535

3636
@end

0 commit comments

Comments
 (0)