iOS ScrollView – make it snappy!

In iOS17, Swift UI has some new modifiers which make it easier to implement snap behaviour in scrollviews. ScrollView Let’s make a simple scrollview: Reminder: Using LazyHStack instead of HStack means the tiles are only loaded when needed and not upfront. This gives us a simple horizontal scrollview: The default behaviour is free scrolling, and … Continue reading “iOS ScrollView – make it snappy!”

iOS Simulator Screen Recording

Recording a video of the simulator used to be a bit clunky – either using the command line via simctl or other software such as Quicktime. Thankfully it’s now much easier! Screen Recording in Xcode Above the simulator is a toolbar which includes a button to take a screenshot: In the File menu there is … Continue reading “iOS Simulator Screen Recording”

How to make a Command Line tool in Xcode

MacOS command line tools can be handy for automating tasks and they’re also a great way to have more fun with Swift, so here’s how to set one up: Creating the project  1. Create a new Xcode project, select MacOS and command line 2. Give your app a name, and make sure Swift is selected … Continue reading “How to make a Command Line tool in Xcode”

Understanding Map functions in Swift

In Swift we have map, flatMap and now compactMap. What do each of these functions do and how can we use them? Let’s have a look at map… Part 1:  Map The map function takes a collection (often an array) and a function, and returns an array of items from the collection with the function applied … Continue reading “Understanding Map functions in Swift”

7 things I’ve learned so far as a junior developer

It’s been 2 years since I started to learn to code and just over a year since I became a developer, so it seems like a good time to reflect on what I’ve learned… 1. You don’t need to know everything When I was first learning to code I felt like real developers knew everything … Continue reading “7 things I’ve learned so far as a junior developer”

Dynamically adding css to WebViews in Swift

Photo of colouring pencils by Jess Watters on Unsplash

This week, I needed to figure out how to dynamically add css to a webView in iOS and it was much easier than I thought it would be. All you need to do is make use of the webViewdidFinish function in the WKNavigationDelegate and evaluateJavaScript View the code on Gist. This code will change the … Continue reading “Dynamically adding css to WebViews in Swift”