Category: ios

Articles about iOS development in Swift or Objective-C

Grid layout in SwiftUI

This article is about one of welcome additions to SwiftUI in 2020: LazyVGrid and LazyHGrid. As the name suggest, you can compose vertical and horizontal grid layout in a lazy way with those views. If you’re interested in lazy layout, check out my previous article on the topic. The sample project In this article I’ll

Continue Reading →

Lazy loading in SwiftUI

SwiftUI introduced from the very beginning the components HStack and VStack to group views in an horizontal or vertical stack. Those components load all their children up front, so they’re not suitable for implementing a long list of items, as you’d rather have lazy loading.One alternative was using the List component, which implements lazy loading,

Continue Reading →

Write a SwiftUI only app

This article is about some news in SwiftUI app cycle. With the second release of SwiftUI, is finally possible to make an app entirely in SwiftUI, without having to embed it in UIKit or AppKit on the Mac. We’ll see how to create a SwiftUI only app, manage independent Scenes and share data between them.As

Continue Reading →

Enhancements in Function Builders

This post is about enhancements in Function Builders in Swift 5.3. I wrote two articles about Function Builders in the past so you may want to check them out before continuing with this one. Introduction to Function BuildersCreate a DSL with Function Builders In 2020 SwiftUI expanded the way you can use Function Builders in

Continue Reading →

Dynamic fonts in WKWebView

I like the fact that Apple takes accessibility quite seriously. We have talks during WWDC, and tools like the Accessibility Inspector to help us test and audit our apps.In this article I’ll show you how to write your CSS in order to support dynamic fonts in iOS, so when your user changes the preferred font

Continue Reading →

Infinite scrolling in SwiftUI

Using lists is very common in an iOS app. UITableViews are great and have been there from the very beginning, so you can find tons of articles about infinite scrolling. But what about SwiftUI?You don’t have UITableView, but you can use List. Although you can achieve a similar result you don’t have the concept of

Continue Reading →

Navigation in SwiftUI

Back in July I wrote a post about Navigation in SwiftUI trying to explain the difference between NavigationLink and DynamicNavigationDestinationLink. The latter has been deprecated, so the article is now useless, you can still find it here http://www.gfrigerio.com/navigation-in-swiftui-deprecated/I updated the repository on GitHub to remove the deprecated code and provide a few examples of various

Continue Reading →

Diffable Data Sources

WWDC 2019 was really packed with new stuff for iOS and the new data sources for TableViews and CollectionViews didn’t get the same attention as SwiftUI but are a really nice addition for people still working with UIKit. I’m going to focus my post on UITableViewDiffableDataSource but there is a similar API for CollectionViews and

Continue Reading →

CoreData in SwiftUI

One of the topics I wanted to explore about SwiftUI was how to integrate CoreData in it, and I want to describe two approaches you can follow: a direct one using property wrappers and another one by having a class hide the existence of Core Data to the user.I usually prefer the latter, as it

Continue Reading →

Progress bar in SwiftUI

Progress bars and activity indicators is something we tend to use a lot in iOS applications and it is nice to customise them instead of using all the time the standard UIActivityIndicatorView.I think SwiftUI makes it really easy to build this kind of views and I implemented 4 of them in my sample GitHub project

Continue Reading →

Navigation in SwiftUI deprecated

UPDATE: DynamicNavigationDestinationLink has been deprecated so most of this article is useless. I wrote a new one and updated the GitHub repository In this post I want to explain the difference between NavigationLink and DynamicNavigationDestinationLink in SwiftUI with a quick example and point out the differences between them.You can find the sample code on GitHub

Continue Reading →

SwiftUI on Apple Watch

SwiftUI was one of my favourite announcements during WWDC 2019 alongside Combine. At the time I’m writing this post, mid July, beta 4 has just been released and although it isn’t yet stable I think SwiftUI is starting to get interesting. I think it will be hard to drop iOS 12 support soon, but SwiftUI

Continue Reading →

Ad Hoc distribution

I want to share my experience building and distributing apps with xcodebuild hoping to help some iOS developer struggling with automating build and distribution via command line. There are two ways to distribute a test version of your app for iOS: TestFlight and Ad Hoc.The former allows you to submit a build to App Store

Continue Reading →

Apple Push Notifications

Here’s a quick guide to implement Push notifications on iOS. Every now and then I need to implement push notification and I always forget how to create the certificate and convert it to use with python, so this guide will be helpful to the future myself and hopefully to some fellow developers 😉Actually, creating the

Continue Reading →