taler-ios

iOS apps for GNU Taler (wallet)
Log | Files | Refs | README | LICENSE

commit 0d69608a0ff3b50889fc77a3576e9af7a2694b1e
parent 997a0f359a4b731a9271977c4323e6524eec045c
Author: Jonathan Buchanan <jonathan.russ.buchanan@gmail.com>
Date:   Wed, 20 Jul 2022 23:14:19 -0400

rudimentary sidebar

Diffstat:
MTaler.xcodeproj/project.pbxproj | 20++++++++++----------
MTaler.xcodeproj/project.xcworkspace/xcuserdata/jonathan.xcuserdatad/UserInterfaceState.xcuserstate | 0
DTaler/AppDelegate.swift | 40----------------------------------------
ATaler/ContentView.swift | 59+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
MTaler/Info.plist | 21++++++---------------
DTaler/SceneDelegate.swift | 69---------------------------------------------------------------------
ATaler/TalerApp.swift | 26++++++++++++++++++++++++++
7 files changed, 101 insertions(+), 134 deletions(-)

diff --git a/Taler.xcodeproj/project.pbxproj b/Taler.xcodeproj/project.pbxproj @@ -7,12 +7,12 @@ objects = { /* Begin PBXBuildFile section */ + AB1F87C82887C94700AB82A0 /* TalerApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB1F87C72887C94700AB82A0 /* TalerApp.swift */; }; + AB1F87CA2887D2F400AB82A0 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB1F87C92887D2F400AB82A0 /* ContentView.swift */; }; AB8C3807286A88A600E0A1DD /* WalletBackendTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB8C3806286A88A500E0A1DD /* WalletBackendTests.swift */; }; ABC13AA32859962800D23185 /* taler-swift in Frameworks */ = {isa = PBXBuildFile; productRef = ABC13AA22859962800D23185 /* taler-swift */; }; ABE97B1D286D82BF00580772 /* AnyCodable in Frameworks */ = {isa = PBXBuildFile; productRef = ABE97B1C286D82BF00580772 /* AnyCodable */; }; D112510026B12E3200D02E00 /* taler-wallet-embedded.js in CopyFiles */ = {isa = PBXBuildFile; fileRef = D11250FF26B12E3200D02E00 /* taler-wallet-embedded.js */; }; - D14AFD2124D232B300C51073 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D14AFD2024D232B300C51073 /* AppDelegate.swift */; }; - D14AFD2324D232B300C51073 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D14AFD2224D232B300C51073 /* SceneDelegate.swift */; }; D14AFD4324D232B500C51073 /* TalerUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D14AFD4224D232B500C51073 /* TalerUITests.swift */; }; D14CE1B226C39E5D00612DBE /* BalanceRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = D14CE1B126C39E5D00612DBE /* BalanceRow.swift */; }; D14CE1B426C3A2D400612DBE /* BalanceList.swift in Sources */ = {isa = PBXBuildFile; fileRef = D14CE1B326C3A2D400612DBE /* BalanceList.swift */; }; @@ -51,12 +51,12 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + AB1F87C72887C94700AB82A0 /* TalerApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TalerApp.swift; sourceTree = "<group>"; }; + AB1F87C92887D2F400AB82A0 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; }; AB710490285995B6008B04F0 /* taler-swift */ = {isa = PBXFileReference; lastKnownFileType = text; path = "taler-swift"; sourceTree = SOURCE_ROOT; }; AB8C3806286A88A500E0A1DD /* WalletBackendTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletBackendTests.swift; sourceTree = "<group>"; }; D11250FF26B12E3200D02E00 /* taler-wallet-embedded.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = "taler-wallet-embedded.js"; sourceTree = "<group>"; }; D14AFD1D24D232B300C51073 /* Taler.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Taler.app; sourceTree = BUILT_PRODUCTS_DIR; }; - D14AFD2024D232B300C51073 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; - D14AFD2224D232B300C51073 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; }; D14AFD2624D232B500C51073 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; D14AFD2C24D232B500C51073 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; }; D14AFD2E24D232B500C51073 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; @@ -125,14 +125,14 @@ D14AFD1F24D232B300C51073 /* Taler */ = { isa = PBXGroup; children = ( - D14AFD2024D232B300C51073 /* AppDelegate.swift */, - D14AFD2224D232B300C51073 /* SceneDelegate.swift */, D1D65B9726992E4600C1012A /* WalletBackend.swift */, D14CE1B126C39E5D00612DBE /* BalanceRow.swift */, D14CE1B326C3A2D400612DBE /* BalanceList.swift */, + AB1F87C92887D2F400AB82A0 /* ContentView.swift */, D14AFD2624D232B500C51073 /* Assets.xcassets */, D14AFD2B24D232B500C51073 /* LaunchScreen.storyboard */, D14AFD2E24D232B500C51073 /* Info.plist */, + AB1F87C72887C94700AB82A0 /* TalerApp.swift */, ); path = Taler; sourceTree = "<group>"; @@ -344,8 +344,8 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - D14AFD2124D232B300C51073 /* AppDelegate.swift in Sources */, - D14AFD2324D232B300C51073 /* SceneDelegate.swift in Sources */, + AB1F87C82887C94700AB82A0 /* TalerApp.swift in Sources */, + AB1F87CA2887D2F400AB82A0 /* ContentView.swift in Sources */, D1D65B9826992E4600C1012A /* WalletBackend.swift in Sources */, D14CE1B426C3A2D400612DBE /* BalanceList.swift in Sources */, D14CE1B226C39E5D00612DBE /* BalanceRow.swift in Sources */, @@ -521,7 +521,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 2; - DEVELOPMENT_ASSET_PATHS = "\"Taler/Preview Content\""; + DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = AY2R7MK22Y; ENABLE_PREVIEWS = YES; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; @@ -594,7 +594,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 2; - DEVELOPMENT_ASSET_PATHS = "\"Taler/Preview Content\""; + DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = AY2R7MK22Y; ENABLE_PREVIEWS = YES; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; diff --git a/Taler.xcodeproj/project.xcworkspace/xcuserdata/jonathan.xcuserdatad/UserInterfaceState.xcuserstate b/Taler.xcodeproj/project.xcworkspace/xcuserdata/jonathan.xcuserdatad/UserInterfaceState.xcuserstate Binary files differ. diff --git a/Taler/AppDelegate.swift b/Taler/AppDelegate.swift @@ -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 @@ -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 @@ -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 @@ -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 @@ -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() + } + } +}