Thanks for this Stewart. FYI, the perceptual option is there because when doing color calculations in RGB spaces, the results can look awful. RGB doesn't take in to account how we actually see color. This, along with the limited gamut of colors in RGB, is the reason why so many RGB gradients look bad. (e.g. mixing red and blue, or yellow and blue.) The perceptual option probably uses something like the CIELab color spac, to perform mixing while taking the perception of luminosity and saturation into account. Cheers
Hi Steward its come to my attention that the EventKit documentation is very outdated and many people on reddit were asking if there are any good EventKit tutorials out there and there aren't. Maybe this is a future video idea
I have 2 questions here. 1) Book is parent and Quote is child. What is the reason for "var book: Book?" inside Quote model. How can a Quote exist without a Book. 2) What is the rule to figure out if I need to establish a relationship between properties of different models?
As you will see, this is a requirement for CloudKit for relationships, This comes later Another reason might be wicked be if there was no cascade delete on a book, then your could have an orphan quote. I don’t understand your second question however. If your model has any property’s that are linked to another model, then you need a relationship. That would be either one to one where, one to many, or many to many.
@@StewartLynch I think you answered my question. One of my model property is linked to another model. Here are my updated models after seeing this video. Yet to try it out but hopefully it is correctly setup. What do you think? @Model class ShowModel { var name: String @Relationship(deleteRule: .cascade, inverse: \SeasonModel.show) var seasons: [SeasonModel] = [] init(name: String, seasons: [SeasonModel] = []) { self.name = name self.seasons = seasons } } @Model class SeasonModel { var season: Int var episodes: Int var show: ShowModel? init(season: Int, episodes: Int = 0) { self.season = season self.episodes = episodes } }
Brilliant project structure you could add @Model to City and with 4 or 5 lines of code change the project from file storage to SwiftData if needed in the space of a few minutes
I don't know what we would do without this channel, he uses the most up to date coding techniques and writes the cleanest simplest code possible. This channel will create more IOS developers than any bootcamp.
I found a bug with the transition. If we dismiss the detail view with a gesture and immediately try to open another card, it misses touches. If we give it a little delay, then everything works well.
Thanks for this Stewart. It's interesting that we need need to use @State when using a TimeDataSource. I'm not sure why, because I thought State was supposed the proper way for SwiftUI to track all changes in a View...
Hey I really like your videos. But would you be able to maybe acknowledge some of the benefits in the title? For newer devs like myself it helps me know whether the video is relevant or something that may be of use learning. Thanks
It is all worth learning 😀 Titles are tough to describe the content. What about the description. Plus I always do a short intro at the beginning saying g what the video is about.
That was a really informative and explanatory videos. Thank you for your hard work. Much appreciation for your dedication to the iOS development community.
Once the migration from summary to synopsis is done can the @Attribute decorator be removed? If not, what if synopsis should later be changed to "InMyOpinion"? What should the originalName be - summary or synopsis?
That would be unwise because you might have people who have not used your app since the first migration so a lightweight migrtion woud not work for this. YOu would have to use a full migration strategy here. I have yet to do a video on that topic, but it is a good one so I will do that later this year.
Excellent. One problem I ran into though. I have a list of students in the sidebar and I am using the detail screen as the edit student view. When I delete all my students in the sidebar using swipe action, the ContentUnavailableView shows up as expected in the sidebar but in detail view the last item that I selected to delete stays there in the detail screen. Not sure what is happening.
@@StewartLynch The ContentUnavailableView does display in "SIDEBAR" as soon as all items are deleted in the array. But the DETAIL screen some how retains the last selected item from sidebar. Hard to put in words.
I get the same results, and transition looks glitchy. If you go frame by frame, you will be able to see the photo twice during the transition. It seems like image view is zooming into the whole view, but the image gets recreated. Has anyone been able to find a solution to fix this?
error1:Type 'ChartDataSet' does not conform to protocol 'RangeReplaceableCollection' error2:Unavailable instance method 'replaceSubrange(_:with:)' was used to satisfy a requirement of protocol 'RangeReplaceableCollection' can you help me?
Am hoping to learn how a user can select text in an editable field, then render the selected text. I've watch most all of your excellent vids. But I've not seen how to determine which text is selected, then perform some replacement, or optional rendering on the selected text. This video takes a few steps in the right direction. Looking for the missing lessons!!
Thank you for the informative video! What causes the gray background behind the corner radius on the clipshape? Is that the shadow or just something with the beta or is that something that needs to be coded around? (Sorry, I don't have the betas installed so I can't test it myself.)
Thanks for pointing that out. I never noticed that. It is definitely the shadow that is causing it. I would just remove the shadow. It appears that a shadow on a clipShape is janky
Thanks Stewart. Loved the video. I have not been able to get the .clearbuttonMode to work when using axis: .vertical parameter. Does the axis parameter mean that the textfield no longer conforms to UITextField?
I just downloaded the completed project from this video and updated the deployment target to iOS 18 and using Xcode 16, I could see no issue. The clear button still works.
@@StewartLynchThanks for the speedy reply! I downloaded the completed project and using my minimum deployment iOS16.2 and XCode 15.4, the clear button works as you described/intended. However, when I changed the textfield line from: TextField("Enter Integer Number", text: $intNumberString), to TextField("Enter Integer Number", text: $intNumberString), axis: .vertical) the clear button (the image "multiply.circle.fill") does not appear.
@@vloggymcvlogface OK. You are right. That breaks it. You could remove that line in the view, and surround the Content in the view modifier with an HStack and add your own clear button there. HStack { content Spacer() if !text.isEmpty { Button { self.text = "" } label: { Image(systemName: "xmark.circle.fill") } .foregroundStyle(.secondary) } }
@@StewartLynch With a small modification your suggestion works just fine: 1. the xmark did not go away when the field was not in focus, so I created a new FocusState boolean which I passed to the viewModifier to set the opacity of the xmark to 0 when the field did not have focus. Also I tried changing the HStack to a ZStack to get the xmark inside the textfield but I couldn't figure out how to prevent the inputted text from overwriting the xmark. An issue for another time... Thanks for your help and I love your other videos. Also thanks for suggesting Fireside Swift - I have listened to all their podcasts FWIW I wrote my code in FortranIV in 1970 and I still love coding. Cheers John
@vloggymcvlogface what I don’t really understand is why you would need a vertical access for a numeric text entry. Would it not always be on a single line?
Thanks master Lynch for a superb video 👏, how come my swiftUI notified me: 'cannot find ScrollPosition() in scope' ? only scrollPosition(id: ) available ?and I shift + click on Scrollview() -> will lead me to func scrollPosition(id:anchor:)
Thanks for this Stewart. Update for 2024: at least of Xcode 15.4, iOS 17, there is no longer different indenting amongst the different initializers. Also, using .tint() on a DisclosureGroup will now only affect the color of the chevron, not the title/label. Cheers.
Great video, Stewart! I was wondering, when you mention Command-return to get full parameters, that doesn't work for me. I have to use Option-return. Is that something odd with my keybindings?
You are absolutely right. My fingers know what I am doing, but my brain does not always. Thanks for pointing this out. It is the option key that will get the full parameter list, not the command key.
Another series of very valuable information. I was able to use a large part of it directly in one of my small side projects. As mentioned by another user, the enum conforming to the View protocol approach is great. Thank you very much Stewart. ❤
.navigationDestination(for: MyImage.self) { image in Group { if fullOption { DetailView(image: image) else { DetailView2(image: image) } } .navigationTransition(.zoom(sourceID: image, in: transitionNamespace)) Can you tell me why you reused the namespace? Is it not possible to do it like this?
I am very sorry but I am really having a hard time grasping this concept, hopefully someone will answer. So for the alignment guide, let's say for the first demonstration ZStack(alignment: .leading) { Rectangle() .frame(width: 100, height: 100) .foregroundColor(.red) Rectangle() .frame(width: 75, height: 50) .foregroundColor(.blue) .alignmentGuide(.leading, computeValue: { dimension in 50 }) } why did both the blue and red boxes moved though? (blue to the left and red to the right) cause we only changed the alignment guide for the blue rectangle right? So I'd understand if it's only the blue that shifted, but why is it both thou?