Latest blog post
Extracting structured data from PDFs using Gemini 2.0 and Genkit
A few days ago, Google launched Gemini 2.0: Flash, Flash-Lite, and Pro. One of the key features of this version is the context window of 1 million (or, in the case of Gemini 2.0 Pro, 2 million) tokens.
This is enough to pass entire books (the King James Bible has slightly more than 1 million tokens) to the model, which opens the door for some pretty cool use cases.
In this blog post, I show how to use this feature to extract structured data from PDF files. Gemini's vision capabilities allow us to implement some cool OCR features, such as reading hand-written notes on forms.
Sponsored Link
Alex Sidebar = Cursor for Xcode
Alex is the iOS & Mac Developer’s ultimate AI assistant. It integrates with Xcode, offering a best-in-class Swift coding agent, image codegen, fast apply, autocomplete, auto fixing errors and warnings, and so much more. Start your 7-day free trial today!
Swift
Updating the Visual Studio Code extension for Swift
The aim of this extension is to provide a high-quality, feature-complete extension that makes developing Swift applications on all platforms a seamless experience.
… "on all platforms"?! Does this indicate a transition from Xcode to VSCode?
Both Rudrank and Thomas have written about using VS Code (or Cursor, which is based on VS Code) to build SwiftUI apps, and I've added yet another article to this episode of the newsletter that lists all the steps required to achieve this.
Using VS Code for SwiftUI development is definitely possible (see all the articles I linked), but it's not an out-of-the-box experience - you have to basically set this up yourself.
Will Apple one day abandon Xcode in favour of VS Code? I have doubts, but I also wouldn't be surprised.
Problematic Swift Concurrency Patterns
Instead of a collection of "best practices", Matt decided to focus on common pitfalls and things that might not work out as expected.
If you're looking for readily applicable recipes, you might be a bit disappointed, as all of these will require you to think through how they apply to your code. However, I am confident that you will find this collection to be a valuable resource that you'll return to often.
SwiftUI
SwiftUI Environment
I think it is fair to say that the SwiftUI Environment is the backbone of what makes SwiftUI and its view modifiers work. There are plenty of articles about how to pass data in SwiftUI via the environment, how to use the new(ish) @Bindable
property wrapper with the environment, a list of all the SwiftUI environment and preference keys, and more, but this article by Natalia Panverofa provides a neat and thorough overview of what the environment is and how you can use it.
Mastering Forms in SwiftUI: Selecting Information
Do you get excited when you hear the word "form"? Yeah, me neither. Who likes filling forms, after all?
However, the Form
API is one of the truly fascinating areas in SwiftUI. At first glance, it might seem that most of the functionality that Form
views provide can also be achieved by using List
s....
In this blog post, Tiago covers another fascinating feature of the Form
API - Picker
s! It's honestly quite astonishing how many different types of pickers SwiftUI supports, and this post provides a really good overview (not the least because is shows all of them in action).
Debugging SwiftUI’s Entry Macro
The @Entry
macro produces the same code as the conventional way to add an environment key. Or so we’ve been told by Apple. However, it turns out there is a subtle yet critical difference. Great sleuthing by Michael, and as always: you learn best by using stuff for real.
How to use Cursor (or VS Code) to Build SwiftUI/iOS Apps
I love that this articles lists "willpower" as one of the prerequisites for using VS Code to build SwiftUI apps.
AI and ML
Deep Dive into LLMs like ChatGPT
A long, but very good introduction to how LLMs work by Andrej Karpathy. It covers all the key aspects, from preparing the training data, tokenizing, why models hallucinate, memory, tool calling, and much more.
At slightly more than 3 and a half hours (!), this goes well beyond the average attention span, but I promise, it's worth it.
Harnessing AI for Intelligent PDF Processing in Swift: From OCR to Context-Aware Chunking
In this post, Natasha shows how she implemented the Chain of Agents framework using Swift and two different LLMs.
Even though LLMs like Gemini 2.0 Flash have very large context windows, it might be a good idea to break large documents into smaller fragments (a process called "chunking"), and Natasha shows how she uses Gemini to create semantically coherent chunks.
I'd like to note that - if you use Vertex AI in Firebase - you don't have to use an AI proxy service, as the communication between your app and the backend will be protected by App Check, and there will never be an API key in your client app.
From PDFs to Insights: Structured Outputs from PDFs with Gemini 2.0
Gemini 2.0 Flash has a context window of 1 million tokens (that is almost the entire Bible), which makes working with long texts a lot more feasible.
In this blog post, Philipp walks through the steps for setting up Gemini 2.0 Flash in Python, and then shows how to use it to analyse PDF files.
What's really impressive is the model's capabilities to do OCR and detect hand-writing. Extract data in a structured way (e.g. from an invoice) almost looks boring in comparison.
Concatenate a directory full of files into a single prompt for use with LLMs
Have a folder full of files you need to concatenate so you can pass it to an LLM as part of the context? Use this tool.
Gitingest - Prompt-friendly codebase
Dump entire GitHub repos into a single file. Useful for sending to LLMs to discuss your codebase.
Repomix - Pack your codebase into AI-friendly formats
Same as GitIngest, but has more options. Always good to have alternatives!
Tools
Make Any File a Template Using This Hidden macOS Tool - MacRumors
There are so many hidden gems in macOS you probably didn’t know about. Here is one that - once you've used it - you might not know you ever managed to live without it.
Conferences
iOS Conferences 2025 - Update
A bunch of conferences already took place, and a few others have published the dates they will take place on.
Dates announced and tickets on sale
- Unwrap Live, March 8th, 🌐
- ARCTic Conference, March 11th-13th, Oulu, 🇫🇮
- AppDevCon, March 18th-21st, Amsterdam, 🇳🇱
- SwiftHeroes, April 8th-9th, Turin, 🇮🇹
- try!Swift Tokyo, April 9th-11th, Tokyo, 🇯🇵
- Deep Dish Swift, April 27th-29th, Chicago, Illinois, 🇺🇸
- iOSKonf25, May 13th-14th, Skopje, 🇲🇰
- SwiftCraft, May 19th-21st, Folkestone, 🇬🇧
- Macoun, September 27th-28th, Frankfurt, 🇩🇪
- Do iOS, November 11th-13th, Amsterdam, 🇳🇱
Just announced their dates
- PragmaConf, October 310th-31st, Bologna, 🇮🇹
- SwiftConnection, October 6th-7th, Paris, 🇫🇷
- SwiftLeeds, October 7th-8th Leeds, 🇬🇧
No dates announced yet
- NSSpain, Spain 🇪🇸
- One More Thing, Cupertino, 🇺🇸
- ServerSide.swift, London 🇬🇧
- SwiftConf, Cologne, 🇩🇪
If you run a conference that's not on this list, but should be - reply to this email to let me know!
One more thing...

Playing with time
This recently popped up in my Threads stream. It's mind-boggling to watch - enjoy!
In this episode, I've included a bunch of articles about PDFs and other files, and you might be wondering what's the reason for this.
If you've been following along my livestream series Building a Second Brain app, you might recall that I mentioned at various points throughout the series that I am planning to support adding all kinds of knowledge to our second brain app. And that obviously includes PDF files.
So now that Genkit has officially launched and is ready for production, I started looking more deeply into how to work with PDF files and how to interact with them. The result is a bunch of little demos that show how easy it is to parse PDF files using LLMs, and how little code it takes to extract structured data or how to implement text-based text adventures based on the contents of a PDF. I had a lot of fun building these, I hope you enjoy watching the videos I created and the posts and blogs I wrote about this.
In other news, I've updated the list of Swift conferences, as some conferences just recently announced their dates. I also got confirmation from two conferences that I will be speaking at, and I hope to see many of you at iOSKonf25 and SwiftHeroes 2025!
Peter