I am having an issue at Extracting Views in the Polishing the App section. Specifically, I am having trouble with the Bullseye app: I am getting a Cannot find ‘SliderLabelText’ in scope error in my ContentView.swift file which is GitHub - pmdenlinger/Bullseye: SwiftUI version using Xcode 12.5 in the latest commit. The errors are on lines 48 and 50. I have looked over and over in the ContentView and TextViews file and can’t find what’s wrong.
Hi @pdenlinger! In Xcode 12.5 the compiler no longer automatically converts Int to CGFloat like it did before. To fix this, modify the line where you create InstructionsView in ContentView.swift as follows:
Thank you; why did they make this change to the compiler. Did they want to make the typecasting more explicit.
Your course is excellent. I like that your video courses and books go very well together; I am now working on closures, enumerations and protocols, and the Swift Apprentice book helps in my getting a deeper understanding of these important features. Great job!
@pdenlinger I’m not really sure why they made this change! If anyone else knows, feel free to chime in :]
Thanks so much for your kind words about the course! I’m glad you’re enjoying the Swift Apprentice too, and that’s great that you’re making use of both the books and the video courses, that’s why we create both! :]