Today marks the start of the second project building of what I learned last week. This week goes over Building an application called Guess the Flag, a small game where the player would display the country’s name and select the respective flag. Additionally, it involves creating a scorecard and a reset button. However, the main focus is to learn how to manage assets. (hint: If you know how to manage assets in UIKit, you also know how it works in SwiftUI.)
So in SwiftUI, the interface is based on objects that you create. To group these items, you would use a stack. There are multiple types of a stack,
We will use multiple stacks through this project, and it will become standard in later projects. Another part of today was learning how you use colors in SwiftUI, and Colors are effortless!
is all you need. by wrapping two items in the
Then add an alert to the view, using code like this:
Today we started creating the layout for the game. Like I previously mentioned, SwiftUI requires items to be nested within a Stack. Today, we added the buttons and the two
The last thing we did in today’s lesson was to style the buttons, by adding an
Today is a wrap on project two. There were some challenges assigned to finish out the project. Then finally a quiz to check my knowledge. The Challenges today are:
Results are 11/12 Closing out today, I took the 12 question review. This time I scored better than the last time at 91%, with 11/12 questions correct! It felt like I had studied for the test and didn’t feel nervous at all.
With a good cup of coffee in hand, I am ready to start today’s lesson. Today we begin covering some fundamental components of SwiftUI: Views and Modifiers.
SwiftUI uses
After understanding why SwiftUI has great performance, we learned the importance of modifiers having an order.
This you would think this would add a background color to the frame, right? No, it applies the color to the text, not the
In SwiftUI Every modifier generates an item, and that item can be modified. In the program content today Paul shows a code snippet of a button printing using
SwiftUI uses
So last week, I had mentioned that SwiftUI has a limitation regarding static data. Today we learn why. Most stacks and view protocols create a hidden
Consolidation Day Today is one of the first consolidation days of the program. Today’s goal is to review what I have learned and review items that I feel I could spend more time learning. So I continued to study the previous lessons before starting today’s challenge.
The challenge for today is to create and to play the classic game rock, paper, scissors. This elementary project uses
Today we embarked on our new project, Starting with learning how UI elements like Steppers and Date pickers work. Additionally, The complexity that is using Dates as a programmer. Luckily Apple provides a seamless way of handling date data within the Foundation framework, embedded in SwiftUI and Swift.
Steppers are effortless ways of adding a more targeted incremental number improvement.
To implement the
Additionally, using this code to add the stepper into the view
iOS Date pickers have experienced a significant shift in design with iOS 14 and now look more like a button and display a view to select the desired date, time, or both. Fortunately, you can force SwiftUI to display the old style by adding this property to modify the date picker.
First we would create an
And we will add the date picker using this simple code:
The last topic of today is getting started with CoreML and using the CreateML application. CreateML is an application that comes from Apple that makes it effortless to create a Machine learning module. This project provides the input data to be used to generate the model. We will go further into Machine Learning later this week on the next project.
We are at the end of the second week. Day by day and I don’t feel the strong need to look up every step. Now when the project directs me to do something, I am trying to solve it without looking up resources. With significant changes in my work schedule, it’s been more of a challenge, but I am finding small increments of time to fit in a 15-20 minute session to learn something new. I can’t wait to have more substantial proficiency in both Swift, And SwiftUI!