TestNavigationController.m 949 Bytes
Newer Older
Ian Hickson's avatar
Ian Hickson committed
1
// Copyright 2014 The Flutter Authors. All rights reserved.
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#import <Foundation/Foundation.h>
#import "TestNavigationController.h"
#import <Flutter/Flutter.h>

@implementation TestNavigationController

- (void) viewWillAppear:(BOOL)animated {
  [self setNavigationBarHidden:YES animated:NO];
  [super viewWillAppear:animated];
}

- (nullable UIViewController *)popViewControllerAnimated:(BOOL)animated {
  FlutterViewController* root = (FlutterViewController*)[self.viewControllers objectAtIndex:0];
18

19 20 21 22 23 24 25 26 27
  FlutterBasicMessageChannel* messageChannel =
      [FlutterBasicMessageChannel messageChannelWithName:@"navigation-test"
                                         binaryMessenger:root
                                                   codec:[FlutterStringCodec sharedInstance]];
  [messageChannel sendMessage:@"ping"];
  return root;
}

@end