Ray Wenderlich First iOS SwiftUI App Course - Part 5

Yes three days in a row! Though the blog date for one of the entries was the 25th when it should have been 26th...anyway not to worry. Last bit of Ray's course!

Start Time - 18:11

Right, the last bit to do will be the graphics - the different pictures and views.

Images

This is a bit I sometimes get confused with. All of the images have been created specifically by Ray - for me it's just clicking and dragging to the assets folder. So 1x, 2x and 3x.

We don't need to use 1x any more! No need to bother with that.

I remember using a programme I had downloaded that create all of these for you. Anyway, leaving that for now.

This is the website with the guide to device resolutions -

https://www.paintcodeapp.com/news/ultimate-guide-to-iphone-resolutions

Background is a method that can be used. Awesome!

View Modifiers

*Delayed for around 15 minutes

There is a great website www.iosfonts.com

This basically has all the info for using specific fonts! This is SOOOOO much better than the options on Xcode. It will make my apps look so much more personalised.

I much prefer this use of putting in code for the content view and how it matches to the canvas.

For the font settings, we can define our own class or struct.

Challenge! Done!





Paused at 19:00; restart at 19:33

Styling the Buttons and Slider

So there has been a struct for the text style on buttons, background bits added...all good!

Accent colour -

Colour picker - use this online to get the best colour! Gets all the values etc.

The accent colour bit can be changed basically. Best to create the colour variable once then apply it.

Adding an About Page

Stack view -

let contentView = NavigationView() {
            ContentView()

        }.navigationViewStyle(StackNavigationViewStyle())

Putting this code in sets it all up!

Navigation views are cool. The title is slick, and it adds the back buttons between the views.

 NavigationLink(destination: AboutView()) {

In the main code, this replaces a button for the code!

Cool!

Challenge...I know what this will be - styling the about page so it's the same as the other one!

My idea for this is to create a separate Swift file. This will have all of the structs for styling, so then every page can use. That may not work!

OK forget that. Ray has given much more specific instructions!


That last bit says Hint: Google Search Colour. 

Right let's do this!

OK all done apart from the background colour part....

One error - padding goes much better in the style struct than within the whole VStack. It applies all of the padding for multiple lines that way. 

And I had the colour thing! Was just making that bit of code too complex. OK cool. 

But this colour is not filling the screen properly. There is a way of doing this - as a group...

Finish Time - 21:11 (approx 1 hour 30 minutes)

So a long, long session but lots learned! I enjoyed this course a lot and am definitely getting familiar with Swift UI. What I MUST do next is an interim entry, where I will play around with some VStack, HStack etc. Then I will move on to the next Ray course but NO RUSH!



Comments

Popular posts from this blog

*Xcode Project Entry 2* F1 Quiz - part 1

Angela Yu Course Part 10 (up to lesson 112)

Angela Yu Xcode 12 Course - Part 7 (lectures 74 to 79)