How to add custom fonts to iOS App

Applications often use custom fonts to add a touch of personalization and use a font that better represents the character of the app. For eg: a game might use a more “playful” font - perhaps at the cost of legibility - while a news app might use a more “formal” - a more legible font.

There might be other factors that require you to use a custom font such as adhering corporate brand standards, maintaining consistency across platforms (Android, web, iOS, etc.)

In this post, we look at How to add a custom font to your Xcode project or iOS app?. We also give a few important factors that you should consider before using a custom font.

Steps to add custom fonts to an iOS project

  1. Review custom font files
  2. Add the custom font to your Xcode project
  3. Update the project info.plist
  4. Access the custom font
5 min read

How to install watchOS 7 on Apple Watch Series 3 or later

It’s September 2020 and Apple has released another exciting version of the watchOS. watchOS 7. As always, the new OS comes packed with a lot of exciting new features.

If you are ready to upgrade to watchOS 7, this guide will help you with the process.

If you are using Apple Watch Series 3, you might face an error during the install. “watchOS 7 requires more than 3.1 GB of free space ….”.

This post also shows how you can free up space on your Apple Watch Series 3 and install watchOS 7.

3 min read

Converting Dates to String using Swift

Dates are represented in Swift code using the Date structure.

The Date type makes it easy to work with dates. You can easily perform operations like persisting Date instances, comparing two Dates, checking if the given Date falls on a weekend, etc.

While the Date type is great for working with dates in code, they often need to be converted to their corresponding String representation before it is displayed to the user.

Converting types like Int, Float, etc to their string representation is easy; however, converting Date instances to their String representations is not a trivial task.

You have to account for the different date formats used in different geographic regions, handle localization, and consider the context in which the date is used.

Given how ubiquitous Date is and how often we have to manipulate them, it is wise to isolate Date handling code.

In this post, we look at how to convert date to string. In general, we look at how we can abstract away all the nuances of processing dates using the DateFormatter class.

We also see how to convert Date to String that appears more natural for eg: strings like Today, Yesterday, etc.

4 min read

Swift Interview Questions - Array - Updated 2020

The Array is probably the most widely used data structure in programming. The array is a versatile data structure that used to solve a large number of problems. It is easy to learn and work with an array however, most programmers don’t use all of Array’s features.

It is also important to understand how Swift array works under the hood to determine if an array is the best data structure for a given task. Knowledge of how the different array methods and properties are implemented also helps avoid common pitfalls.

Not surprisingly a lot of interview questions revolve around the array.

This post includes some of the most frequent interview questions.

5 min read

Background tasks Using launchd in mac

When we want to run a job at regular intervals for eg: Run a task every few seconds or minutes.

We can also instruct a mac to run a task on a particular day. We do this using a progarm named launchd. There are other way such as cron to acheive the same result. launchd is the preferred way to execute these long running tasks.