Creating a Segmented Control in SwiftUI

Stephen Feuerstein Tutorials

How do you think you would create a segmented control in SwiftUI? Just use UISegmentedControl, right? Wrong! Similar to the change a while back with UIAlertView rolling into a style under UIAlertController, SwiftUI introduces a View called Picker that has different styles. Setting Up First let’s get set up with what data we’re going to display with our segmented control. …

Creating a Repeating Animation in SwiftUI

Stephen Feuerstein Tutorials

SwiftUI is so amazing because of how much it takes care of for you. When you update the state your view updates automatically. Throw a call to withAnimation in there and it will even animate the changes! But what if you want an animation that repeats? Creating the Animation First thing we need to do is set up our View …

Working with Dates in Swift

Stephen Feuerstein Tutorials

It’s inevitable that at some point in your development career you’ll need to work with dates. Maybe you’re showing a feed of posts à la Facebook, or the upcoming schedule of your favorite sports team. While dates are easy conceptually, they aren’t so easy when you’re writing code for formatting and displaying them. The Date Struct The iOS SDK’s Foundation …

Understanding State in SwiftUI

Stephen Feuerstein Tutorials

Building pretty looking views is super easy with SwiftUI, but apps need to be more than just something nice to look at. Apps need to do things, then give the user feedback by updating the UI accordingly. With SwiftUI in order to update a View you need to change its state. What is @State? @State is what is called a …

Identifying Parts of Speech on iOS using Natural Language framework

Travis Buttaccio Tutorials Leave a Comment

Introduction In this tutorial, we will walk you through an example of how to identify parts of speech on iOS using Apple’s Natural Language Processing framework (also referred to as NLP). With a WrappingButtonView, some UIButtons and the Natural Language Framework we were able to create a simple and highly addictive game to test a user’s knowledge of the different …

Elegant Custom UIViewController Transitions

Tim Moose Tutorials 11 Comments

If you’ve ever implemented a custom view controller transition by adopting UIViewControllerTransitioningDelegate and UIViewControllerContextTransitioning in your view controller, you may have found that the result added unwelcome clutter to your view controller and wasn’t very reusable. This tutorial will show you how to build a reusable, standalone view controller transition by subclassing UIStoryboardSegue. You’ll see how the segue conveniently integrates …

Building Better iOS App Animations

Nathan Gitter Tutorials 5 Comments

Animations are key to a quality user experience. They serve a wide variety of purposes, including directing user attention and connecting user actions to results on screen. Animations make the experience of your app unique — they can enable a level of responsiveness and interactivity not possible in other mediums. To build better animations, they need to convey an improved …