From 922785f8a88efe8086ef2f564e50c44aa57aa07b Mon Sep 17 00:00:00 2001 From: "James D. Lin" Date: Thu, 2 Aug 2018 14:03:42 -0700 Subject: [PATCH] Add an explicit `-[FlutterViewController init]` implementation (flutter/engine#5924) * Add an explicit `-[FlutterViewController init]` implementation `-[FlutterViewController init]` currently works because it inherits the `-[UIViewController init]` convenience initializer that invokes the `-[UIViewController initWithNibName:bundle:]` designated initializer that `FlutterViewController` overrides. However, this doesn't seem to be explicitly documented, so it's a bit confusing (or at least non-obvious), and it seems potentially brittle. Add an explicit implementation of `-[FlutterViewController init]` instead. --- .../darwin/ios/framework/Source/FlutterViewController.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm index 2839ece8c0..16ded625da 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm @@ -84,6 +84,10 @@ return [self initWithProject:nil nibName:nil bundle:nil]; } +- (instancetype)init { + return [self initWithProject:nil nibName:nil bundle:nil]; +} + #pragma mark - Common view controller initialization tasks - (void)performCommonViewControllerInitialization {