Skip to content

Commit

Permalink
commit 其实并不能和app之间传递数据
Browse files Browse the repository at this point in the history
  • Loading branch information
W-Mai committed Oct 14, 2021
1 parent eb33917 commit 7d14a1b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
Binary file added Reference/detailed_communication_2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion iMsgExtPart/MessagesViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Messages
import CoreData

class MessagesViewController: MSMessagesAppViewController {
let persistenceController = PersistenceController.shared
let persistenceController = PersistenceController()

override func viewDidLoad() {
super.viewDidLoad()
Expand Down
24 changes: 12 additions & 12 deletions xSticker/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ struct ContentView: View {
private var items: FetchedResults<Item>

var body: some View {
List {
ForEach(items) { item in
Text("Item at \(item.timestamp!, formatter: itemFormatter)")
VStack{
HStack {
Button(action: addItem) {
Label("Add Item", systemImage: "plus")
}
EditButton()
}
.onDelete(perform: deleteItems)
}
.toolbar {
#if os(iOS)
EditButton()
#endif

Button(action: addItem) {
Label("Add Item", systemImage: "plus")

List {
ForEach(items) { item in
Text("Item at \(item.timestamp!, formatter: itemFormatter)")
}
.onDelete(perform: deleteItems)
}
}
}
Expand Down

0 comments on commit 7d14a1b

Please sign in to comment.