We’ve arrived at day 86 of the 100 Days of SwiftUI! We’re starting another project today called Flashzilla. We finished our last project yesterday and are getting closer to the end. Let’s take a look at Flashzilla!
Flashzilla SwiftUI app introduction
In this project we’re going to build an app that helps users learn things using flashcards – cards with one thing written on such as “to buy”, and another thing written on the other side, such as “comprar”. Of course, this is a digital app so we don’t need to worry about “the other side”, and can instead just make the detail for the flash card appear when it’s tapped.
How to use gestures in SwiftUI
SwiftUI gives us lots of gestures for working with views, and does a great job of taking away most of the hard work so we can focus on the parts that matter. Easily the most common is our friendHacking with Swift, Paul Hudson (@twostraws)
onTapGesture(), but there are several others, and there are also interesting ways of combining gestures together that are worth trying out.
Making vibrations with UINotificationFeedbackGenerator and Core Haptics
We’re about to be introduced to another SwiftUI framework called Core Haptics. As the name suggests, it’s used to define and control vibrations by using the haptic motors in Apple’s devices.
Disabling user interactivity with allowsHitTesting()
SwiftUI lets us control user interactivity in two useful ways, the first of which is the
allowsHitTesting() modifier. When this is attached to a view with its parameter set to false, the view isn’t even considered tappable. That doesn’t mean it’s inert, though, just that it doesn’t catch any taps – things behind the view will get tapped instead. Read more about it here.
That’s it for day 86! We’re into the final two weeks now. It’s important to stay focused and keep moving forward, even if things get more difficult. We won’t be a full fledged developer by the end of this course, but that’s not the point. It gives us tons of knowledge to built upon and solidify, which in turn will help us get to the point we need to be at. We’ll be back so stay tuned for the last 14 days!