1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-10 23:08:59 +00:00

updated add_to_app sample to pigeon 1.0 (#894)

This commit is contained in:
gaaclarke
2021-09-08 11:07:11 -07:00
committed by GitHub
parent 69abb6146a
commit e43698fa01
10 changed files with 673 additions and 184 deletions

View File

@@ -103,7 +103,7 @@ class ViewController: UITableViewController, BKHostBookApi {
let flutterViewController = FlutterViewController.init(
engine: appDelegate.engine, nibName: nil, bundle: nil)
self.editingIndex = index
api.displayBookDetails(self.books[index]) { (error) in
api.displayBookDetailsBook(self.books[index]) { (error) in
if let error = error {
print(error)
}
@@ -114,7 +114,7 @@ class ViewController: UITableViewController, BKHostBookApi {
/**
Called by Pigeon when the FlutterViewController is dismissed without accepting any edits.
*/
func cancel(_ error: AutoreleasingUnsafeMutablePointer<FlutterError?>) {
func cancelWithError(_ error: AutoreleasingUnsafeMutablePointer<FlutterError?>) {
self.editingIndex = -1
self.dismiss(animated: true, completion: nil)
}
@@ -122,7 +122,7 @@ class ViewController: UITableViewController, BKHostBookApi {
/**
Called by Pigeon when edits to the book are accepted in the FlutterViewController.
*/
func finishEditing(_ input: BKBook, error: AutoreleasingUnsafeMutablePointer<FlutterError?>) {
func finishEditingBook(_ input: BKBook, error: AutoreleasingUnsafeMutablePointer<FlutterError?>) {
self.books[editingIndex] = input
self.tableView.reloadData()
self.editingIndex = -1