From 1e4f0606a3c2ec1c50eec48a2fff7b905d2bbad1 Mon Sep 17 00:00:00 2001 From: Elizabeth Cray Date: Wed, 8 Jan 2025 23:34:42 -0500 Subject: [PATCH] Begin working on settings app UI/content --- AllenWrench.xcodeproj/project.pbxproj | 190 ++++++++++++++++++ .../xcschemes/xcschememanagement.plist | 5 + AllenWrench/ContentView.swift | 51 ++++- awkbd/Info.plist | 24 +++ awkbd/KeyboardViewController.swift | 60 ++++++ 5 files changed, 324 insertions(+), 6 deletions(-) create mode 100644 awkbd/Info.plist create mode 100644 awkbd/KeyboardViewController.swift diff --git a/AllenWrench.xcodeproj/project.pbxproj b/AllenWrench.xcodeproj/project.pbxproj index 9a08fc6..a246cc9 100644 --- a/AllenWrench.xcodeproj/project.pbxproj +++ b/AllenWrench.xcodeproj/project.pbxproj @@ -6,6 +6,10 @@ objectVersion = 77; objects = { +/* Begin PBXBuildFile section */ + 6E189DCB2D2E460600303762 /* awkbd.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 6E189DC42D2E460600303762 /* awkbd.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; +/* End PBXBuildFile section */ + /* Begin PBXContainerItemProxy section */ 6E189DA42D2E44ED00303762 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; @@ -21,14 +25,46 @@ remoteGlobalIDString = 6E189D922D2E44EB00303762; remoteInfo = AllenWrench; }; + 6E189DC92D2E460600303762 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 6E189D8B2D2E44EB00303762 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 6E189DC32D2E460600303762; + remoteInfo = awkbd; + }; /* End PBXContainerItemProxy section */ +/* Begin PBXCopyFilesBuildPhase section */ + 6E189DD02D2E460600303762 /* Embed Foundation Extensions */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 13; + files = ( + 6E189DCB2D2E460600303762 /* awkbd.appex in Embed Foundation Extensions */, + ); + name = "Embed Foundation Extensions"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ 6E189D932D2E44EB00303762 /* AllenWrench.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AllenWrench.app; sourceTree = BUILT_PRODUCTS_DIR; }; 6E189DA32D2E44ED00303762 /* AllenWrenchTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AllenWrenchTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 6E189DAD2D2E44ED00303762 /* AllenWrenchUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AllenWrenchUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 6E189DC42D2E460600303762 /* awkbd.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = awkbd.appex; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ +/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */ + 6E189DCC2D2E460600303762 /* Exceptions for "awkbd" folder in "awkbd" target */ = { + isa = PBXFileSystemSynchronizedBuildFileExceptionSet; + membershipExceptions = ( + Info.plist, + ); + target = 6E189DC32D2E460600303762 /* awkbd */; + }; +/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */ + /* Begin PBXFileSystemSynchronizedRootGroup section */ 6E189D952D2E44EB00303762 /* AllenWrench */ = { isa = PBXFileSystemSynchronizedRootGroup; @@ -45,6 +81,14 @@ path = AllenWrenchUITests; sourceTree = ""; }; + 6E189DC52D2E460600303762 /* awkbd */ = { + isa = PBXFileSystemSynchronizedRootGroup; + exceptions = ( + 6E189DCC2D2E460600303762 /* Exceptions for "awkbd" folder in "awkbd" target */, + ); + path = awkbd; + sourceTree = ""; + }; /* End PBXFileSystemSynchronizedRootGroup section */ /* Begin PBXFrameworksBuildPhase section */ @@ -69,6 +113,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 6E189DC12D2E460600303762 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -78,6 +129,7 @@ 6E189D952D2E44EB00303762 /* AllenWrench */, 6E189DA62D2E44ED00303762 /* AllenWrenchTests */, 6E189DB02D2E44ED00303762 /* AllenWrenchUITests */, + 6E189DC52D2E460600303762 /* awkbd */, 6E189D942D2E44EB00303762 /* Products */, ); sourceTree = ""; @@ -88,6 +140,7 @@ 6E189D932D2E44EB00303762 /* AllenWrench.app */, 6E189DA32D2E44ED00303762 /* AllenWrenchTests.xctest */, 6E189DAD2D2E44ED00303762 /* AllenWrenchUITests.xctest */, + 6E189DC42D2E460600303762 /* awkbd.appex */, ); name = Products; sourceTree = ""; @@ -102,10 +155,12 @@ 6E189D8F2D2E44EB00303762 /* Sources */, 6E189D902D2E44EB00303762 /* Frameworks */, 6E189D912D2E44EB00303762 /* Resources */, + 6E189DD02D2E460600303762 /* Embed Foundation Extensions */, ); buildRules = ( ); dependencies = ( + 6E189DCA2D2E460600303762 /* PBXTargetDependency */, ); fileSystemSynchronizedGroups = ( 6E189D952D2E44EB00303762 /* AllenWrench */, @@ -163,6 +218,28 @@ productReference = 6E189DAD2D2E44ED00303762 /* AllenWrenchUITests.xctest */; productType = "com.apple.product-type.bundle.ui-testing"; }; + 6E189DC32D2E460600303762 /* awkbd */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6E189DCD2D2E460600303762 /* Build configuration list for PBXNativeTarget "awkbd" */; + buildPhases = ( + 6E189DC02D2E460600303762 /* Sources */, + 6E189DC12D2E460600303762 /* Frameworks */, + 6E189DC22D2E460600303762 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + fileSystemSynchronizedGroups = ( + 6E189DC52D2E460600303762 /* awkbd */, + ); + name = awkbd; + packageProductDependencies = ( + ); + productName = awkbd; + productReference = 6E189DC42D2E460600303762 /* awkbd.appex */; + productType = "com.apple.product-type.app-extension"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -172,6 +249,7 @@ BuildIndependentTargetsInParallel = 1; LastSwiftUpdateCheck = 1620; LastUpgradeCheck = 1620; + ORGANIZATIONNAME = Cray; TargetAttributes = { 6E189D922D2E44EB00303762 = { CreatedOnToolsVersion = 16.2; @@ -184,6 +262,9 @@ CreatedOnToolsVersion = 16.2; TestTargetID = 6E189D922D2E44EB00303762; }; + 6E189DC32D2E460600303762 = { + CreatedOnToolsVersion = 16.2; + }; }; }; buildConfigurationList = 6E189D8E2D2E44EB00303762 /* Build configuration list for PBXProject "AllenWrench" */; @@ -203,6 +284,7 @@ 6E189D922D2E44EB00303762 /* AllenWrench */, 6E189DA22D2E44ED00303762 /* AllenWrenchTests */, 6E189DAC2D2E44ED00303762 /* AllenWrenchUITests */, + 6E189DC32D2E460600303762 /* awkbd */, ); }; /* End PBXProject section */ @@ -229,6 +311,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 6E189DC22D2E460600303762 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -253,6 +342,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 6E189DC02D2E460600303762 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ @@ -266,6 +362,11 @@ target = 6E189D922D2E44EB00303762 /* AllenWrench */; targetProxy = 6E189DAE2D2E44ED00303762 /* PBXContainerItemProxy */; }; + 6E189DCA2D2E460600303762 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 6E189DC32D2E460600303762 /* awkbd */; + targetProxy = 6E189DC92D2E460600303762 /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ @@ -399,11 +500,13 @@ DEVELOPMENT_TEAM = W9ASV855X5; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchScreen_Generation = YES; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 17.6; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -411,6 +514,9 @@ MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = lgbt.cray.AllenWrench; PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -428,11 +534,13 @@ DEVELOPMENT_TEAM = W9ASV855X5; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchScreen_Generation = YES; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 17.6; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -440,6 +548,9 @@ MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = lgbt.cray.AllenWrench; PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -458,6 +569,9 @@ MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = lgbt.cray.AllenWrenchTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_EMIT_LOC_STRINGS = NO; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -477,6 +591,9 @@ MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = lgbt.cray.AllenWrenchTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_EMIT_LOC_STRINGS = NO; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -494,6 +611,9 @@ MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = lgbt.cray.AllenWrenchUITests; PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_EMIT_LOC_STRINGS = NO; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -511,6 +631,9 @@ MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = lgbt.cray.AllenWrenchUITests; PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_EMIT_LOC_STRINGS = NO; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -518,6 +641,64 @@ }; name = Release; }; + 6E189DCE2D2E460600303762 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = W9ASV855X5; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = awkbd/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = "HexCorp Keyboard"; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + IPHONEOS_DEPLOYMENT_TARGET = 17.6; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = lgbt.cray.AllenWrench.awkbd; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 6E189DCF2D2E460600303762 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = W9ASV855X5; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = awkbd/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = "HexCorp Keyboard"; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + IPHONEOS_DEPLOYMENT_TARGET = 17.6; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = lgbt.cray.AllenWrench.awkbd; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -557,6 +738,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 6E189DCD2D2E460600303762 /* Build configuration list for PBXNativeTarget "awkbd" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6E189DCE2D2E460600303762 /* Debug */, + 6E189DCF2D2E460600303762 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ }; rootObject = 6E189D8B2D2E44EB00303762 /* Project object */; diff --git a/AllenWrench.xcodeproj/xcuserdata/liz.xcuserdatad/xcschemes/xcschememanagement.plist b/AllenWrench.xcodeproj/xcuserdata/liz.xcuserdatad/xcschemes/xcschememanagement.plist index 4e3c284..e9a264e 100644 --- a/AllenWrench.xcodeproj/xcuserdata/liz.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/AllenWrench.xcodeproj/xcuserdata/liz.xcuserdatad/xcschemes/xcschememanagement.plist @@ -9,6 +9,11 @@ orderHint 0 + awkbd.xcscheme_^#shared#^_ + + orderHint + 0 + diff --git a/AllenWrench/ContentView.swift b/AllenWrench/ContentView.swift index 46ed588..bcd920b 100644 --- a/AllenWrench/ContentView.swift +++ b/AllenWrench/ContentView.swift @@ -7,18 +7,57 @@ import SwiftUI + struct ContentView: View { + + @State var whatever: Bool = false + @State var droneId: String = "" + @State var dronePrefix: String = "⬡" + var body: some View { - VStack { - Image(systemName: "globe") - .imageScale(.large) - .foregroundStyle(.tint) - Text("Hello, world!") + NavigationView { + Form { + Section(header: Text("Content Settings"), content: { + HStack{ + Text("Drone ID") + TextField("Drone ID", text: $droneId).multilineTextAlignment(.trailing) + } + HStack{ + Text("Prefix") + TextField("Drone Prefix", text: $dronePrefix).multilineTextAlignment(.trailing) + } + }) + Section(header: Text("Behavior"), content: { + HStack { + Toggle(isOn: $whatever) { + Text("Automatic Send?") + } + } + }) + + Section(header: Text("About"), content: { + HStack{ + Spacer() + VStack{ + Text("A keyboard for drones, by a drone") + Link(destination: URL(string: "https://git.corrupt.link/liz/allenwrench")!){ + HStack{ + Image(systemName: "text.document") + Text("View Source Code") + } + } + Text("©2025 Elizabeth Cray").foregroundStyle(.secondary) + } + Spacer() + } + }) + } + .navigationTitle("Allen Wrench") } - .padding() } } + #Preview { ContentView() } diff --git a/awkbd/Info.plist b/awkbd/Info.plist new file mode 100644 index 0000000..40fc0ae --- /dev/null +++ b/awkbd/Info.plist @@ -0,0 +1,24 @@ + + + + + NSExtension + + NSExtensionAttributes + + IsASCIICapable + + PrefersRightToLeft + + PrimaryLanguage + en-US + RequestsOpenAccess + + + NSExtensionPointIdentifier + com.apple.keyboard-service + NSExtensionPrincipalClass + $(PRODUCT_MODULE_NAME).KeyboardViewController + + + diff --git a/awkbd/KeyboardViewController.swift b/awkbd/KeyboardViewController.swift new file mode 100644 index 0000000..399d948 --- /dev/null +++ b/awkbd/KeyboardViewController.swift @@ -0,0 +1,60 @@ +// +// KeyboardViewController.swift +// awkbd +// +// Created by Elizabeth Cray on 1/8/25. +// + +import UIKit + +class KeyboardViewController: UIInputViewController { + + @IBOutlet var nextKeyboardButton: UIButton! + + override func updateViewConstraints() { + super.updateViewConstraints() + + // Add custom view sizing constraints here + } + + override func viewDidLoad() { + super.viewDidLoad() + + // Perform custom UI setup here + self.nextKeyboardButton = UIButton(type: .system) + + self.nextKeyboardButton.setTitle(NSLocalizedString("Next Keyboard", comment: "Title for 'Next Keyboard' button"), for: []) + self.nextKeyboardButton.sizeToFit() + self.nextKeyboardButton.translatesAutoresizingMaskIntoConstraints = false + + self.nextKeyboardButton.addTarget(self, action: #selector(handleInputModeList(from:with:)), for: .allTouchEvents) + + self.view.addSubview(self.nextKeyboardButton) + + self.nextKeyboardButton.leftAnchor.constraint(equalTo: self.view.leftAnchor).isActive = true + self.nextKeyboardButton.bottomAnchor.constraint(equalTo: self.view.bottomAnchor).isActive = true + } + + override func viewWillLayoutSubviews() { + self.nextKeyboardButton.isHidden = !self.needsInputModeSwitchKey + super.viewWillLayoutSubviews() + } + + override func textWillChange(_ textInput: UITextInput?) { + // The app is about to change the document's contents. Perform any preparation here. + } + + override func textDidChange(_ textInput: UITextInput?) { + // The app has just changed the document's contents, the document context has been updated. + + var textColor: UIColor + let proxy = self.textDocumentProxy + if proxy.keyboardAppearance == UIKeyboardAppearance.dark { + textColor = UIColor.white + } else { + textColor = UIColor.black + } + self.nextKeyboardButton.setTitleColor(textColor, for: []) + } + +}