Hi Joe - if you want this course in text form, check out our book the iOS Apprentice. The early access version of the 8th edition, which includes the content from this course in text form, is out today! :]
Iāve done lessons 1-46, so Iāve got a working app but for some reason on my phone (iPhone SE) the buttons arenāt displayed correctly like in the simulator. They have the right shape but theyāre the āmidnightBlueā colour. Iāve checked if thatās also the case with your app to check if it was my mistake but itās also a problem with your app. Everything else but that is fine. Have you got an idea why itās happening and how to fix it? Iāve got all the updates on both my mac and iPhone. Stackoverflow didnāt really help.
I ran the Bullseye project on the simulator and noticed that the Info button only works the first time you press it. Afterwards it does nothing. I checked it on my phone and it works as expected so the problem is with the simulator.
I tried this on another I am writing and ran into the same problem.
Do you know if there is a way to get the simulator to work correctly?
Thanks!
Hi,
Last time I checked (last week) it had the problem. But I have moved on to other projects and have not looked at it recently. Do you know if anyone else saw a similar issue or could it be an issue with my computer?
I am having strange issue before .padding worked but when I added navigationBarTitle the padding gives "āInt: is not Convertible to 'CGFloat?ā
Here is part of the code:
.padding(.bottom, 20)
}
.background(Image(āBackgroundā), alignment: .center)
.accentColor(midnightBlue)
.navigationBarTitle(āBullseyeā)
If I remove padding from the code then the error goes to:
Text(ā(self.target)ā).modifier(ValueStyle())
Error says: Type of expression is ambiguous without more context. I tried removing self but still has a error
Hi there! My name is Nikita. Iām from Russia. In my opinion, this course is awesome. The first app on the first course, wow! To be honest, my English is not very good, but I understand almost everything. I will be happy to recommend this course to my friends. Thanks Ray!
Ray, I have a question.
In the app you defined a custom view modifier struct called LabelStyle .
struct LabelStyle : ViewModifier {
func body(content: Content) ā some View {
return content.foregroundColor(Color.white)
.shadow(color: Color.black, radius: 5, x: 2, y: 2)
.font(Font.custom(āArial Rounded MT Boldā, size: 18))
}
}
After that you used this LabelStyle to style/modify the text like below. You created an instance of LabelStyle() and pass it s an argument to modifier function
HStack {
Text(āPut the bullseye as close as you can to:ā).modifier( LabelStyle() )
Text(ā(target)ā)
}
Generally I get all of these but there are a few things I want to understand.
1- In the LabelStyle struct we wrote body function and this function is doing all the styling work and returns the styled view. However when we use LableStyle we only created a instance of it and passed it to modifier function(.modifier( LabelStyle() )). We never called body method for the instance we created. How/when/where this body method is called? Could you please explain this with an example?
2- Could we call this body method manually and style a text instead of using modifier method? Is so please could you example?
With the new swiftUI 2.0 there is a new app structure I got all the way to adding the info page and I have no app delegateā¦ so I guess I lucked outā¦ was close to getting it finishedā¦
Hi Ray! I just finished Your First iOS and SwiftUI App, but when I tried to run the app on my iPhone 8 Plus, I encounter some layout problems, it looks like the app doesnāt really fit on the screen of my phone. There is such a way to create app with an auto layout? On the subscriber tutorials I will performe this kind of issue?
Thanks!!
Thanks for the excellent content. Iām new to iOS development as well as iPhones (donāt own a one yet). Iām really sorry for asking this here but would you mind sharing your experience by recommending a particular device to buy as a developer?
The new iPhone series is down the line and itās rumoured to have a LiDAR Scanner. Do you think these features worth for the future-proof development?
Thanks, this is a fantastic beginners tutorial. It stopped working for me after upgrading to iOS 14. Will there be an update version of the SwiftUI app tutorial video or book for iOS 14 and Xcode 12 soon?
Yes! I have recorded a massive update/overhaul to this course, which includes (among many other things) a total redesign of the app that showcases some cool features of SwiftUI.
The course is currently in editing, and should be published on our site soon.