Take a look at my old standbys

Laptop and coffee on table
Laptop and coffee on table

Whenever I start a new iOS Swift project, the first thing I do is import my Utilities and Extension files. They help me make my programming more efficient. Let’s have a look at my six favorite and most essential extensions.

1. Dropping Shadow Under UIView

When implementing modern designs, dropping a shadow under a UIView is often required. Instead of having to write multiple lines of code for each view, I use an extension:

Of course, every project might require some minor changes to the shadow style, but that can be changed in a central place.


If you love our publication, we would appreciate your support.

Image for post
Image for post

As Next Level Swift doesn’t earn any money from articles or posts, we are always looking for your support. There are three simple ways to help us grow and bring more Swift knowledge to Medium!

Join our free Newsletter

Yes, we know, yet another newsletter. Very creative by us. But we think our Newsletter is worth your while! Instead of spamming you with redundant and uninteresting content, we only send you a maximum of two letters per month. Firstly, we have our Monthly Highlights Letter, giving you our top 3 Next Level Swift articles of the month, including some further insights into the minds and people behind the piece. Secondly, we have our Feature Letter, where we pick three articles from people who are new to Next Level Swift, helping them getting their fantastic knowledge and thoughts read. If that sounds good, we would love to have you subscribe to our newsletter. …


Introduction to sharing data between different views and UIViewController instances

Image for post
Image for post

In my early days of developing on iOS, it took me a while to get my head around the different concepts for passing data between two UIViewControllers (or any other inheriting instances like TableView or CollectionViewController). But honestly, it is much simpler than it feels reading overly complicated StackOverflow posts. I will introduce to you three simple ways I use every day, to send data between two UIViewControllers.

1. Passing data through a programmatic segue

In my opinion, this is the most straightforward technique. Let’s first look at how we can move from our first ViewController A to controller B. Use these lines of code:

if let viewController = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(identifier: "BViewController") as? BViewController {
viewController.modalPresentationStyle = .fullScreen
self.present(viewController, animated: true, completion: nil)…


Quickstart to installing third-party libraries in any Xcode project

Image for post
Image for post

Even though Apple packs a lot of functionality into their native Kits (for example, UIKit, HomeKit, or WebKit), developers often require third-party libraries to get their apps running with the least amount of effort. This article will check out how to get our Xcode project running with Cocoapods and install a library.

Install Cocoapods

Before we can use it, we need to install Cocoapods. This can be done via the terminal using homebrew or gem. If you have homebrew installed, run:

brew install cocoapods

Otherwise use:

sudo gem install cocoapods

Initialize Cocoapods in Project

Next, we need to initialize our project. In a terminal, go to your project directory (the level where the .xcodeproj file is). …


Image for post
Image for post

Welcome!

We are always looking for talented and passionate writers and developers to get more content out to our community. If that’s you, let’s look into what kind of content we are regularly looking for:

  • Tutorials in Swift and iOS development. This can be about anything, from basic to advanced, SwiftUI, or Storyboard.
  • Best practices you learned over time and want to share
  • Code snippets that help you be more productive
  • Multiplatform approaches that make Swift integration into Android easier. This can be, for example, Flutter or Kotlin Multiplatform.

Styleguide

To improve the reading experience for everyone, we created a simple style guide. …


Automating your home is easier than you think

House with the lights on
House with the lights on

When Apple develops (or improves) something, it is usually presented as revolutionary and broadcast to everyone. While Samsung releases its new phones mostly under the radar, watching an Apple keynote live has become somewhat of a modern lifestyle and essential to keeping up with discussions in the office on the next day.

But there are two products that Apple has kept mostly under the radar: Home and Shortcuts.

A Quick Introduction to Home

Home was Apple’s attempt to unify the smart home app jungle. Every light bulb, smart smoke detector, doorbell, and heating control has its app. Turning on the heater and the lights took longer than it should. The problem Apple faced was that HomeKit required the app developers for each smart home appliance to create an interface. …


Image for post
Image for post

Let’s have a look at how to run a terminal command from your iPhone using Apple Shortcuts. First, we need Shortcuts installed and be working on automation. Let’s add the action: “Run script over SSH” and tap “Show More”.


Let’s make your iPhone and your home smarter

R2D2 toy
R2D2 toy
  1. Download Shortcuts from the App Store (if it is not yet installed).
  2. Open Shortcuts, tap on “Automation” at the bottom, and then the plus sign (+) at the top right.
  3. Click “Create Personal Automation.” This opens up a long list of possible triggers. Scroll down until you see “NFC” and select that.


Going further with Kotlin Multiplatform

Moving boxes.
Moving boxes.

Manually setting up a Kotlin Multiplatform Mobile (KMM) project from scratch can be tedious. We want to migrate our Xcode project called medium to a new KMM application.

Getting Started

For this example, we’ll use a blank KMM project with a twist. If you don’t know how to create a KMM project, check out my previous article first. The twist: In the creation process this time around, we’ll name the iOS application precisely the same as our Xcode project. Doing so removes the need to change the path and code-project variables in Gradle and property files.


In the past years, I moved from one of the world's biggest companies to a small startup. And the differences between the two working worlds are incredible! The entire attitude to work and getting work done is a complete 360. In most prominent companies, ducking when work comes flying is normal. Sitting at your desk for three hours without anything to do before going home is normal. And scheduling long and bloated meetings with as many people as are available is even desired and makes everyone involved feel important. This attitude is entirely different in smaller companies. You most likely enjoy your work and thus go looking for it. When you have nothing to do, which is unusual, you go home and don’t waste your time just sitting around. …

About

Mats Bauer

Mobile application developer and health enthusiast from Hamburg

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