iOS 15: Understanding Apps behaviour

Photo by @danny144 on Unsplash

WWDC 21 unveiled App privacy report that will enable users to understand what’s going on with their everyday applications under the hood.

The report will reveal instances when an app accesses user data and sensors (like photos, location, contacts etc.) and also list out all the domains that your app contacts.

The report will be in Privacy settings and can be enabled to better understand underlying behaviour of all the installed apps.

Important to note that this report will not record ephemeral WebKit sessions by web browsers, eg: Privacy browsing or incognito modes.

How to correctly model data in Swift

Use cases and Implementation

Photo by @emmamatthews on Unsplash

In this article, we’re going to learn about enumerations in Swift or as they’re more commonly known, enums.

An enumeration defines a common type for a group of related values and enables you to work with those values in a type-safe way within your code — swift.org

Enumerations are used to model a finite dataset and found commonly in different programming languages. In Swift its history can be traced back to C language but enumerations in Swift are a lot more flexible.

Why Enumerations: the problem

Swift offers multiple ways to model data to be used in a program. We can use object and…

A brief introduction to modern-day databases

Photo by Franki Chamaki on Unsplash

More than seven of the world’s top 10 retailers use Graph databases. Top retailers like eBay and Walmart rely on Graph databases to drive recommendations, promotions, and streamline logistics.

Eight of the top 10 insurance companies, top insurers like die Bayerische, Optum Healthcare, and Allianz, rely on Graph databases to fight fraud and manage information.

Even companies like Facebook and Google have been building their businesses upon some form of Graph database for decades.

Graph databases are powering numerous businesses around the globe and in this article, we will discuss modern-day Graph databases and what led to the evolution of…

From source to destination

Use a self-trained Core ML model for image classification

Photo by Jacob Schwartz on Unsplash

In a previous article — Build iOS-ready machine learning models using Create ML—we learned how to create and train our own Core ML model using Xcode.

Then, we learned how to fine-tune these custom models to provide accurate results. For that, check out the following tutorial: Create ML — Increasing ML model accuracy.

In this tutorial, we’ll use the model that we created in the previous two tutorials and create an application that will use image classification to classify the food items according to 20 classes that were used for training the data.

The ML model that we have created…


Apple’s new state driven declarative UI Framework

Apple rocked the iOS world with WWDC 2019 when it announced its new state-driven, declarative UI framework. It is a change for the better and in this article we will introduce the framework and touch up on some of its new component primitives.

Before we get started, many of you might be under the dilemma whether to start learning SwiftUI or broaden UIKit’s knowledge. The answer to that question is simple since many current apps still need to support OS versions below iOS13, it is advised to continue growing your horizons on both the fronts.

iOS13 is the minimum deployment…

Creating efficient models

Solving overfitting

Photo by Pablò on Unsplash

In my previous tutorial—Build iOS-ready machine learning models using Create ML—we discussed how to use our own data and categories to train custom ML models ready for iOS. We used our training dataset (link) to achieve training and validation accuracy of 91% and 89%, respectively.

In this article, we’ll discuss how to increase these accuracy values, how to validate the model using a validation set, and examine overfitting and find a solution to this common machine learning problem.

Validating the model

Since we used only one dataset—i.e. the training dataset—to train the model, Create ML didn’t use all the images in the set…

Understanding the basic building blocks in Swift

Anatomy of the Sequence protocol

Photo by vision webagency on Unsplash

A sequence is a list of values that you can step through one at a time.

Swift sequences are one of the most fundamental concepts present in the language and we can use it to create custom collection types. The biggest advantage of using sequences as foundation blocks for custom collection types is that we get direct access to highly optimised versions of a bunch of algorithms right out of the box. Since Sequences forms a core foundation block while creating custom collection types, it becomes really important to know Sequences in detail.

In this article we will dive deeper…

How to make protocols generic and the advantages of doing so

Daria Nepriakhina- Unsplash

While discussing generics in Swift, we learned how to make structs, enums, and classes generic.

We discovered how to pass in abstracted type information at the compile time, leaving it up to the compiler to carry that information from compile time to run time. We used protocols to declare the capability of those types.

But what about protocols? How do we make protocols generic and what are the advantages of doing so?

In this article, we will discuss generic protocols or associated types.

Defining a Generic Protocol

Protocols might come across to you as something that is already generic as any type can conform…

Provide intelligence to mobile apps

Use your own data and categories

Photo by Brooke Lark on Unsplash

Most of the time, when we start working with machine learning, we tend to use models that are readily available online so that we don’t have to spend time and effort creating and training them on our own. But this comes at a cost, as these models don’t usually fit our requirements exactly as expected. Fortunately, Apple has provided Create ML to address those issues, and in this article we’ll learn how to use our own data and categories to train our models.

Intro to Create ML

We can use Create ML to train models to perform tasks like recognizing images, extracting meaning from…

Image source- @travelwithlace

Write reusable code with

Create efficient and reusable abstractions

Generics are a key feature in Swift, which combined with protocols gives performance, flexibility, and concise, comprehensible compile errors if we make a mistake while using them in code.

In this article we will discuss the generics system, use of protocols in generics constraints, @inlinable and more.

We have all worked with simple array examples like the following code a number of times:

var names = [“Eli”, “Adam”, “Simon”]

The code above is exact equivalent of using a variable with explicit type annotation as follows:

var names : [String] = [“Eli”, “Adam”, “Simon”]

and this…

Navdeep Singh

Author of Reactive programming with Swift, Senior Software Engineer — Exploring possibilities with new Tech.

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