File tree Expand file tree Collapse file tree 2 files changed +7
-33
lines changed
Expand file tree Collapse file tree 2 files changed +7
-33
lines changed Original file line number Diff line number Diff line change @@ -97,29 +97,3 @@ struct ShareSheet: UIViewControllerRepresentable {
9797
9898 func updateUIViewController( _ uiViewController: UIActivityViewController , context: Context ) { }
9999}
100-
101- // Example of how to add the export button to an existing view
102- struct YourExistingView : View {
103- var body : some View {
104- VStack {
105- // Your existing content here
106- Text ( " Your existing content " )
107-
108- // Add the export button
109- Button ( action: exportToCSV) {
110- HStack {
111- Image ( systemName: " square.and.arrow.up " )
112- Text ( " Export to CSV " )
113- }
114- . padding ( )
115- . background ( Color . blue)
116- . foregroundColor ( . white)
117- . cornerRadius ( 8 )
118- }
119- }
120- }
121-
122- private func exportToCSV( ) {
123- // Copy the CSV creation logic here
124- }
125- }
Original file line number Diff line number Diff line change @@ -68,13 +68,8 @@ struct MovieList: View {
6868 . navigationBarTitleDisplayMode ( . inline)
6969 . toolbar {
7070 ToolbarItem ( placement: . topBarTrailing) {
71- EditButton ( )
72- }
73- ToolbarItemGroup ( placement: . primaryAction) {
74- Button ( action: addCollection) {
75- Label ( " Add Movie " , systemImage: " plus.app " )
76- } ;
77- Button ( " Export to CSV " ) {
71+ EditButton ( ) ;
72+ Button ( " Export " ) {
7873 if createCSVFile ( ) != nil {
7974 showingExportSheet = true
8075 }
@@ -88,6 +83,11 @@ struct MovieList: View {
8883 Text ( alertMessage)
8984 }
9085 }
86+ ToolbarItemGroup ( placement: . primaryAction) {
87+ Button ( action: addCollection) {
88+ Label ( " Add Movie " , systemImage: " plus.app " )
89+ }
90+ }
9191 }
9292 } else {
9393 ContentUnavailableView {
You can’t perform that action at this time.
0 commit comments