Тёмный

Setup CloudKit in SwiftUI project and get user info | Advanced Learning #21 

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

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

 

29 окт 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 71   
@mke579
@mke579 2 года назад
Nick! You don't know how much I've been looking for a complete CloudKit tutorial :O... This will save my ass soooo much! Keep up this awesome series and I hope you can cover all CloudKit functionalities as much as you can because I was really looking forward to see the power that CloudKit can give. Thank you again!
@SwiftfulThinking
@SwiftfulThinking 2 года назад
Hey MKE! Well I have 5 CloudKit videos so far, it's not a "complete" tutorial but should cover most use cases (enough to build most apps at least). At the end, if there's anything major I missed, definitely leave a comment letting me know 🤙
@mke579
@mke579 2 года назад
@@SwiftfulThinking 5 videos, awesome! It's gonna be lit! Looking forward to learn some new stuff :D
@Connor-pj2tg
@Connor-pj2tg 2 года назад
This is amazing Nick! Thank you. I can't wait to see more CloudKit videos!
@SwiftfulThinking
@SwiftfulThinking 2 года назад
Thanks for watching Connor!
@chrislangston929
@chrislangston929 2 года назад
Thanks Nick! Followed your Tutorial and it worked like a champion. Appreciate you putting this out to the community.
@SwiftfulThinking
@SwiftfulThinking 2 года назад
Happy to hear that! Thanks for watching.
@adamcm82
@adamcm82 4 месяца назад
It’s the future, please do a full playlist for CloudKit, specifically SHARING 😅
@akhilpillay2486
@akhilpillay2486 12 дней назад
Honestly, you are so effortlessly funny in your remarks bro, you earned a sub just for that🤣 Great video too thanks brother, helps a lot
@이가은-c4g
@이가은-c4g Месяц назад
Hi! Thank you for making this video! It's so helpful for learning how to develope the iCloudKit. BTW, I have one question: at 14:29 in this video, how did you make that func to choose and make a Vstack? Thanks,
@Awesome奥深
@Awesome奥深 2 года назад
Awesome to watch, I am keeping waiting for you updates.💎
@SwiftfulThinking
@SwiftfulThinking 2 года назад
I love to hear that lol I have a bunch of videos in the queue for you 🤓
@dr.craigcurphey4829
@dr.craigcurphey4829 2 года назад
Great job as usual, Nick! You have a genuine knack for hitting the things that matter. Question of the sequence of events ... first you call getiCloudStatus, which does an CKContainer api (I assume this is asynced, right?), immediately you call requestPermission. Could the CKContainer api not yet be complete when you call requestPermission, or is the getiCloudStatus always going to be done executing before requestPermission is called? I don't quite understand - does the requestPermission func need isSignedInToiCloud to be true for the func to give the correct result, or does it not matter whether the user is signed in for requestPermission to work? Thanks for your help!
@SwiftfulThinking
@SwiftfulThinking 2 года назад
Great question as always! This is all async code, so yes timing definitely matters here. The app is automatically connected to the CKContainer and CloudKit, so we don't have to worry about that here. We do, however, need the user to be signed in to their iCloud account before they can access CloudKit. So the first function to call is getiCloudStatus() and then after that you can call requestPermission(). Almost all of the time, getiCloudStatus() will immediately return successful though. I don't know anyone using an iPhone that isn't signed in to an iCloud account. In production, I would probably call these one-after-another just in case. If the user getiCloudStatus() does fail, though, I would probably stop everything else in the app and show a screen saying "sign in to iCloud to continue" or something like that. Also, in reality, the getiCloudStatus() can be called at app launch in the AppDelegate or something like that, while requestPermission() might called much later in the lifecycle, such as during onboarding or after creating an account.
@lance2301
@lance2301 2 года назад
Great video, thanks for creating content around CloudKit. Been a big fan of CK since the beginning but there has always been a lack of good documentation and learning resources on the topic.
@bbulliard
@bbulliard 2 года назад
You have a gift for teaching. Very clear,easy to understand code. Great job. I’ll have to add more coffee money to your account to keep you going..bob
@degisner
@degisner 2 года назад
Finally! Nick, you're the best! I became a developer watching your channel. P.S. I'm a UI designer.
@SwiftfulThinking
@SwiftfulThinking 2 года назад
That's awesome to hear haha .. and a great combination of skills to have 😎
@arkemal
@arkemal Год назад
Hi Nick, very nice intro and well explained tutorial!
@markmartin4037
@markmartin4037 4 месяца назад
Is cloudkit still worth learning? If so I'd love to see a playlist.
@evangelosspyromilios5994
@evangelosspyromilios5994 7 месяцев назад
on 22:42 is there any way to fetch the actual name of the user, for example if the iCloudAccountStatus is .available, to show something like "Hello Nick Sarno !" ? (Edited 10 seconds later: OK got it !!)
@WeirdTKJackson
@WeirdTKJackson Год назад
Hi, much thanks for your courses, I learned a lot really. Now, I can use CKContainer to CRUD public database of my container, which I can call it as "online mode" of my APP. But, if there is a "offline mode" of my APP, I use Core Data to read and write, how can these operations synchronze to the public database? Since I know, the NSPersistentCloudKitContainer support privdate database well and thought supports public database but now very well. I think in the offline mode of my APP, to enable data synchronization to public database when network is available, I have to continue to use Core Data and use CKContainer to manually upload loal changes to public database. Am I right?
@DavidM979
@DavidM979 Год назад
A lot of these functions from CloudKit got deprecated in iOS 17. Finding it really hard to understand what replaces them now.
@leomota04
@leomota04 Год назад
any updates? im struggling....
@Spacer-l3j
@Spacer-l3j 5 месяцев назад
this is the problem with the content creators... they don't care to update the videos... so useless and waste so much time... i know it is free but make us aware that many of the functions are depricated for god's sake
@bobearl99
@bobearl99 Год назад
Hi Nick, Fantastic tutorial as always. I found one small issue that tripped me up several times when I tried to request application permissions using async await, and I thought I'd add it here in case others who follow your series hit the same snag. I kept getting a notice in the console: [CK] Could not validate account info cache. (This is a potential performance issue.). When I requested permission in the app, the oddly-worded dialog you mention at 30:10 came up, but when I clicked 'Allow', it fails to return a CKPermissionStatus. The fix is perhaps obvious to most, but took me most of a day to figure out: you have to go to the CloudKit Console. . . Indexes and create an index for the Users. The 'validate info cache' message goes away, and the permission status is set to granted. Keep up the great work!
@bobearl99
@bobearl99 Год назад
A quick follow up: if I failed to index the Users before I requested permission, I could not reset the simulator to re-ask for permission (for example, no luck when trying to Reset Environment from the CloudKit Console, or even creating a new CloudKit database and indexing the Users). The only solution that I could find was to create an entirely new project, add the CloudKit capability, index the Users, and then request permission.
@Connor-pj2tg
@Connor-pj2tg 2 года назад
Hi Nick. Quick question. Despite requesting permission, the returnedStatus is always could not complete. Did you have any experience with this, or any tips to fix this issue?
@SwiftfulThinking
@SwiftfulThinking 2 года назад
Are you signed into an iCloud account on the device?
@Connor-pj2tg
@Connor-pj2tg 2 года назад
@@SwiftfulThinking yes. The weird thing is, I created another container and it worked fine, just not on the original one. Perhaps just a bug
@ملاك-ح5م2ث
@ملاك-ح5م2ث Год назад
Thank you so much Nick ❤
@dennismallette258
@dennismallette258 2 года назад
The permissions pop up does not come on my screen, does anyone know why it is not working?
@cibarra_dev
@cibarra_dev 2 года назад
Project Target / Signing & Compatibility/ iCloud / Container. Try making a new container
@DNeutron0
@DNeutron0 2 года назад
Would you release a CloudKit playlist?
@developer.yilmazer
@developer.yilmazer 5 месяцев назад
Thank you for sharing such helpful content! I've learned a lot from this video.
@Decatilinae
@Decatilinae 2 года назад
Hello Nick, as always, you are super... May I ask one question: I am based in the EU, and according to the DGPR law, how does CloudKit work under the hood? Is cloud kit safe for hack attacks or similar? Thanks for your attention
@SwiftfulThinking
@SwiftfulThinking 2 года назад
Hey Romesh! CloudKit is provided and maintained by Apple, so I'm sure it is very safe to use. Here is a quick link with some info: support.apple.com/guide/security/cloudkit-security-sec3d52c0374/web
@EliHartnett
@EliHartnett 2 года назад
Do you post the source code for your videos anywhere online? They are awesome by the way
@dr.craigcurphey4829
@dr.craigcurphey4829 2 года назад
In the case where the user has temporarily no access to the internet, is Cloudkit smart enough to store new records created by the app locally then fire the records out to the cloud when the connection is re-established, or is the app dead while disconnected? Thanks!
@SwiftfulThinking
@SwiftfulThinking 2 года назад
Hey Craig! Hope all is well with you.... No, CloudKit isn't that smart. I believe we can integrate it with CoreData to do this but honestly, I'm not familiar enough to say for sure. Regardless of using CloudKit, many apps will implement a fall back to temporarily save data in UserDefaults or CoreData while the user is offline.
@CandiceKhannaApps
@CandiceKhannaApps 2 года назад
I’ve been waiting for this 👏🏽
@SwiftfulThinking
@SwiftfulThinking 2 года назад
😎🤓🥳
@wandahu8058
@wandahu8058 Год назад
Good!
@sonumartin3253
@sonumartin3253 2 года назад
Does any way to get user's phone number without giving phone number? if not any apple documentation that specifies we can't get phone number ?
@zxccxz9283040
@zxccxz9283040 Год назад
All the calls to CloudKit that you are doing are done asynchronously. so how are you ensuring that they run one after the other?
@WeirdTKJackson
@WeirdTKJackson Год назад
He doesn't talk about NSPersistentCloudKitContainer instead of CKContainer. I don't know why.
@burakimdat7488
@burakimdat7488 Год назад
I did same coding with video. I can get user name and surname but email and phone is empty. Does anyone know why ?
@lincolndickerson1293
@lincolndickerson1293 2 года назад
The reason you cannot delete a cloudkit container is because Apple protects user data at all costs. The data in the apps CloudKit container belongs to the user not the app. To most it seems reasonable that before release there shouldn’t be any user data but Apple isn’t going to take on that burden when it comes to beta testers and sorting it out.
@thejaplong
@thejaplong 2 года назад
I am getting signed in = true, but permission: False; no chance to give permission . Maybe there is a simulator setting i haven't set ?? thanks for help
@thejaplong
@thejaplong 2 года назад
OK, fixed it ! I didn't realize that (apparently) the iCloud container's name must be identical to the bundle identifier. At least making this change worked for me !
@georgebarlowr
@georgebarlowr 2 года назад
@@thejaplong They don't have to be but it makes it a lot easier to setup if they are, since I believe if you want a different bundle identifier you have to manually initialise CKContainer whatever it is with that bundle identifier.
@dennismallette258
@dennismallette258 2 года назад
I get the same problem, I can’t get the permission window to come on the screen, I read that a lot of people are having the same issue, I tried resetting the environment in CloudKit but it still will not show the permission popup… my identifier and container are the same name… I will look into manually initializing the container as George mentioned… but I don’t know how to do that…
@Mitglied99
@Mitglied99 2 года назад
@@dennismallette258 just add a let container = CKContainer(identifier: "YOURCONTAINERID") and then use in requestPermission() container.requestApplicationPermsission... instead of CKContainer.default()
@tomqin3685
@tomqin3685 2 года назад
Hi! I got the permission pop up when i following to your video, but when i came to my little demo , with using same code and same Cloud Containter or new, I didn`t get the pop up ...😢😢😢 , and I found that the returnedStatus in requestPermission is returning [.couldNotComplete] instead of [.granted]
@mysterouis30
@mysterouis30 2 года назад
Did you get it to send the notification? Im having the same issue where the pop up notification isnt showing
@tomqin3685
@tomqin3685 2 года назад
@@mysterouis30 Try copy your bundle id into the input box when adding your containers of iCloudkit, It working on my new project😅
@mysterouis30
@mysterouis30 2 года назад
@@tomqin3685 I got it to work, i just manually initialized the container instead of using CKContainer.default()
@dr.craigcurphey4829
@dr.craigcurphey4829 2 года назад
Nick are you willing to do a video on sharing my privateCloudDatabase with another user? I have a clinic database for iPad & iPhone and I can use it but my wife can’t unless she logs out then logs in as me! I have spent weeks trying to learn how to do this, yet Apple documentation is most difficult as to be useless!
@SwiftfulThinking
@SwiftfulThinking 2 года назад
Hey Craig, I honestly don’t know enough about this to do an in-depth video any time soon. I know it is definitely possible without having to sign into each other’s accounts. There should be some documentation online around CKShare, but I think you need to set up Zones first - which is a whole topic in itself. I did a poll recently on topics to cover and there wasn’t much interest in CloudKit, so I’m not sure when I’ll get to this. On the brightside, Firebase ranked pretty high, which I know I promised you a while ago 😭😅
@ThePhotodiver
@ThePhotodiver 2 года назад
I was able to login to my iCloud account on the device simulator, but the status and permissions both say false. Not sure if this is the problem or not, but my Xcode account is different from my iCloud account with different logins.
@SwiftfulThinking
@SwiftfulThinking 2 года назад
Did you figure this out? I don't think the iCloud account will matter. Maybe the Container isn't set up fully?
@ThePhotodiver
@ThePhotodiver 2 года назад
@@SwiftfulThinking I am pretty sure it is setup properly as I can save items to the cloud and display them in a list. Not sure what I might be missing.
@AntonR8
@AntonR8 20 дней назад
Its deprecated
@calebyates253
@calebyates253 Год назад
You should probably black out the name that came back from your iCloud account, now we know your real name is Nick
@trungnguyenthanh9233
@trungnguyenthanh9233 Год назад
Nice content bro
@MarkVolkmann
@MarkVolkmann 2 года назад
The call to requestApplicationPermission fails for me. I get CKApplicationPermissionStatus(rawValue: 1) and the error messages "Service Unavailable", "Request failed with http status code 503".
@MarkVolkmann
@MarkVolkmann 2 года назад
It's working now! I think I wasn't signed into iCloud in the Simulator.
Далее
CloudKit - Intro, Pricing, Terms, & Definitions
17:26
ДУБАЙСКАЯ ШОКОЛАДКА 🍫
00:55
Просмотров 2,9 млн
skibidi army returns (skibidi toilet 77)
00:49
Просмотров 1,1 млн
Play: The Secret Weapon for iOS Devs & Designers
10:12
Announcing Deno 2
59:21
Просмотров 230 тыс.
SwiftData Basics in 15 minutes
15:18
Просмотров 48 тыс.
8. SwiftData   CloudKit
18:20
Просмотров 8 тыс.
Pick your dream Apple setup
22:26
Просмотров 907 тыс.
How to Make an App in 8 Days (2024) - Full Walkthrough
3:00:49
ДУБАЙСКАЯ ШОКОЛАДКА 🍫
00:55
Просмотров 2,9 млн