Skip to content

Instantly share code, notes, and snippets.

@hrvolapeter
Created September 6, 2020 08:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hrvolapeter/c0d8908f03538ec3fa5d4c99cfd04264 to your computer and use it in GitHub Desktop.
Save hrvolapeter/c0d8908f03538ec3fa5d4c99cfd04264 to your computer and use it in GitHub Desktop.
Zetten note detail
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