var body: some View {
NavigationView {
VStack {
Image(systemName: "cross.fill")
.font(.system(size: 150))
.foregroundColor(Color(.systemRed))
Text("SOS")
.font(.system(size: 40, weight: .bold))
}
.toolbar{
ToolbarItemGroup(placement: .bottomBar) {
Image(systemName: "cross.fill")
.font(.system(size: 30.0))
.foregroundColor(Color(.systemRed))
Spacer()
NavigationLink(destination: heartTextSquareView().navigationBarBackButtonHidden(true)) {
Image(systemName: "heart.text.square")
.font(.system(size: 30.0))
.foregroundColor(Color(.systemRed))
}
Spacer()
NavigationLink(destination: keyView().navigationBarBackButtonHidden(true)) {
Image (systemName: "key")
.font(.system(size: 30.0))
.foregroundColor(Color(.systemRed))
}
Spacer()
Image (systemName: "gearshape")
.font(.system(size: 30))
.foregroundColor(Color(.systemRed))
}
}
}
}
Post
Replies
Boosts
Views
Activity
Yes I can do that.
So if you tap on the plus button in the text field, I want it to create a new text field if you have several phone numbers, for example.
struct heartTextSquareView: View {
@State private var name: String = ""
@State private var adresse: String = ""
@State var telefonnummer: String = ""
@State var something: String = ""
var body: some View {
VStack {
List {
TextField("Name/Vorname", text: $name)
TextField("Adresse", text: $adresse)
Button(action: { print("Telefonnummer")}) {
Image(systemName: "plus.circle.fill")
.foregroundColor(Color(.systemGreen))
}
}
Sorry I didn't want that
struct heartTextSquareView: View {
@State private var name: String = ""
@State private var adresse: String = ""
@State var telefonnummer: String = ""
@State var something: String = ""
var body: some View {
VStack {
List {
TextField("Name/Vorname", text: $name)
TextField("Adresse", text: $adresse)
Button(action: { print("Telefonnummer")}) {
Image(systemName: "plus.circle.fill")
.foregroundColor(Color(.systemGreen))
}
}
Then these problems will occur. And I don't understand why. Can someone help me?
Sorry I did not mean grid view but something like in this attachment. So I want to add to this view a detail view that you can view the images a bit bigger.
Sorry I didn't express myself clearly. I want to turn this UIKit view into a SwiftUI view. How can I do that?
Hi
Thank you all for your swift response and great suggestions.
But I guess the problem isn't Xcode or the preview. I think it has something to do that I dont't pass the CoreData instance the right way. I tried once with the ".environment" but it didn't work. Does someone have an idea?
@Environment(\.managedObjectContext) var moc
static var previews: some View {
AddListView()
.environment(.managedObjectContext, DataController(name: "preview").container.viewContext))
}
}
This is how the crash looks like:
I wrote Paul Hudson on Slack, but he didn't answer unfortunately. But good idea I'll try it on Mastodon. Thank you.
I was able to solve the problem by deleting all the certificates. So Xcode Cloud automatically created new ones and it works again.