mirror of
https://github.com/flutter/samples.git
synced 2026-07-16 22:12:42 +00:00
Added iOS example for add-to-app Pigeon (#722)
This commit is contained in:
37
add_to_app/books/ios_books/IosBooks/AppDelegate.swift
Normal file
37
add_to_app/books/ios_books/IosBooks/AppDelegate.swift
Normal file
@@ -0,0 +1,37 @@
|
||||
// Copyright 2020 The Flutter team. 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
|
||||
import UIKit
|
||||
|
||||
@main
|
||||
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
lazy var engine: FlutterEngine = {
|
||||
let result = FlutterEngine.init(name: "Books")
|
||||
// This could be `run` earlier in the app to avoid the overhead of doing it the first time the
|
||||
// engine is needed.
|
||||
result.run()
|
||||
return result
|
||||
}()
|
||||
|
||||
func application(
|
||||
_ application: UIApplication,
|
||||
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
||||
) -> Bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func application(
|
||||
_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession,
|
||||
options: UIScene.ConnectionOptions
|
||||
) -> UISceneConfiguration {
|
||||
return UISceneConfiguration(
|
||||
name: "Default Configuration", sessionRole: connectingSceneSession.role)
|
||||
}
|
||||
|
||||
func application(
|
||||
_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>
|
||||
) {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user