Post

Replies

Boosts

Views

Activity

MapKit Annotations
Made a mapview with the Mapkit, and followed some tutorials online. How could the annotations I'm adding to the map be saved? So when they go back to the app, they will always show. After doing the first question ,how could customers delete an annotation if they wanted to? How could I get directions to an annotation I've made, and get directions by boat? Thanks in advance.
1
0
576
Aug ’22
Date Formatting XCode
Trying to fix date format to be correct for norwegian standards. Now I get: Tuesday, August 2. Trying to get: Tuesday, 2 August. Appreciate the help.       .foregroundColor(.white)               .onAppear {         datestring =         Date.now.formatted(.dateTime.weekday(.wide).day().month(.wide))      }
1
0
586
Aug ’22
Xcode Button (Navigationlink) won't work
I have made a navigation bar in "Contentview" linked with each their tabitem to a swift.view file/page. One of the pages they are linking to are a "dashboard/homepage". I'm trying to add a button in the "dashboard.swiftview"file to another page/swiftview file called "Oppgaver". I get the button on the page, but its not clickable. What should I do? This is the code: import SwiftUI struct Dashboard: View {   @State var datestring = ""       var body: some View {     ZStack {       LinearGradient (gradient: Gradient(colors: [.blue, .white]), startPoint: .topLeading, endPoint:.bottomTrailing)       .edgesIgnoringSafeArea(.all)     VStack {              VStack {           Text("Hei Håkon 👋")           .font(.system(size: 32, weight:.medium, design: .default))           .foregroundColor(.white)       Text("Dagens dato er \(datestring)")       .foregroundColor(.white)               .onAppear {         datestring =         Date.now.formatted(.dateTime.weekday().day().month())      }                 }                 VStack {         Text("🛥️")         .font(.system(size: 120, weight:.medium, design: .default))         .foregroundColor(.white)         .padding(10)                 }           VStack {         Text("Dagens tilstander 🌊")             .font(.system(size: 25, weight:.medium, design: .default))             .foregroundColor(.white)             .padding(15)               }             Spacer()     }               NavigationLink (destination: Gj_reoppgave(), label: {         Text("Gå til gjøreoppgaver")           .foregroundColor(.white)           .font(.headline)           .frame(height:55)           .frame(maxWidth: .infinity)           .background(.blue)           .cornerRadius(10)           .multilineTextAlignment(.center)           .padding(30)       })                    } } struct Dashboard_Previews: PreviewProvider {   static var previews: some View {     Dashboard()   } } }
2
0
1.1k
Aug ’22
Xcode Navigationlink not working
I have made a navigation bar in "Contentview" linked with each their tabitem to a swift.view file/page. One of the pages they are linking to are a "dashboard/homepage". I'm trying to add a button in the "dashboard.swiftview"file to another page/swiftview file called "Oppgaver". I get the button on the page, but its not clickable. What should I do? This is the code: import SwiftUI struct Dashboard: View {   @State var datestring = ""       var body: some View {           NavigationLink (destination: Gj_reoppgave(), label: {         Text("Gå til gjøreoppgaver")           .foregroundColor(.white)           .font(.headline)           .frame(height:55)           .frame(maxWidth: .infinity)           .background(.blue)           .cornerRadius(10)           .multilineTextAlignment(.center)           .padding(30)       })                    } } struct Dashboard_Previews: PreviewProvider {   static var previews: some View {     Dashboard()   } } }
4
0
648
Jul ’22
XCode Preview slow after firebase import
Information: Xcode version: 13.4.1. MAC OS: MAC OS Monterrey 12.5 After I imported Firebase into my project with their public SDK's from GitHub, my projects is really slow to work with. Both previewing a swift view is slow (talking minutes), and simulating the app is even worse. I have a M1 Macbook Pro. Looking forward to some help!
Replies
1
Boosts
2
Views
1.2k
Activity
Nov ’22
MapKit Annotations
Made a mapview with the Mapkit, and followed some tutorials online. How could the annotations I'm adding to the map be saved? So when they go back to the app, they will always show. After doing the first question ,how could customers delete an annotation if they wanted to? How could I get directions to an annotation I've made, and get directions by boat? Thanks in advance.
Replies
1
Boosts
0
Views
576
Activity
Aug ’22
Date Formatting XCode
Trying to fix date format to be correct for norwegian standards. Now I get: Tuesday, August 2. Trying to get: Tuesday, 2 August. Appreciate the help.       .foregroundColor(.white)               .onAppear {         datestring =         Date.now.formatted(.dateTime.weekday(.wide).day().month(.wide))      }
Replies
1
Boosts
0
Views
586
Activity
Aug ’22
Xcode Button (Navigationlink) won't work
I have made a navigation bar in "Contentview" linked with each their tabitem to a swift.view file/page. One of the pages they are linking to are a "dashboard/homepage". I'm trying to add a button in the "dashboard.swiftview"file to another page/swiftview file called "Oppgaver". I get the button on the page, but its not clickable. What should I do? This is the code: import SwiftUI struct Dashboard: View {   @State var datestring = ""       var body: some View {     ZStack {       LinearGradient (gradient: Gradient(colors: [.blue, .white]), startPoint: .topLeading, endPoint:.bottomTrailing)       .edgesIgnoringSafeArea(.all)     VStack {              VStack {           Text("Hei Håkon 👋")           .font(.system(size: 32, weight:.medium, design: .default))           .foregroundColor(.white)       Text("Dagens dato er \(datestring)")       .foregroundColor(.white)               .onAppear {         datestring =         Date.now.formatted(.dateTime.weekday().day().month())      }                 }                 VStack {         Text("🛥️")         .font(.system(size: 120, weight:.medium, design: .default))         .foregroundColor(.white)         .padding(10)                 }           VStack {         Text("Dagens tilstander 🌊")             .font(.system(size: 25, weight:.medium, design: .default))             .foregroundColor(.white)             .padding(15)               }             Spacer()     }               NavigationLink (destination: Gj_reoppgave(), label: {         Text("Gå til gjøreoppgaver")           .foregroundColor(.white)           .font(.headline)           .frame(height:55)           .frame(maxWidth: .infinity)           .background(.blue)           .cornerRadius(10)           .multilineTextAlignment(.center)           .padding(30)       })                    } } struct Dashboard_Previews: PreviewProvider {   static var previews: some View {     Dashboard()   } } }
Replies
2
Boosts
0
Views
1.1k
Activity
Aug ’22
Xcode Navigationlink not working
I have made a navigation bar in "Contentview" linked with each their tabitem to a swift.view file/page. One of the pages they are linking to are a "dashboard/homepage". I'm trying to add a button in the "dashboard.swiftview"file to another page/swiftview file called "Oppgaver". I get the button on the page, but its not clickable. What should I do? This is the code: import SwiftUI struct Dashboard: View {   @State var datestring = ""       var body: some View {           NavigationLink (destination: Gj_reoppgave(), label: {         Text("Gå til gjøreoppgaver")           .foregroundColor(.white)           .font(.headline)           .frame(height:55)           .frame(maxWidth: .infinity)           .background(.blue)           .cornerRadius(10)           .multilineTextAlignment(.center)           .padding(30)       })                    } } struct Dashboard_Previews: PreviewProvider {   static var previews: some View {     Dashboard()   } } }
Replies
4
Boosts
0
Views
648
Activity
Jul ’22