aboutsummaryrefslogtreecommitdiff
path: root/Taler
diff options
context:
space:
mode:
authorJonathan Buchanan <jonathan.russ.buchanan@gmail.com>2022-07-20 23:14:19 -0400
committerJonathan Buchanan <jonathan.russ.buchanan@gmail.com>2022-07-20 23:14:19 -0400
commit0d69608a0ff3b50889fc77a3576e9af7a2694b1e (patch)
tree20ac995e8d5cf6ffff51c2d6fa6dff7f1596ea63 /Taler
parent997a0f359a4b731a9271977c4323e6524eec045c (diff)
downloadtaler-ios-0d69608a0ff3b50889fc77a3576e9af7a2694b1e.tar.gz
taler-ios-0d69608a0ff3b50889fc77a3576e9af7a2694b1e.tar.bz2
taler-ios-0d69608a0ff3b50889fc77a3576e9af7a2694b1e.zip
rudimentary sidebar
Diffstat (limited to 'Taler')
-rw-r--r--Taler/AppDelegate.swift40
-rw-r--r--Taler/ContentView.swift59
-rw-r--r--Taler/Info.plist21
-rw-r--r--Taler/SceneDelegate.swift69
-rw-r--r--Taler/TalerApp.swift26
5 files changed, 91 insertions, 124 deletions
diff --git a/Taler/AppDelegate.swift b/Taler/AppDelegate.swift
deleted file mode 100644
index 055475a..0000000
--- a/Taler/AppDelegate.swift
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * This file is part of GNU Taler
- * (C) 2021 Taler Systems S.A.
- *
- * GNU Taler is free software; you can redistribute it and/or modify it under the
- * terms of the GNU General Public License as published by the Free Software
- * Foundation; either version 3, or (at your option) any later version.
- *
- * GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
- * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
- */
-
-import UIKit
-import iono
-
-@UIApplicationMain
-class AppDelegate: UIResponder, UIApplicationDelegate {
- func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
- // Override point for customization after application launch.
- return true
- }
-
- // MARK: UISceneSession Lifecycle
-
- func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
- // Called when a new scene session is being created.
- // Use this method to select a configuration to create the new scene with.
- return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
- }
-
- func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
- // Called when the user discards a scene session.
- // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
- // Use this method to release any resources that were specific to the discarded scenes, as they will not return.
- }
-}
diff --git a/Taler/ContentView.swift b/Taler/ContentView.swift
new file mode 100644
index 0000000..0eb1477
--- /dev/null
+++ b/Taler/ContentView.swift
@@ -0,0 +1,59 @@
+//
+// ContentView.swift
+// Taler
+//
+// Created by Jonathan Buchanan on 7/20/22.
+// Copyright © 2022 Taler. All rights reserved.
+//
+
+import SwiftUI
+
+struct SidebarView: View {
+ var onClose: () -> Void
+
+ init(_onClose: @escaping () -> Void) {
+ self.onClose = _onClose
+ }
+
+ var body: some View {
+ VStack {
+ Button(action: self.onClose) {
+ Text("Close")
+ }
+ Divider()
+ Text("Hello, World!")
+ Divider()
+ Spacer()
+ }
+ .background(Color.gray)
+ }
+}
+
+struct ContentView: View {
+ @State var sidebarVisible: Bool = false
+
+ var body: some View {
+ ZStack(alignment: .leading) {
+
+ Button {
+ sidebarVisible = !sidebarVisible
+ } label: {
+ Text("dothething")
+ }
+ .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .center)
+
+ SidebarView {
+ self.sidebarVisible = false
+ }
+ .frame(width: 100, alignment: .center)
+ .offset(x: sidebarVisible ? 0 : -100)
+ .animation(.easeInOut, value: sidebarVisible)
+ }
+ }
+}
+
+struct ContentView_Previews: PreviewProvider {
+ static var previews: some View {
+ ContentView()
+ }
+}
diff --git a/Taler/Info.plist b/Taler/Info.plist
index 2e34cc0..14a59ff 100644
--- a/Taler/Info.plist
+++ b/Taler/Info.plist
@@ -23,22 +23,13 @@
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
- <false/>
- <key>UISceneConfigurations</key>
- <dict>
- <key>UIWindowSceneSessionRoleApplication</key>
- <array>
- <dict>
- <key>UISceneConfigurationName</key>
- <string>Default Configuration</string>
- <key>UISceneDelegateClassName</key>
- <string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
- </dict>
- </array>
- </dict>
+ <true/>
+ </dict>
+ <key>UILaunchScreen</key>
+ <dict>
+ <key>UIImageName</key>
+ <string></string>
</dict>
- <key>UILaunchStoryboardName</key>
- <string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
diff --git a/Taler/SceneDelegate.swift b/Taler/SceneDelegate.swift
deleted file mode 100644
index 79b086e..0000000
--- a/Taler/SceneDelegate.swift
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * This file is part of GNU Taler
- * (C) 2021 Taler Systems S.A.
- *
- * GNU Taler is free software; you can redistribute it and/or modify it under the
- * terms of the GNU General Public License as published by the Free Software
- * Foundation; either version 3, or (at your option) any later version.
- *
- * GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
- * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
- */
-
-import UIKit
-import SwiftUI
-
-class SceneDelegate: UIResponder, UIWindowSceneDelegate {
-
- var window: UIWindow?
-
-
- func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
- // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
- // If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
- // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
-
- // Use a UIHostingController as window root view controller.
- if let windowScene = scene as? UIWindowScene {
- /*let window = UIWindow(windowScene: windowScene)
- window.rootViewController = UIHostingController(rootView: /* */)
- self.window = window
- window.makeKeyAndVisible()*/
- }
- }
-
- func sceneDidDisconnect(_ scene: UIScene) {
- // Called as the scene is being released by the system.
- // This occurs shortly after the scene enters the background, or when its session is discarded.
- // Release any resources associated with this scene that can be re-created the next time the scene connects.
- // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead).
- }
-
- func sceneDidBecomeActive(_ scene: UIScene) {
- // Called when the scene has moved from an inactive state to an active state.
- // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
- }
-
- func sceneWillResignActive(_ scene: UIScene) {
- // Called when the scene will move from an active state to an inactive state.
- // This may occur due to temporary interruptions (ex. an incoming phone call).
- }
-
- func sceneWillEnterForeground(_ scene: UIScene) {
- // Called as the scene transitions from the background to the foreground.
- // Use this method to undo the changes made on entering the background.
- }
-
- func sceneDidEnterBackground(_ scene: UIScene) {
- // Called as the scene transitions from the foreground to the background.
- // Use this method to save data, release shared resources, and store enough scene-specific state information
- // to restore the scene back to its current state.
- }
-
-
-}
-
diff --git a/Taler/TalerApp.swift b/Taler/TalerApp.swift
new file mode 100644
index 0000000..2eb3154
--- /dev/null
+++ b/Taler/TalerApp.swift
@@ -0,0 +1,26 @@
+/*
+ * This file is part of GNU Taler
+ * (C) 2021 Taler Systems S.A.
+ *
+ * GNU Taler is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 3, or (at your option) any later version.
+ *
+ * GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+ */
+
+import SwiftUI
+
+@main
+struct TalerApp: App {
+ var body: some Scene {
+ WindowGroup {
+ ContentView()
+ }
+ }
+}