Compare commits

...

3 Commits

Author SHA1 Message Date
Shadowfacts 02e229042a Use PasteButton on iOS 16 2022-06-10 11:08:11 -04:00
Shadowfacts 5f5666c40d Catalyst, probably 2022-06-10 11:08:02 -04:00
Shadowfacts f84f1e3080 Add missing files to Xcode project 2021-11-16 10:12:50 -05:00
6 changed files with 60 additions and 19 deletions

View File

@ -7,10 +7,12 @@
objects = {
/* Begin PBXBuildFile section */
D60265482744012A00C77599 /* AddKeyButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = D60265472744012A00C77599 /* AddKeyButton.swift */; };
D602654A2744014600C77599 /* AllKeysView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D60265492744014500C77599 /* AllKeysView.swift */; };
D60E9D6E26D1998B009A4537 /* OTPGeneratorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D60E9D6D26D1998B009A4537 /* OTPGeneratorTests.swift */; };
D60E9D7226D1A863009A4537 /* KeyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D60E9D7126D1A863009A4537 /* KeyView.swift */; };
D60E9D7426D1ABF9009A4537 /* CircularProgressView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D60E9D7326D1ABF9009A4537 /* CircularProgressView.swift */; };
D60E9D7726D1B160009A4537 /* CodeScanner in Frameworks */ = {isa = PBXBuildFile; productRef = D60E9D7626D1B160009A4537 /* CodeScanner */; };
D60E9D7726D1B160009A4537 /* CodeScanner in Frameworks */ = {isa = PBXBuildFile; platformFilter = ios; productRef = D60E9D7626D1B160009A4537 /* CodeScanner */; };
D60E9D7A26D1E985009A4537 /* EditKeyForm.swift in Sources */ = {isa = PBXBuildFile; fileRef = D60E9D7926D1E985009A4537 /* EditKeyForm.swift */; };
D61479D726D0AF1C00710B79 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D61479D626D0AF1C00710B79 /* AppDelegate.swift */; };
D61479D926D0AF1C00710B79 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D61479D826D0AF1C00710B79 /* SceneDelegate.swift */; };
@ -84,6 +86,10 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
D60265472744012A00C77599 /* AddKeyButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AddKeyButton.swift; sourceTree = "<group>"; };
D60265492744014500C77599 /* AllKeysView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AllKeysView.swift; sourceTree = "<group>"; };
D602654B274401F800C77599 /* OTP.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = OTP.entitlements; sourceTree = "<group>"; };
D604B0F82744036F00960D31 /* CodeScanner */ = {isa = PBXFileReference; lastKnownFileType = folder; name = CodeScanner; path = ../CodeScanner; sourceTree = "<group>"; };
D60E9D6D26D1998B009A4537 /* OTPGeneratorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OTPGeneratorTests.swift; sourceTree = "<group>"; };
D60E9D7126D1A863009A4537 /* KeyView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyView.swift; sourceTree = "<group>"; };
D60E9D7326D1ABF9009A4537 /* CircularProgressView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CircularProgressView.swift; sourceTree = "<group>"; };
@ -150,19 +156,29 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
D604B0F72744036F00960D31 /* Packages */ = {
isa = PBXGroup;
children = (
D604B0F82744036F00960D31 /* CodeScanner */,
);
name = Packages;
sourceTree = "<group>";
};
D60E9D7826D1E976009A4537 /* Views */ = {
isa = PBXGroup;
children = (
D61479EA26D13DEF00710B79 /* AppView.swift */,
D6A2BD1126D56C70004DC4E3 /* KeysSection.swift */,
D6A2BD0F26D533EB004DC4E3 /* FoldersSection.swift */,
D6A2BD1326D5707F004DC4E3 /* FolderRow.swift */,
D60E9D7126D1A863009A4537 /* KeyView.swift */,
D60E9D7326D1ABF9009A4537 /* CircularProgressView.swift */,
D6A2BD0B26D5332B004DC4E3 /* FolderView.swift */,
D60265472744012A00C77599 /* AddKeyButton.swift */,
D6A2BCAF26D313E7004DC4E3 /* AddQRView.swift */,
D68B3D9F26D2937000CB35A2 /* AddURLForm.swift */,
D60265492744014500C77599 /* AllKeysView.swift */,
D60E9D7326D1ABF9009A4537 /* CircularProgressView.swift */,
D60E9D7926D1E985009A4537 /* EditKeyForm.swift */,
D6A2BD1326D5707F004DC4E3 /* FolderRow.swift */,
D6A2BD0F26D533EB004DC4E3 /* FoldersSection.swift */,
D6A2BD0B26D5332B004DC4E3 /* FolderView.swift */,
D6A2BD1126D56C70004DC4E3 /* KeysSection.swift */,
D60E9D7126D1A863009A4537 /* KeyView.swift */,
D6A2BCCB26D3E670004DC4E3 /* PreferencesView.swift */,
D6A2BCEB26D3F7F9004DC4E3 /* QRCodeView.swift */,
);
@ -172,6 +188,7 @@
D61479CA26D0AF1C00710B79 = {
isa = PBXGroup;
children = (
D604B0F72744036F00960D31 /* Packages */,
D61479D526D0AF1C00710B79 /* OTP */,
D61479F226D141F700710B79 /* OTPKit */,
D6147A0026D141F800710B79 /* OTPKitTests */,
@ -192,6 +209,7 @@
D61479D526D0AF1C00710B79 /* OTP */ = {
isa = PBXGroup;
children = (
D602654B274401F800C77599 /* OTP.entitlements */,
D61479E426D0AF1E00710B79 /* Info.plist */,
D61479D626D0AF1C00710B79 /* AppDelegate.swift */,
D6A2BCCF26D3E888004DC4E3 /* BackupDocument.swift */,
@ -396,7 +414,9 @@
D6A2BD1026D533EB004DC4E3 /* FoldersSection.swift in Sources */,
D6A2BCAE26D29601004DC4E3 /* EditedKey.swift in Sources */,
D6A2BD1426D5707F004DC4E3 /* FolderRow.swift in Sources */,
D60265482744012A00C77599 /* AddKeyButton.swift in Sources */,
D6A2BCD026D3E888004DC4E3 /* BackupDocument.swift in Sources */,
D602654A2744014600C77599 /* AllKeysView.swift in Sources */,
D6A2BD1226D56C70004DC4E3 /* KeysSection.swift in Sources */,
D60E9D7226D1A863009A4537 /* KeyView.swift in Sources */,
D68B3DA026D2937000CB35A2 /* AddURLForm.swift in Sources */,
@ -589,6 +609,7 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = OTP/OTP.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = V4WK9KR9U2;
@ -606,9 +627,10 @@
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = net.shadowfacts.OTP;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTS_MACCATALYST = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TARGETED_DEVICE_FAMILY = "1,2,6";
};
name = Debug;
};
@ -618,6 +640,7 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = OTP/OTP.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = V4WK9KR9U2;
@ -635,9 +658,10 @@
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = net.shadowfacts.OTP;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTS_MACCATALYST = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TARGETED_DEVICE_FAMILY = "1,2,6";
};
name = Release;
};

View File

@ -7,12 +7,12 @@
<key>OTP.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
<integer>0</integer>
</dict>
<key>OTPKit.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
<integer>1</integer>
</dict>
</dict>
</dict>

5
OTP/OTP.entitlements Normal file
View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict/>
</plist>

View File

@ -53,6 +53,7 @@ struct AddKeyButton: View {
} label: {
Label("Add Key", systemImage: "plus.circle")
}
.menuStyle(.borderlessButton)
.accessibilityLabel("Add Key")
.sheet(isPresented: $isPresentingScanner, content: self.scannerSheet)
.sheet(isPresented: $isPresentingManualAddFormSheet, content: self.manualAddFormSheet)

View File

@ -41,15 +41,25 @@ struct EditKeyForm: View {
HStack {
TextField("Secret", text: $editedKey.secret)
Button {
self.editedKey.secret = UIPasteboard.general.string ?? ""
} label: {
Label("Paste", systemImage: "doc.on.clipboard")
.labelStyle(.iconOnly)
.foregroundColor(.accentColor)
if #available(iOS 16.0, *) {
PasteButton(payloadType: String.self) { pasted in
if let s = pasted.first {
self.editedKey.secret = s
}
}
.labelStyle(.iconOnly)
.buttonBorderShape(.capsule)
} else {
Button {
self.editedKey.secret = UIPasteboard.general.string ?? ""
} label: {
Label("Paste", systemImage: "doc.on.clipboard")
.labelStyle(.iconOnly)
.foregroundColor(.accentColor)
}
.buttonStyle(.plain)
.disabled(!UIPasteboard.general.hasStrings)
}
.buttonStyle(.plain)
.disabled(!UIPasteboard.general.hasStrings)
}
HStack {

View File

@ -33,6 +33,7 @@ struct PreferencesView: View {
isPresentingImport = true
}
}
.menuStyle(.borderlessButton)
}
}
.navigationTitle("Preferences")