Grand Central Dispatch in Swift
Computers can’t live without multithreading and concurrency. You know why? CPUs are kinda dumb – they can only do one thing at a time! You can use Grand Central Dispatch...
Types of Databases
Types of Databases When it comes to designing a database for your app, you can choose from 3 types of databases: A relational database is structured to support relationships between...
How To Find Strings with Regular Expressions in Swift
"I made this wonderful pic last #christmas... #instagram #nofilter #snow #fun" How are we going to get those hashtags out? You do the same thing in code by using a...
How to create a page scroll using UIPageViewController
Today we are going to learn how to create a page scroll using UIPageViewController. import UIKit class PageViewController: UIViewController, UIPageViewControllerDataSource, UIPageViewControllerDelegate { lazy var pageController: UIPageViewController = { let pageController...
Autoresizing UITextView Like in Messaging Apps
Today we are going to learn how we can resize our UITextView so it fits its content and after it takes a big chunk of text it cannot longer become...
iOS Location Tracking
If you are building a location-based application from scratch, this short summary presents a few caveats for Location Tracking in iOS which might save you some time. Recently, here at...
Using CAShapeLayer and UIBezierPath to mask UIView holes
The trick is pretty straightforward — basically we need to get the path from our overlayView using UIBezierPath(rect: overlayView.bounds), then set fillRule from our CAShapeLayer to .evenOdd and then append...
Automatic API request retries
NetworkClient with Retries The following alternative service adds automatic retries to the NetworkClient service. class NetworkClient { static let shared = NetworkClient() private init() {} private let session = URLSession(configuration:...
Working with Timers in Swift
Timers are super handy in Swift, from creating repeating tasks to scheduling work with a delay. This tutorial explains how to create a timer in Swift. How To Create a...
Working with Dates in Swift
Date A specific point in time, independent of any calendar or time zone. The simplest way to get the current date is by: let date = Date() print(date) // prints...