Skip to content

Commit

Permalink
拷贝问题修复
Browse files Browse the repository at this point in the history
  • Loading branch information
ming1016 committed Dec 13, 2024
1 parent a3631ef commit a387749
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
1 change: 1 addition & 0 deletions SwiftPamphletApp/Core/FundationFunction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func wrapperHtmlContent(content: String, codeStyle: String = "lioshi.min") -> St
extension NSPasteboard {
func copyText(_ text: String) {
self.clearContents()
self.declareTypes([.string], owner: nil)
self.setString(text, forType: .string)
}
}
Expand Down
1 change: 1 addition & 0 deletions SwiftPamphletApp/Guide/View/GuideOutline/AppleGuide.swift
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,7 @@ struct AppleGuide {
L(t: "AI辅助开发APP"),
L(t: "用于开发APP的提示词"),
L(t: "智能体", sub: [
L(t: "人工智能-智能体"),
L(t: "人工智能-RAG"),
]),
L(t: "人工智能-技术原理"),
Expand Down
1 change: 1 addition & 0 deletions SwiftPamphletApp/HomeUI/HomeiOSView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ struct HomeiOSView: View {
var body: some View {
EmptyView()
.onOpenURL { url in
// SwiftPamphletApp://view?content=detail
if let content = URLComponents(url: url, resolvingAgainstBaseURL: true)?
.queryItems?.first(where: { $0.name == "content" })?.value {
if content == "detail" {
Expand Down
6 changes: 2 additions & 4 deletions SwiftPamphletApp/InfoOrganizer/Info/EditInfoView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,7 @@ struct EditInfoView: View {
Button {
#if os(macOS)
let p = NSPasteboard.general
p.declareTypes([.string], owner: nil)
p.setString(img.url, forType: .string)
p.copyText(img.url)
#elseif os(iOS)
let p = UIPasteboard.general
p.string = img.url
Expand Down Expand Up @@ -264,8 +263,7 @@ struct EditInfoView: View {
Button {
#if os(macOS)
let p = NSPasteboard.general
p.declareTypes([.string], owner: nil)
p.setString(img, forType: .string)
p.copyText(img)
#elseif os(iOS)
let p = UIPasteboard.general
p.string = img
Expand Down
4 changes: 2 additions & 2 deletions SwiftPamphletApp/InfoOrganizer/Info/InfoListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ struct InfoListView: View {
}, label: {
Label("添加资料", systemImage: "plus")
})
.help("command + =")
.keyboardShortcut(KeyEquivalent("="), modifiers: .command)
.help("command + t")
.keyboardShortcut(KeyEquivalent("t"), modifiers: .command)
}
ToolbarItem(placement: .navigation) {
Picker("分类", selection: $filterCate) {
Expand Down
3 changes: 1 addition & 2 deletions SwiftPamphletApp/ViewComponet/ViewComponent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ struct ShareView: View {
Button {
#if os(macOS)
let p = NSPasteboard.general
p.declareTypes([.string], owner: nil)
p.setString(s, forType: .string)
p.copyText(s)
#elseif os(iOS)
UIPasteboard.general.string = s
#endif
Expand Down

0 comments on commit a387749

Please sign in to comment.