git ssb

1+

yi / localnative



Tree: 2c1932822a8e06b5876eb875f19924a15ae91539

Files: 2c1932822a8e06b5876eb875f19924a15ae91539 / localnative-ios / ln-ios / AppDelegate.swift

2448 bytesRaw
1/*
2 Local Native
3 Copyright (C) 2018-2019 Yi Wang
4
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Affero General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Affero General Public License for more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <https://www.gnu.org/licenses/>.
17*/
18//
19// AppDelegate.swift
20// ln-ios
21//
22// Created by Yi Wang on 9/16/18.
23//
24
25import UIKit
26import MMWormhole
27let wormhole = MMWormhole(applicationGroupIdentifier: "group.app.localnative.ios", optionalDirectory: "wormhole")
28
29@UIApplicationMain
30class AppDelegate: UIResponder, UIApplicationDelegate {
31
32 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
33 // Override point for customization after application launch.
34 wormhole.listenForMessage(withIdentifier: "message", listener: { (messageObject) -> Void in
35 AppState.ln.run(json_input: messageObject as! String)
36 AppState.search(input: "", offset: 0)
37 })
38 return true
39 }
40
41 // MARK: UISceneSession Lifecycle
42
43 func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
44 // Called when a new scene session is being created.
45 // Use this method to select a configuration to create the new scene with.
46 return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
47 }
48
49 func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
50 // Called when the user discards a scene session.
51 // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
52 // Use this method to release any resources that were specific to the discarded scenes, as they will not return.
53 }
54
55}
56
57

Built with git-ssb-web