blog

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 →

NSAttributedString in SwiftUI

If you came across this blog post and you’re happy because you didn’t think it was possible to use NSAttributedString in SwiftUI I have a bad news: it isn’t supported yet. Text in SwiftUI accept a String and there isn’t the equivalent of attributedText you can find in UILabel. So what is this article about?

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 →

Property Wrappers

This year’s WWDC was packed with new stuff for Swift developers, and one of them is property wrappers, formerly known as property delegate. Actually we knew about property delegate before WWDC, as there was a proposal in Swift.org a few months ago (you can read it at this link) but we didn’t know about SwiftUI

Continue Reading →

Networking example with Combine

This is the second post about Combine, after my quick introduction you can find here http://www.gfrigerio.com/combine-first-example/I’m using the same GitHub project https://github.com/gualtierofrigerio/CombineTest but this time I’m focusing on networking, with a similar example to the one I used for my series of posts about Future&Promise, RxSwift and AlamoFire. I’ll build the same table view controller

Continue Reading →

Combine first example

This is the first of a series of posts about the new stuff announced at WWDC 2019. First of all let me tell you that it was one of the best WWDC in years, maybe even better than 2014 with the introduction of Swift. A new declarative UI framework was on my wish list, and

Continue Reading →

Moya and Alamofire

As I was playing with my GitHub project about networking I thought it would be interesting to try some different ways to implement the RESTClient protocol. In this article I’m going to show how I used Alamofire and then Moya (which itself uses Alamofire) instead of my custom network layer based on URLSession. I’m going

Continue Reading →

Callbacks vs Promises

Most of the apps we write rely on some sort of data fetching from the network. It can be our backend, or some public API, but we need to get data and we can only to is asynchronously. This is true for networking, but it isn’t the only case. In this article I’ll stick with

Continue Reading →

Show a PDF

Showing PDFs is pretty common for an iOS app. It could be a privacy policy document, an invoice, a flyer the company distributes on paper and via its app, a magazine.There are three possible ways of displaying a PDF. The simplest is to use a Webview. Just like loading a local page, or a remote

Continue Reading →

Barcode scanner

After a few projects made for fun, and for learning, I decided to publish something useful as a CocoaPod: a barcode and QR code scanner. I worked on a similar feature for an app available in the App Store in Objective-C, and decided to rewrite it in Swift to make it available on GitHub. https://github.com/gualtierofrigerio/GFBarcodeScanner

Continue Reading →

Testing in Xcode

I don’t think I need to write about the importance of testing. We all know it is critical to add some testing to the code, so we refactor code, add new functionalities, fix bugs and check that the existing stuff didn’t break. Maybe writing tests isn’t the most exciting part of the job, but it

Continue Reading →

Building a fitness app

In this article I’m describing the GitHub project FitnessExample you can find here: https://github.com/gualtierofrigerio/FitnessExampleThe main topic is communicating between iOS and watchOS, but I thought I could introduced some HealthKit stuff as well as fitness is a very popular category of watchOS apps. I’ll update the article as I add functionalities to the project, the

Continue Reading →

Building an image gallery app

I’ve just committed a project on GitHub for an app I’d like to make for myself. The idea is to show a hierarchy of images, organised in folders, via a table view for a quick preview and then in a scroll view once I select a particular folder. https://github.com/gualtierofrigerio/FolderImageViewer The idea is to show pictures

Continue Reading →

Adding maps to your app

I recently put a sample project on github for using Apple Maps on an iOS application as I wanted to play with Core Location and Maps since I only dealt with Google Maps via Javascript in my existing apps. Here is the link to the project: https://github.com/gualtierofrigerio/GFMapKitWrapper I’ll eventually make it available on CocoaPods so

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 →

BeatsX vs AirPods

I bought BeatsX right after they were available and this fall I found a good deal and finally got a pair of AirPods. Now that I have both I can write a quick article about the pros and cons, I sometimes find twitter threads about which one to buy and 280 chars aren’t enough, so

Continue Reading →