Your First iOS and SwiftUI App | raywenderlich.com

If you're a complete beginner to iOS and SwiftUI development and wondering how to get started, this is the course for you.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/4919757-your-first-ios-and-swiftui-app
1 Like

Hi Ray! Are there another (e-mail, text) versions of this and another courses?

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! :]

1 Like

Hi Ray!

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.

Thanks in advance!


Edit: found a solution on this website:

https://www.hackingwithswift.com/quick-start/swiftui/how-to-disable-the-overlay-color-for-images-inside-button-and-navigationlink

Just need to add this line:

.buttonStyle(PlainButtonStyle())

to the Button

@kammahha Thank you for sharing your solution - much appreciated! :]

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!

@dianehoff Do you still have issues with this?

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?

Thanks,
Diane

Diane - I am having the same problem.

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!

A conversation over on Stack Overflow indicates that this is a bug fixed in v11.4 of Xcode.

@tyfightercode Do you still have issues with this?

@niketracer Really glad you enjoy it! Cheers! :]

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?

Thanks

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!!

Hi @rwenderlich,

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?

Thank you!

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. :heart: