Debouncing a method call ensures that the method is not executed too frequently.
For example: if you see a basic implementation of a search view in any application it does not make an HTTP call to the back end for every character you type. This would result in many HTTP calls and most of them would be unnecessary.
Instead, we use something called a
Debouncer, which calls a particular method only after a given interval of time. For the search example, if we have a time limit of 0.3 seconds then the HTTP call to get the search results will…
Tinder introduced a wonderful pattern for viewing and sorting data. It doesn’t have to be eligible people to date; it can be anything. Let’s take a look at six useful iOS libraries to bring swipeable, sortable cards into your app.
You must have always wondered how to create different figures & shapes in iOS. Creating a rectangle and circle is easy, every view is itself a rectangle and if you ever want to create a circle you can use
cornerRadius property. But what about complex shapes? How can we create a triangle which has a weird shape inside it? It is all possible
We will start by learning how to create simple figures using
CAShapeLayer , and move on to creating masks and complex figures using the same two things.
Every view in iOS has a
We start with
folding-cell , a customised cell subclass for
UITableViewCell. It provides an awesome folding/unfolding animation of a cell to display/hide its content.
This library is compatible with iOS 8+ and Xcode 10.2+
We will first start by creating a file
ThermometerView which will be a subclass of
UIView . All our code related to building and animating a thermometer will go in this file. This will be a reusable view which can be used in any iOS application.
Let’s create the bottom round shape of the thermometer.
Output will look like this:
WebSockets allows the setup of a very fast two-way secure network connection between different parties. This is different from the HTTP protocol and used only when we need real-time updates. For example, all of the chat apps you use are built using WebSockets. Stock market updates are shown using the same protocol.
We can simply connect to a
WebSocket channel using an URL and can listen to all the updates coming from that channel. For example, if we connect to the stock channel of some particular entity, we’ll receive timely updates about the price of that stock. …
Bubble sort is the most basic and simplest sorting algorithm used to sort small datasets. This algorithm is not very efficient with a time complexity of O(n2). Although it is space-efficient as it an
in place sorting algorithm which basically means it does not need any extra space to sort all the elements of a collection.
n — 1passes to…
Tree is a hierarchical data structure unlike stack and queue which are linear in nature. Trees are used to represent and hold data which have hierarchy in their nature, for example we can represent a family tree via
Tree data structure. They can also be used to perform efficient searches on a huge dataset. You can think of it as a real-world tree which is upside down, root at the top and branches growing downwards. Let’s learn about different terminologies that are used to represent different parts of a tree.
Tree is a combination of nodes. Each entity is represented…
Queue is a linear data structure which follows a particular order in terms of which operations are performed (FIFO — First in first out). It is named as queue because it behaves like any real world queue that you may encounter. For example a queue of humans waiting outside a store. If you consider that queue humans can enter a queue at the end and anyone can leave the queue from the front.
We will use an array for internal storage of the Queue as it gives us easy methods for adding & removing elements.
Enqueuing means to add an…
iOS Lead @Cityflo_India