Let say you have a product which contains bunch of variants and you want to show the starting price of each product in your app. Let say the product and variant model looks like this:
Next, create an extension for the product class and define a function like this:
You can call this function from the instance of your product. That’s it :)
Are you looking for a cheap virtual private server to publish your web applications? Try digital ocean. It is a cloud infrastructure provider with datacenters worldwide. You can deploy and scale your application as it grow. I am using digital ocean’s service for more than 2 years for my website and I found it be a great fit.
Digital ocean comes up with the flat pricing which is simple and yet predictable as low as $5/month. You can choose from the different packages as per your requirements. It’s like you get exactly what you pay for. More resources will cost more. …
Let’s say! you have large text and you would like your user to search through the text but in the search results you don’t want to show the full text. You want to show the prefix and suffix for the searched string with some limit. See the image below for illustration.
So, the first step is to find out the range for the user query in the targeted string for example,
text is the user query in the above illustration. Finding the range of substring is pretty simple in swift and it just requires one line of code.
let range = someString.range(of…
In this article we are going to explore simple technique to make synchronised splash animation. The end result will look like this:
Create a new `xcode` project with `single view app` template.
If you are using `xcode 11` then make sure to select `storyboard` instead of `SwiftUI` and name the project whatever you want.
In this tutorial we are going to draw a directed polyline (draw small direction arrow) by using Google Maps iOS SDK. The end result will look like the following screenshot.
I am assuming you have setup the google maps iOS SDK for your project. For the sake of simplicity for this tutorial i will be using hard coded geo json. GeoJSON is a format for encoding a variety of geographic data structures which may contains array of array which consists longitude and latitude. I repeat longitude and latitude.
The GeoJSON used in this tutorial can be found here.
Once upon a time there is an old man living in the city and he decided to migrate to some other place. While travelling, a jungle comes in his way. He was moving forward and crossing a lake through a wooden bridge. When he was in the middle, suddenly he saw a scorpion struggling for its life as it was sinking in the water. The old man move forward to save the Scorpion. While he was picking the Scorpion from water, Scorpion did a bite on his hand and it get dropped from his hand.
A man behind the old man was watching all the scene silently. After the third attempt the man asked the old man…
Are you a muslim? You are feeling lazy to offer prayer, you will start providing yourself a reason about why you are not offering prayer. Few of them are:
Reason 1: I will start offering prayer from tomorrow…
It’s a myth. Most probably you will be providing the same reason to yourself the next day.
Reason 2: I am tired now…
If you are tired and offering prayer surely Almighty Allah will give you more strength and reward.
Reason 3: My clothes are not clean and pure…
If you can change the clothes go get them changed and offer your prayer. If you are in a situation where you cannot change them and you know the unpure point of it then wash it and offer your prayer. Otherwise just take a roughly estimation of unpure point and wash them. …
Like many others I am also an iPhone user. One day I was just exploring my iPhone and unintentionally I go to the System Services under the Privacy settings. I was shocked to see that my iPhone was tracking my locations as I travel.
However, the way iOS present that location data is not interactive. For example, it shows the location circle with zoomed map and sometime you cannot identify where exactly you were.