mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00

* Fix xcode_backend.sh script to support add2app * Fix ios deployment target. Too old for new Xcode. * Fix ios host app * Register plugins with Flutter view
26 lines
898 B
Objective-C
26 lines
898 B
Objective-C
#import "ViewController.h"
|
|
#import "Flutter/Flutter.h"
|
|
#import "FlutterPluginRegistrant/GeneratedPluginRegistrant.h"
|
|
|
|
@implementation ViewController
|
|
|
|
- (void)viewDidLoad {
|
|
[super viewDidLoad];
|
|
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
[button addTarget:self
|
|
action:@selector(handleButtonAction)
|
|
forControlEvents:UIControlEventTouchUpInside];
|
|
[button setTitle:@"Press me" forState:UIControlStateNormal];
|
|
[button setBackgroundColor:[UIColor blueColor]];
|
|
button.frame = CGRectMake(80.0, 210.0, 160.0, 40.0);
|
|
[self.view addSubview:button];
|
|
}
|
|
|
|
- (void)handleButtonAction {
|
|
FlutterViewController* flutterViewController = [[FlutterViewController alloc] init];
|
|
[GeneratedPluginRegistrant registerWithRegistry:flutterViewController];
|
|
[self presentViewController:flutterViewController animated:false completion:nil];
|
|
}
|
|
|
|
@end
|