Fresh Beginning

Things I know and love to write about

  • Home
  • Speaking
  • Reading
  • Github
  • Alma Mater
  • Contact
Algorithm, Interview Questions, Google, Google interview questions, Graph problem

[Algorithm Question] Finding the origin of a Computer Virus from the given list of machine pairs

Recently, I worked on the algorithm problem that required to find the origin of computer virus given the list of infected machine pairs. In general you're given the input in the form of

  • Jayesh Kawli
2 min read
NSNotifications, Notification Center, Advanced Swift, Interview

Implementing custom NotificationCenter in Swift

NSNotificationCenter is a classic API on iOS. It's used so that classes can register for notifications by name and execute the function/block whenever the notification with same name is fired somewhere else

  • Jayesh Kawli
4 min read
Xcode 12 Beta, Xcode 12, Lists in UICollectionView, UICollectionView

Value of type UICollectionViewListCell has no member leadingSwipeActionsConfiguration / trailingSwipeActionsConfiguration

Apple introduced new APIs to add leading and trailing swipe configuration in Xcode 12 Beta. They were introduced in Lists in UICollectionView video at 11:38 mark. However, needless to say, they're no

  • Jayesh Kawli
1 min read
Potato, French Fries, Home made, Ketchup

Making a Homemade French-fries

Being in a lockdown for more than 6 months is stressful. However, it doesn't have to be like that all the time. Couple of weeks back I was feeling rather low-energy and depressed.

  • Jayesh Kawli
6 min read
Xcode 12, UICollectionView, UICollectionViewListCell, Lists, Lists in UICollectionView, iOS14, Xcode 12 Beta, UITableView

TableView via CollectionView on iOS - Lists in UICollectionView

🛑 Read Before ProceedingPlease make sure that you are using Xcode 12 (Beta or stable release) and above supporting iOS 14 and later versions. Most of the APIs mentioned in this post were announced

  • Jayesh Kawli
11 min read
iOS, Objective-C, Swift, Programmatic layout, Xcode 10, Xcode 11

iOS - Creating Programmatic Layout without using Storyboard (Swift/Objective-C)

There are two ways of creating layout on iOS. First, using readymade storyboard provided by Xcode when you create a new project. And second, by manually creating a UIViewController subclass and assigning it

  • Jayesh Kawli
3 min read
ComponentKit, Objective-C++, Facebook, iOS Architectures, Performance, React on iOS

Creating a Facebook Timeline using ComponentKit

In the past few days I have taken a special interest in learning ComponentKit framework. From the official GitHub page, it's a React-inspired view framework built for the iOS. ComponentKit is written in

  • Jayesh Kawli
5 min read
hooks, React, React.js, codesandbox.io, JavaScript

Playing with React Hooks - Async operation with Loading state

Recently I started learning React.js. While the framework has so many fascinating features, the particular one I liked is Hooks. Although hooks is relatively new feature and isn't widely used yet, I

  • Jayesh Kawli
4 min read
quick-select, quick select, Find kth Max, Find kth Min, kth smallest, kth largest

Implementing Quick Select Algorithm - Finding kth largest/smallest element

Today I am going to write about a special type of algorithm for finding a kth largest or smallest element in the array. This is my favorite data structure question due to intricacy

  • Jayesh Kawli
4 min read
Indian Food, Staple food, Snack, Methi, Fenugreek leaves, Fenugreek, Bitter, Deep fry, shallow fry

Making a Methi Vadi (A snack made of Fenugreek Leaves)

When I was a kid, Methi vadi was one of my favorite snacks. Although I liked it, I never learned how to make it from my mom. As I grew up and started

  • Jayesh Kawli
4 min read
tic-tac-toe, Algorithm, Game, tie, winning combination, fit-fat-foe, fit fat foe, tic tac toe

Algorithm to Detect A tic tac toe Winner

Recently I was asked to work on the game of tic tac toe on iOS. Creating a game layout and rest of the business logic is straightforward, until it comes to detecting whether

  • Jayesh Kawli
7 min read
image downloader, reusable cells, UITableViewCell, UICollectionViewCell, documentation, README

Using ImageDownloader library with reusable cells

This is the second part of original post where I wrote about how I built an image downloader and caching library for images. (webp and gif excluding). However, there is one thing which

  • Jayesh Kawli
4 min read
Swift 4.0, image downloader, downloading, Caching, thread-safe

Architecting Asynchronous Image Download and Caching in Swift

Few months ago, I worked on a side-project that involved writing image downloader and cacher from scratch without using a third-party library. Today, in this blog post I am going to summarize how

  • Jayesh Kawli
7 min read
Coronavirus, Mask, Public, Health, Safety, Prevention

Making a Coronavirus Prevention Mask - A new side project

With the spread of Coronavirus, everyone is rushing to buy masks. I too unsuccessfully tried to buy masks online, but couldn't get one due to high demand. Whenever Amazon showed me the availability

  • Jayesh Kawli
6 min read
iOS, Swift, Xcode 10.1, Xcode, Drag and Drop, DragDrop, Postmates, Interview Questions, Interview

Drag and Drop on iOS using Swift

Hello folks, it's been a while since I wrote my last article. Today we're going to learn how to implement drag and drop feature on iOS using Swift. To see in advance what

  • Jayesh Kawli
5 min read
UICollectionView, UICollectionViewCell, Tutorial, Swift, Advanced Swift

Tutorial - Creating Programmatic UICollectionView in Swift

Creating a UICollectionView could be stressful - As compared to dealing with UITableView. But things don't have to be this way for so long. Every time I have to add a CollectionView in

  • Jayesh Kawli
6 min read
memory semantics, Swift 4.2, classes, value and reference types, value types, Reference types, person, car

Swift Value and Reference type semantics - Structs, Classes, Struct inside Class, Class inside Struct

Long ago Swift introduced a nice concept differentiating between value and reference semantic using Struct and Classes. As we all know, Struct is a value semantic, which means when value of one struct

  • Jayesh Kawli
9 min read
Codable, Custom Decoding, NumberFormatter, CurrencyFormatter

Codable - Applying Data Transformations

Codable may not just all be blindly transforming JSON data into model objects, but you can also apply formatting to it. Examples of formatters include, but not limited to date formatters, URLs, and

  • Jayesh Kawli
5 min read
Codable, Decodable, Swift 4.1, decoding strategy, Custom decoding strategy

Codable - Dealing with built-in and custom `keyDecodingStrategy`

Apple introduced a keyDecodingStrategy parameter as a part of Swift 4.1 release. Although it's been out for a while, it's a huge change. We have many instances where server and mobile apps

  • Jayesh Kawli
5 min read
Swift, iOS, Codable, Swift 4.0, Encodable, Decodable, Swift 4.1

Using Codable Protocol in Swift 4.1

Swift 4 Codable protocol to decode and encode json data and model objects. Explained with examples.

  • Jayesh Kawli
10 min read
Git, Diff, Patch, stash

How to apply Git Diff and deal with Patch Failed error

Git diff is a powerful command which allows you to see you recently made changes whether they are staged or not. There are however circumstances when you want to stash your diff on

  • Jayesh Kawli
3 min read
Composite Layout, Compositional Layout, UICollectionView, iOS 13, App Store

iOS 13 - Building App Store Layout using UICollectionView Composite Layout on iPad

As I mentioned in in earlier posts, recently I have been playing with new UICollectionView APIs introduced at WWDC 2019. 2 Weeks ago, I started my ambitious project to re-create an App Store

  • Jayesh Kawli
8 min read
UICollectionView, iOS 13, Mobile, Compositional Layout, Layout, Section, Group, Advanced, Multi-dimensional

New Collection View APIs in iOS 13 - UICollectionView Compositional Layout

This blog post is based on the Session 215 - Advances in Collection View Layout from WWDC 2019. I would highly recommend to go through this video to learn basics about new collection

  • Jayesh Kawli
15 min read

Advanced Collection View Layout in iOS 13 - Supplementary Views

Today we're going to see the advances in Collection view layout as introduced in iOS 13. This post is based on WWDC 2019 Session 215 - Advances in Collection View Layout. Many examples

  • Jayesh Kawli
8 min read
Test plans, Xcode 11, UI Testing, Localization, Language, Spanish, French

Testing in Xcode 11 - Utilizing Test Plans

Today I am going to write about new testing improvements that Apple introduced as a part of Xcode 11 Beta 3 release. As a reference, this post is based off of this sessionApple

  • Jayesh Kawli
6 min read
Fresh Beginning © 2021
Latest Posts Ghost