Last active
September 9, 2020 20:05
-
-
Save hrvolapeter/93e67e2051f31fcad8dba34971398124 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
import UIKit | |
struct NoteDetailView: View { | |
@State var vm: Self.ViewModel // CHANGE | |
var body: some View { | |
ScrollView { | |
VStack { | |
TextField("Title", text: $vm.note.title) // CHANGE | |
.font(.title) | |
tags | |
MultilineTextField(text: $vm.note.content) // CHANGE | |
}.padding() | |
}.navigationBarTitle("", displayMode: .inline) | |
} | |
var tags: some View { | |
ScrollView(.horizontal) { | |
HStack { | |
ForEach(vm.note.tags, id: \.self) { tag in // CHANGE | |
HStack { | |
Text(tag).font(.footnote) | |
}.padding(7).lineLimit(1).background(Color.accentColor).foregroundColor(.white) | |
.cornerRadius(10) | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment