That's very nice, I like the capsule version better. However, I have issues adapting your code to my needs and probably many others. In these demos, you always keep it simple and each view is just a simple text in the middle of the view. In real life, most of us have actual views, that are named file, also using SwiftData and these views need to pass data too. I'm pretty sure I need a ViewBuilder inside my enum, but a enum cannot store properties, so how do I pass data from the tabview to the view that I actually want to display? Knowing that not all view will need the pass the same amount of data. Thank you :)
12 วันที่ผ่านมา
I haven't watched the video yet, I'm trying to thinking ideas for the question you asked, you can write a general manager of swiftData and fetch the data with each tab change.
You'll have to be more specific here :) I dabble in coding, but not very familiar with naming conventions and things like that. In my Enum, I added that: @ViewBuilder var view: some View { switch self { case .home: NavigationView { HomeView(items: [Item], settings: [Settings], modelContext: ModelContext) } case .charts: NavigationView { GraphsView() } case .settings: NavigationView { SettingsView(modelContext: ModelContext) } } } I just don't know if this is the right way to do it, if there is another way, or how to tell, in the Enum, how to retrieve that data. All I know is that when using NavigationView { HomeView() }, the code complains that it needs arguments parameters.
I believe you need a week slider with infinite paging and sliding ability. I already have a video on that. Please check it out, th-cam.com/video/sbheMzA3jTI/w-d-xo.html
How would you adjust this to add more than 4 buttons/horizontal scrolling behavior?
The music is good 👍
nice!
That's very nice, I like the capsule version better. However, I have issues adapting your code to my needs and probably many others. In these demos, you always keep it simple and each view is just a simple text in the middle of the view. In real life, most of us have actual views, that are named file, also using SwiftData and these views need to pass data too. I'm pretty sure I need a ViewBuilder inside my enum, but a enum cannot store properties, so how do I pass data from the tabview to the view that I actually want to display? Knowing that not all view will need the pass the same amount of data. Thank you :)
I haven't watched the video yet, I'm trying to thinking ideas for the question you asked, you can write a general manager of swiftData and fetch the data with each tab change.
You'll have to be more specific here :) I dabble in coding, but not very familiar with naming conventions and things like that. In my Enum, I added that:
@ViewBuilder
var view: some View {
switch self {
case .home:
NavigationView { HomeView(items: [Item], settings: [Settings], modelContext: ModelContext) }
case .charts:
NavigationView { GraphsView() }
case .settings:
NavigationView { SettingsView(modelContext: ModelContext) }
}
}
I just don't know if this is the right way to do it, if there is another way, or how to tell, in the Enum, how to retrieve that data. All I know is that when using NavigationView { HomeView() }, the code complains that it needs arguments parameters.
Can you do a DatePicker with week scope (single line) ?
No joke, can't you just ask ChatGPT for something like that?
@ Yeah but the UX is not as clean as Kavsoft’s one. For example ChatGPT gives a solution with tabviews which makes the scroll not infinite
I believe you need a week slider with infinite paging and sliding ability. I already have a video on that. Please check it out,
th-cam.com/video/sbheMzA3jTI/w-d-xo.html
you sure you can't increase x-code font size?