From b0cd904d83f4fdadba9b6229291482d8487e2fa3 Mon Sep 17 00:00:00 2001 From: Aaron <0d1y6g0w@duck.com> Date: Wed, 17 Apr 2024 19:25:41 -0700 Subject: [PATCH] QR Share Pro v1.1.0 --- QRSharePro.xcodeproj/project.pbxproj | 4 ++-- QRSharePro/History.swift | 14 ++++++++------ QRSharePro/HistoryDetailInfo.swift | 21 ++++++++++++++------- QRSharePro/Home.swift | 2 +- 4 files changed, 25 insertions(+), 16 deletions(-) diff --git a/QRSharePro.xcodeproj/project.pbxproj b/QRSharePro.xcodeproj/project.pbxproj index 9032c489..a98d5bc9 100644 --- a/QRSharePro.xcodeproj/project.pbxproj +++ b/QRSharePro.xcodeproj/project.pbxproj @@ -579,7 +579,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.1; + MARKETING_VERSION = 1.1.0; PRODUCT_BUNDLE_IDENTIFIER = com.aaronhma.QRShare; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; @@ -621,7 +621,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.1; + MARKETING_VERSION = 1.1.0; PRODUCT_BUNDLE_IDENTIFIER = com.aaronhma.QRShare; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; diff --git a/QRSharePro/History.swift b/QRSharePro/History.swift index 2994cfb4..e5a39743 100644 --- a/QRSharePro/History.swift +++ b/QRSharePro/History.swift @@ -47,13 +47,15 @@ struct History: View { } private func getTypeOf(type: String) -> String { - if type.isValidURL() { - return "URL" - } else if UIApplication.shared.canOpenURL(URL(string: type)!) { - return "Deep Link" - } else { - return "Text" + if let url = URL(string: type) { + if url.absoluteString.isValidURL(), type.isValidURL() { + return "URL" + } else if UIApplication.shared.canOpenURL(url) { + return "Deep Link" + } } + + return "Text" } var body: some View { diff --git a/QRSharePro/HistoryDetailInfo.swift b/QRSharePro/HistoryDetailInfo.swift index 5b22f197..24b8fbe8 100644 --- a/QRSharePro/HistoryDetailInfo.swift +++ b/QRSharePro/HistoryDetailInfo.swift @@ -838,9 +838,6 @@ struct HistoryDetailInfo: View { } .onAppear { Task { - originalText = qrCode.text - generateQRCode(from: qrCode.text) - if qrCode.text.isValidURL() { qrCode.text = URL(string: qrCode.text.removeTrackers())!.prettify().absoluteString @@ -850,6 +847,9 @@ struct HistoryDetailInfo: View { print(error.localizedDescription) } } + + generateQRCode(from: qrCode.text) + originalText = qrCode.text } } .accentColor(accentColorManager.accentColor) @@ -891,8 +891,9 @@ struct HistoryDetailInfo: View { Label("Delete", systemImage: "trash") } } - ToolbarItem(placement: .topBarTrailing) { - if !isEditing { + + if !isEditing { + ToolbarItem(placement: .topBarTrailing) { Menu { Button { if qrCode.text.count > 3000 { @@ -958,9 +959,15 @@ struct HistoryDetailInfo: View { } label: { Label("More", systemImage: "ellipsis.circle") } - } else { + } + } + + if isEditing { + ToolbarItem(placement: .topBarTrailing) { Button { - isEditing.toggle() + withAnimation { + isEditing = false + } } label: { Text("Done") } diff --git a/QRSharePro/Home.swift b/QRSharePro/Home.swift index 70e18c2e..88b663b6 100644 --- a/QRSharePro/Home.swift +++ b/QRSharePro/Home.swift @@ -421,7 +421,7 @@ struct Home: View { } header: { Text("Default Tab") } footer: { - Text("This will be the tab that opens when not using a quick action.") + Text("Choose the tab that appears when launching the app.") } Section {