Minor changes to the NewFeedEntryView; fixed some other classes because of compile errors
This commit is contained in:
parent
1f664b4250
commit
988dca5ff1
@ -131,7 +131,6 @@
|
||||
F5847B652A599EA4009E28D4 /* Feed.swift */,
|
||||
F5847B692A59AB24009E28D4 /* FeedStore.swift */,
|
||||
96BD330D2A5C254B007A6E53 /* TextApp.swift */,
|
||||
96BD330F2A5C27B0007A6E53 /* NewFeedEntryView.swift */,
|
||||
);
|
||||
path = RippleChat;
|
||||
sourceTree = "<group>";
|
||||
@ -164,6 +163,7 @@
|
||||
96BD33112A5C3FFC007A6E53 /* Views */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
96BD330F2A5C27B0007A6E53 /* NewFeedEntryView.swift */,
|
||||
96BD33122A5C400B007A6E53 /* FeedListView.swift */,
|
||||
96BD33152A5C403C007A6E53 /* PeeringView.swift */,
|
||||
96BD33172A5C404F007A6E53 /* FriendsListView.swift */,
|
||||
|
||||
@ -9,11 +9,11 @@ import Foundation
|
||||
|
||||
struct Body: Codable {
|
||||
|
||||
let tag: Apps
|
||||
let tag: String
|
||||
let value: String
|
||||
|
||||
init(tag: Apps = Apps.txt, value: String = "") {
|
||||
self.tag = tag
|
||||
self.tag = tag.description
|
||||
self.value = value
|
||||
}
|
||||
}
|
||||
@ -21,4 +21,11 @@ struct Body: Codable {
|
||||
enum Apps: Codable {
|
||||
case nam
|
||||
case txt
|
||||
|
||||
var description : String {
|
||||
switch self {
|
||||
case .nam: return "nam"
|
||||
case .txt: return "txt"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -21,7 +21,6 @@ struct ContentView: View {
|
||||
.imageScale(.large)
|
||||
.foregroundColor(.accentColor)
|
||||
Text("Hello, world!")
|
||||
Spacer()
|
||||
Button("Save Feed") {
|
||||
Task {
|
||||
do {
|
||||
@ -36,12 +35,14 @@ struct ContentView: View {
|
||||
}
|
||||
}
|
||||
.padding()
|
||||
NavigationView {
|
||||
List(bluetoothViewModel.peripheralNames, id: \.self) { peripheral in
|
||||
Text(peripheral)
|
||||
}
|
||||
.navigationTitle("Peripherals")
|
||||
}
|
||||
Spacer()
|
||||
NewFeedEntryView()
|
||||
// NavigationView {
|
||||
// List(bluetoothViewModel.peripheralNames, id: \.self) { peripheral in
|
||||
// Text(peripheral)
|
||||
// }
|
||||
// .navigationTitle("Peripherals")
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@ import SwiftUI
|
||||
|
||||
@main
|
||||
struct RippleChatApp: App {
|
||||
@State private var currentView: CurrentView = CurrentView.feeds
|
||||
//@State private var currentView: CurrentView = CurrentView.feeds
|
||||
|
||||
var body: some Scene {
|
||||
WindowGroup {
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
import SwiftUI
|
||||
|
||||
struct FeedListView: View {
|
||||
|
||||
@State var feeds: [Feed]
|
||||
|
||||
var body: some View {
|
||||
Text("FeedListView")
|
||||
@ -17,6 +17,6 @@ struct FeedListView: View {
|
||||
|
||||
struct FeedListView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
FeedListView()
|
||||
FeedListView(feeds: [])
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,13 +8,19 @@
|
||||
import SwiftUI
|
||||
|
||||
struct NewFeedEntryView: View {
|
||||
@State private var name: String = "Alice"
|
||||
@State private var newEntry: String = ""
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading) {
|
||||
TextField("Enter your name", text: $name)
|
||||
Text("Hello, \(name)!")
|
||||
HStack {
|
||||
TextField("Enter your new feed message:", text: $newEntry)
|
||||
Button(action: {}) {
|
||||
Text("Send")
|
||||
}
|
||||
}
|
||||
Text("New entry: \(newEntry)")
|
||||
}
|
||||
.padding()
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user