Created
September 6, 2020 08:20
-
-
Save hrvolapeter/c0d8908f03538ec3fa5d4c99cfd04264 to your computer and use it in GitHub Desktop.
Zetten note detail
This file contains hidden or 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 note: Note | |
var body: some View { | |
ScrollView { | |
VStack { | |
TextField("Title", text: $note.title) | |
.font(.title) | |
tags | |
MultilineTextField(text: $note.content) | |
}.padding() | |
}.navigationBarTitle("", displayMode: .inline) | |
} | |
var tags: some View { | |
ScrollView(.horizontal) { | |
HStack { | |
ForEach(note.tags, id: \.self) { tag in | |
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