Curious? Get three great screencasts FREE
Bite-sized videos on iOS development.
The iOS landscape is large and changes often. With short, bite-sized videos released on a steady schedule, NSScreencast helps keep you continually up to date.
Up to date with Xcode 12 and iOS 14
UIKit, SwiftUI, and macOS
Swift Language
High Quality Videos
Short and Focused
Any Device
Team Plans
Have I mentioned lately how awesome NSScreencast is? No? Worth the subscription. Check it out if you’re an iOS developer. Or even if you’re not and you want an example of how to do coding screencasts well.
Got tired of dead-end googling so I checked to see if @NSScreencast had covered what I was looking for. Of course he had, 4 years ago. Should have checked there first.
One 13-minute episode of @NSScreencast just paid for the yearly subscription fee in amount of time saved. Do it.
Seriously great stuff even for seasoned developers. I’ve learned a good amount from Ben’s videos.
You can really expand your development horizons in just a few minutes a week with NSScreencast.
Random PSA for iOS developers: @NSScreencast is a great resource, and worth every penny. It’s high quality, practical, and honest.
Can’t say enough good things about @NSScreencast There is gold in the Road Trip DJ Series.
I just reuppped my subscription to @NSScreencast. [An] indespensible resource if you’re into iOS or Mac Development.
Just finished @NSScreencast series on Modern CollectionViews. Strongly recommended. Programmatic UI, nicely structured code, easily approachable explanation style. 👌
#453
First introduced in iOS 13, UICollectionViewCompositionalLayout is an amazing and powerful addition that gives you lots of flexibility when describing layouts. There are a few new types to get used to (namely sections, groups, and items) but they all work together allowing you to keep layout separate from your views and your data.
#452
With UITableView no longer being encouraged for use, we need to replace this behavior with UICollectionView. This is where UICollectionViewListLayout comes into play. Using this layout we can get the familiar table view appearance in plain and grouped styles (as well as additional styles to support sidebars on iPad and macOS). This includes support for sticky headers and footers, swipe actions, and other UITableView behaviors that we've come to rely on.
#451
In this episode we migrate our collection view to use the new cell registration API. Using this API we no longer need to cast dequeued cell types to our custom types. Instead, we set up the registration object with the cell type and the data we'll be passing to each cell. This further reduces the code we have to write in our datasource implementation and gives us more flexibility on how and where cells are configured.
#450
In this episode we review the basic example app and start setting up our collection view in code. We start with the basic flow layout which is most common. Later we'll refactor this to use the newer style, but this episode introduces the series and sets up the foundation we'll build upon.
#449
If you can describe your animation with a small number of parameters that interpolate over the animation, animation is pretty easy. But once you want to combine an arbitrary number of animatable data values, for instance an array of Doubles representing our points, then you have to resort to a custom VectorArithmetic implementation. In this episode we will create an AnimatableVector type that is capable of animating between arrays of Double values. We then use this type to animate between 2 sets of points using our waveform algorithm.
#448
Animating in SwiftUI can seem like magic, until you want to animate something custom. In this episode we'll add animation to our frequency, amplitude, and phase parameters for our waveform by leveraging SwiftUI's AnimatableModifier protocol. We'll see how to implement the animatableData property with one, two, and ultimately all three parameters. We'll cover implicit and explicit animations, as well as the behavior when attempting to mix animations.
#447
I've been working on rendering waveforms using mathematical functions and have found the experience to be both fun and enlightening. In this episode we will develop a method to render arbitrary functions using a Shape, then explore some mathematical concepts that can help us render a nice looking waveform that could be use to indicate activity in sound, speech, or other effects.
#446
Simple animations in SwiftUI are refreshingly easy. However, some animations are deceptively tricky, as we don't have access to completion handlers. Animation is entirely state-based, so if we have an animation where an item needs to move and return to its original state, we need to take a different approach. In this episode we will model a bounce animation using a simple sine function, feeding in the time value t using SwiftUI's linear animation interpolation.
#445
With the introduction of LazyVGrid and LazyHGrid In iOS 14 we now have access to much more powerful grid-based layouts in SwiftUI. In this episode We will examine the different types of layouts we can accomplish with flexible, fixed, and adaptive sizing for our rows and columns. We'll look at how animations work between different layouts, and how to consider larger screen sizes.
#444
A few episodes back we covered how to wrap a UIActivityIndicatorView to show loading progress in SwiftUI. Now in iOS 14 this is built in. In this episode we'll cover the various styles, how to hook it up to a Progress instance, and how to create your own custom progress visualizations.
#443
iOS 14 Beta is now available and one of the new features is Lazy stacks. With a normal stack, all the layout happened at once, which meant poor performance for large lists of content, grids, etc. With Lazy stacks the views are only created when they first come on screen, greatly increasing the usefulness of stacks for large or infinite collections of content.
#442
Anchors are a way we can refer to the absolute positioning of a view at any level in the view tree. This is useful when you want to have one view surround, underline, or point to another element in the view tree. Combined with GeometryReader, you don't need to worry about converting between coordinate systems like you do in UIKit. Anchors work much like other preferences, with some small differences. In this episode we will build a bar graph view, then use anchors to animate an indicator on the selected item in the graph.
#441
Paging between views is something that is not yet provided by SwiftUI, but we can lean on UIViewControllerRepresentable to borrow this behavior from UIKit. Doing so we'll learn about the Coordinator design for handling events via delegates and datasources. We'll also see some of the rough edges you might run into when using this technique.
#440
It can be cumbersome to pass values from parent to child view to configure something. For instance, setting a font for many Text views inside of a VStack. Luckily there is a .font() modifier that can do this for you. How does it work? It sets a value in the Environment using an EnvironmentKey. In this episode we will learn how to leverage the SwiftUI environment to pass values to descendent views, regardless of their depth from where it is set.
#439
Using Preferences we can communicate data, such as the actual size of a view, to any ancestor view. By taking advantage of the reduce function required by the PreferenceKey protocol, we can combine multiple values in whatever way suits our needs. In this episode we will use this technique to size a bunch of sibling views equally by collecting the biggest width and then pushing this value down to subviews with some parent state.
#438
In SwiftUI we use State to push values from a parent to a child. What if you want to go the other way, passing data about a child up to a parent? To do this we can leverage Preferences. In this episode we will see how to define a custom preference key, how to use an overlay with a GeometryReader to measure the size of a view, and then set a preference with the view's size. Then we'll learn how to respond to preference changes in an ancestor view.
#437
Buttons in SwiftUI are much more flexible than UIButton in UIKit. For starters, there is no assumption that our buttons are just text or an image, they can use any view whatsoever for the content, which is called the "label". Using Button Styles we can create buttons in whatever shape or form we desire. In this episode we create three different button styles using SwiftUI to show how flexible they are and how easy they are to reuse.
#436
With extensions we can encapsulate common layout and styling logic that can be reused across many views, however they do have limitations. In this episode we will see how we can create View Modifiers that allow you to leverage @State and other View-related behavior and apply this behavior to arbitrary views.
#435
In UIKit we use imperative code to do things like display alerts, but in SwiftUI we have a declarative structure. In this episode we will see how this changes how we work with alerts. We'll look at two ways of showing alerts, one with a simple boolean state variable, and one with a bindable identifiable type that is passed to our alert, which we use to show a specific error message if an operation fails.
#434
In UIKit we've often lamented the fact that there is no builtin facility to load an image with a URL, leaving developers to implement this on their own. In SwiftUI the situation is the same, however we have more flexibility to build what we need. Using a Swift package called FetchImage, we will create a reusable ImageView struct that can load our images efficiently given a URL.
#433
With SwiftUI views we no longer have view controllers, and this can pose the question: Where does our data access and networking code live? In this episode we will load some data from a movies API in order to examine the ObservableObject protocol.
#432
The Breathe app on watchOS has a really excellent animation. In this episode we attempt to recreate this animation in SwiftUI using offsets, rotation, and scaling, then making the animation repeat forever.
#431
SwiftUI is really fun and easy to work with, but what if you need to work with a view that already exists? This episode covers the UIViewRepresentable protocol and we use it to provide a UIActivityIndicatorView to SwiftUI. The same approach can be used to wrap your own custom UIViews as well.
#430
In this episode we add the ability to provide modal content from outside of the modal view. To do this we can leverage @ViewBuilder which is a type of Function Builder. This is a new Swift feature that gives SwiftUI's syntax a DSL rather than writing out vanilla Swift syntax.