Phrases like “Xcode Beta 1X.Y.Z is out now” or “Did you try the new features of the latest Xcode update yet?” fill an iOS/macOS developer with joy. A new IDE update can be something similar to, e.g. a new knife for a chef, or a kid receiving the toy it always wanted.

But then, the devastating moment, destroying all happiness at once:

“Xcode.xip can’t be expanded because the current volume doesn’t have enough free space.”

The initial reaction: “Huh. Wait a minute? I do have enough space, don’t I?”. …

Styling a view is the most important part of building beautiful user interfaces. When it comes to the actual code syntax, we want reusable, customizable and clean solutions in our code.

This article will show you these 3 ways of styling a SwiftUI.View:

  1. Initializer-based configuration
  2. Method chaining using return-self
  3. Styles in the Environment

As a general rule of thumb, any approach is viable. In the end, it comes down to your general code-style guidelines and personal preferences.

The property wrapper you will find in chapter 3 “Styles in Environment”

1. Initializer-based configuration

This is one is straight forward and can be visualized with an example rather quickly:

This view takes two parameters backgroundColor and…

When your iOS app uses Markdown documents, why can’t we just transform them into natives view? What if instead of writing Swift UI code, we build a custom viewer app, which can even be run from Xcode Live Preview Canvas?

Just look at what you can do with it:

Demo showing live Markdown to SwiftUI teasing this article

In this story we are going to cover the following topics:

  1. Parsing Markdown into an AST
  2. The Resolver/Strategy Pattern
  3. Building an UI from resolved nodes
  4. Conclusion

In case you want to see the full library, checkout the GitHub repository CoolDown, our own Markdown parser @, …

A good developer should write great code with high maintainability and extensibility. Even better developers extend the programming language with smart functionality that makes it easier to read and write clean code.

Let me show you 5 code extensions for Swift, which I use on a daily basis. Every single one is explained in detail and recreated from its backstory/original intent.

In case you TL;DR and only want to see the code, scroll to each The Smart Solutions headline for the copy-paste ready code, or checkout the link in the conclusion.

Photo by Norbert Levajsics on Unsplash

1. Safe Array access with custom subscripts

Every developer has at least once experienced an “out-of-bounds”

Before the release and hype of SwiftUI we had to use plain UIKit for iOS and AppKit for the macOS interfaces… even if the core application was exactly the same.
Naturally your cross-platform applications keep growing over time, and eventually you get to the point of refactoring the code into modules.

This tutorial shows you, how to harness the impressive power of the Swift Package Manager (SPM) to create a clean, extensible and especially shared UI structure for your large-scale apps.

Combining Swift files with XIB interface builder files into packages

Note: This is a follow-up tutorial to Modularize Xcode Project using local Swift Packages and builds up on the…

Defining HTTP APIs in Swift is still not perfect (yet?). Most iOS and macOS apps are using them to communicate with remote data endpoints. And it used to be a hassle with writing and validating requests, sending them, parsing responses, depending on different edge cases etc… and you might think that nowadays, many frameworks exist to solve this complexity…

…but with Postie you can elevate your capabilities even more!

The Next-Level Swift HTTP API Package

Existing solutions are heavy-weight

So what’s the problem with our current state-of-the-art?

The most popular Swift networking framework available, with its 36.000+ stars on GitHub, is Alamofire. …

To start off this story, you will see a very basic code example which includes a few issues. Together we will improve the code snippet and eventually create a sophisticated solution.

Even tough this story uses SwiftUI in this story, it is not the main scope, and only used for simpler code snippets. The concepts apply to any kind of Swift projects available, including UIKit/AppKit interfaces or even command line tools.

Issues hidden in plain sight.

Take a look at the following example of a view showing a call-to-action message and the action button:

If you use this code snippet in a SwiftUI app…

You know Markdown, right? That text format which uses funky characters like # , ** or > to create well formatted documents? Awesome! Many platforms use it on a daily basis, so you will eventually use it too.

Now, what if you need a markdown parser for your Swift application? Well, we could just use one of the well-tested ones (which can be found using your favorite search engine on GitHub), but instead… you can also create your own version.

Drake might also prefer writing his own solution

All jokes aside: if possible, do not reinvent the wheel. If an existing framework with an active maintainer fits your…

Swift Package ManagerSPM…It is everywhere, many use it and it is most likely the future of working with Swift dependencies. A single file to fetch all the sweet Open Source packages. And with higher acceptance of the community, even more packages will get available without installing any more tools, such as Cocoapods or Carthage.

But how can we leverage this dependency structure even further? Is external code the only reason for using a package manager?

Our code bases are growing with every single new file. First we create a folder structure to organize our .swift files, but then even…

Vienna is a beautiful city with high living standards and a modern mindset. It’s time to not only enjoy its diversity, but to actively explore the potential of becoming the next great startup city.

The following story will start off less technical, and instead more historical/personal. Skip to “My first time with GatsbyJS” if you only want to hear about the implementation 😊

two strong arms representing GatsbyJS and Airtable, together they symbolize “too easy to bother building it myself” as they simplify a lot of the development process
Combining GatsbyJS & Airtable makes it easy to build an web app

Almost 4 years ago, in 2017, I moved from a small city to Austria’s Capitol, Vienna, to study Software Engineering at Vienna University of Technology (TU Wien). As I have mostly been self-taught in the 4 years…

Philip Niedertscheider

Changing the status quo of iOS & macOS development | Self-Taught | Co-Founder/CTO @techprimate | Follow me on Twitter @philprimes for updates 🚀

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store