提交 2b7a8f14 编写于 作者: S Sarah Zakarias 提交者: GitHub

Add flutter-driven navigation on iOS (#3865)

上级 27dfd06f
......@@ -24,6 +24,7 @@ shared_library("flutter_framework_dylib") {
"framework/Headers/FlutterMacros.h",
"framework/Headers/FlutterPlugin.h",
"framework/Headers/FlutterViewController.h",
"framework/Headers/FlutterNavigationController.h",
"framework/Source/FlutterAppDelegate.mm",
"framework/Source/FlutterChannels.mm",
"framework/Source/FlutterCodecs.mm",
......@@ -41,6 +42,7 @@ shared_library("flutter_framework_dylib") {
"framework/Source/FlutterView.h",
"framework/Source/FlutterView.mm",
"framework/Source/FlutterViewController.mm",
"framework/Source/FlutterNavigationController.mm",
"framework/Source/accessibility_bridge.h",
"framework/Source/accessibility_bridge.mm",
"framework/Source/flutter_main_ios.h",
......@@ -165,6 +167,7 @@ copy("framework_headers") {
"framework/Headers/FlutterMacros.h",
"framework/Headers/FlutterPlugin.h",
"framework/Headers/FlutterViewController.h",
"framework/Headers/FlutterNavigationController.h",
]
outputs = [
"$_flutter_framework_dir/Headers/{{source_file_part}}",
......
......@@ -13,5 +13,6 @@
#include "FlutterMacros.h"
#include "FlutterPlugin.h"
#include "FlutterViewController.h"
#include "FlutterNavigationController.h"
#endif // FLUTTER_FLUTTER_H_
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import <UIKit/UIKit.h>
@interface FlutterNavigationController: UINavigationController
@end
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import "flutter/shell/platform/darwin/ios/framework/Headers/FlutterNavigationController.h"
@implementation FlutterNavigationController
- (void) viewWillAppear:(BOOL)animated {
[self setNavigationBarHidden:YES];
[super viewWillAppear:animated];
}
@end
......@@ -151,7 +151,13 @@ using namespace shell;
}
- (void)popSystemNavigator {
// Apple's human user guidelines say not to terminate iOS applications.
// Apple's human user guidelines say not to terminate iOS applications. However, if the
// root view of the app is a navigation controller, it is instructed to back up a level
// in the navigation hierarchy.
UIViewController* viewController = [UIApplication sharedApplication].keyWindow.rootViewController;
if ([viewController isKindOfClass:[UINavigationController class]]) {
[((UINavigationController*)viewController) popViewControllerAnimated:NO];
}
}
- (NSDictionary*)getClipboardData:(NSString*)format {
......
......@@ -1458,9 +1458,11 @@ FILE: ../../../flutter/shell/platform/android/platform_view_android_jni.h
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/FlutterBinaryMessenger.h
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/FlutterChannels.h
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/FlutterCodecs.h
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/FlutterNavigationController.h
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterChannels.mm
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterCodecs.mm
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterNavigationController.mm
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterStandardCodec.mm
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterStandardCodec_Internal.h
FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/flutter_codecs_unittest.mm
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册