Тёмный

Add a Settings screen using a List with Sections | SwiftUI Crypto App #23 

Swiftful Thinking
Подписаться 49 тыс.
Просмотров 9 тыс.
50% 1

As we begin to wrap up the course, we need to add a Settings screen to the application. The screen is going to pop-up using a Sheet and will contain some basic data on (1) the course, (2) the CoinGecko API, (3) the developer - that's you!, and (4) the application.
We spent a lot of time working with ViewModels and publishers/subscribers in this course, so in the SettingsView we are going to take it easy and add the logic directly into the view.
*** LINKS:
- Downloadable Resources: www.swiftful-t...
- CoinGecko API: www.coingecko....
- CoinModel API: api.coingecko....
- Market Data API: api.coingecko....
- Coin Detail API: api.coingecko....
- Buy Me A Coffee: www.buymeacoff...
Next video: • App Icon, Launch Scree...
Last video: • Build an expandable / ...
🤙 WELCOME BACK 🤙
WEBSITE: www.swiftful-t...
DISCORD: / discord
GITHUB: github.com/Swi...
SAY THANKS: www.buymeacoff...

Опубликовано:

 

12 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 30   
@KimbrellBrad
@KimbrellBrad 3 года назад
Great progress we are making here! Feeling sad that we are almost done LOL! Such a complete app. Your design is really well done Nick!
@SwiftfulThinking
@SwiftfulThinking 3 года назад
Lol I felt like the course was too long already haha happy to hear you stuck with it!
@OttoSchmilinsky
@OttoSchmilinsky 2 года назад
I thought it would be a tutorial on how to save application configuration information to read it from multiple views (lists, detail, edit data). For example, that you should read a. model to populate a list and also read the saved configuration at the same time. A basic example, I can think of a weather application that shows a list of chosen cities (saved in the application settings), and the saved configuration also allows you to filter the list with only these cities, and that the settings save if you want to show the temperature in degrees Celsius or Fahrenheit (and the list is also read from another data model than the configuration model, but they must be present at the same time in the views). All of your videos are excellent, only this video in particular confused me because it's more of a static view than a preferences view, I have a real need to fix this and I was wrong. Thanks for your time and effort.
@Xinmin1000
@Xinmin1000 Год назад
All video are great! THANK YOU!
@ss2cire
@ss2cire 3 года назад
love the tuts, just one thing need to note: / == forward slash, \ == backslash
@SwiftfulThinking
@SwiftfulThinking 3 года назад
I know 😭😭😭 sorry haha
@irfanrizvi161
@irfanrizvi161 3 года назад
Beautifully done, loving it as always.
@AyorindeAdesugba
@AyorindeAdesugba 3 года назад
Wonderful series Nick.
@SwiftfulThinking
@SwiftfulThinking 3 года назад
Thank you Ayorinde!
@Nunny25
@Nunny25 2 года назад
Thanks Nick, enjoy a coffee.
@youssefmohamed1551
@youssefmohamed1551 5 месяцев назад
would you make combine dedicated course in the future?
@user-eg7ep8db8j
@user-eg7ep8db8j 2 года назад
Well done! I just can't believe this wonderful channel just has this number of subscriber~~~ It's the way to the expert swift app dev. definitely~ thanks you~
@the_kingdom
@the_kingdom 2 года назад
To get the "X" button to dismiss the sheet, don't use a separate XMarkButton file. Instead, just add the code directly into your SettingsView.swift file. struct SettingsView: View { @Environment(\.presentationMode) var presentationMode var body: some View { // GOES DIRECTLY BELOW ToolbarItem(placement: .navigationBarLeading) { Button(action: { presentationMode.wrappedValue.dismiss() }, label: { Image(systemName: "xmark") .font(.headline) })
@stefanlindholm3284
@stefanlindholm3284 Год назад
I just put it as @Environment(\.dismiss) var dismiss And then dismiss()
@the_kingdom
@the_kingdom Год назад
@@stefanlindholm3284 Whatever works, go for it. I could never get it to work if it was in a separate file so I had to revert to keeping the code in my SettingsView.swift file.
@stefanlindholm3284
@stefanlindholm3284 Год назад
@@the_kingdom Yeah, I had the same problem. I've set iOS 16 as the deployment target so that I will be forced to find solutions for things that have become deprecated.
@the_kingdom
@the_kingdom Год назад
@@stefanlindholm3284 nice
@the1000apple
@the1000apple 3 года назад
You had my subscription when the Mexican music started playing
@SwiftfulThinking
@SwiftfulThinking 3 года назад
Haha you just made my day! Unfortunately I'm not a great dancer so it's just me walking in to talk about writing code lol
@cinquain0
@cinquain0 2 года назад
Look at you now, 10K followers Nick!
@SwiftfulThinking
@SwiftfulThinking 2 года назад
Thanks for the coffee James! Thanks for sticking around all this time🙏
@cinquain0
@cinquain0 2 года назад
@@SwiftfulThinking what’s the next course big man
@SwiftfulThinking
@SwiftfulThinking 2 года назад
@@cinquain0 It's coming out next Monday haha ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-p6q1RmYUsNU.html
@cinquain0
@cinquain0 2 года назад
@@SwiftfulThinking can’t wait!
@andresraigoza2082
@andresraigoza2082 2 года назад
Thank you so much! Something strange happens when I test it on my iPhone though. The descriptions in this view are all collapsed, it shows the description for every section but with the last line collapsed. Do you know why?
@AZMerf
@AZMerf 3 года назад
Great video, Nick. Anybody have the problem where the XMarkButton didn’t work on the Setting sheet? I am using the same function that was used in the Edit Portfolio sheet and that works perfectly. I’ve compared the code in both and they look identical. Also, it works in Preview but not in the Simulator. I can dismiss it by swiping down in either. Thanks.
@SwiftfulThinking
@SwiftfulThinking 3 года назад
Yea, this happens occasionally. I think it happens when the sheet gets moved up/down just slightly and the "Environment" thinks it's already dismissed, so the logic doesn't work. If it happens a lot, you can always bind the XMarkButton to a Boolean that controls the sheet directly, instead of relying on the environment variable.
@engineeredessentials6660
@engineeredessentials6660 2 года назад
Great video. When I get to the 19:23 water mark, I get this issue "Cannot infer contextual base in reference to member 'sheet'" Any clues?
@Nick-gj9gz
@Nick-gj9gz 3 года назад
Please make some WWDC videos, we won't mind.
@SwiftfulThinking
@SwiftfulThinking 3 года назад
I'm working on it :)
Далее
УДОЧКА ЗА 1$ VS 10$ VS 100$!
22:41
Просмотров 364 тыс.
ФОКУС -СВЕТОФОР
00:32
Просмотров 336 тыс.
Дежавю, прескевю и жамевю!
00:59
Просмотров 284 тыс.
How to use weak self in Swift | Continued Learning #18
20:33
Cursor Is Beating VS Code (...by forking it)
18:00
Просмотров 94 тыс.
Voice Over - SwiftUI Tutorial
6:34
Просмотров 749