How to write a do while loop in swift ?
We can use repeat-while which is equivalent to do-while loop in swift. Here the single passthrough will happens first after that condition will be verified
The list of swift articles. Swift is essential language to develop iOS Applications. I have created tutorial which is easy to understand. So Let’s Dive :)
We can use repeat-while which is equivalent to do-while loop in swift. Here the single passthrough will happens first after that condition will be verified
If you have two diffrent string and want to have diffrent text style like colours, font then you can use NSAttributedString which can customise. In below example i have joined two string with diffrent fonts, colours into same label.
We often required to calculate how much time xcode required for execute certain chunk of code. Fortunately there is a workaround which might be used is `CFAbsoluteTimeGetCurrent()`Here i have used Big O(n^2) Time complexity you can change values & test it over xcode.
typealias also known as type-Identifier. so basically we are defining a substitute of a type. For example we can give type of String to Str as – typealias Str = String so now onwards you can use Str instead of String 1. Basic Example with data type You might thinking what’s the big thing in …
Documentation helps developers & peers to get through the code explanation, we often use ⌥ Option + click to find inbuilt apple documentation or we can just jump towards inspector area & click on any method it will appear the markup description on right panel So Let’s start writing in our code example — Summary …
In Swift we can use pow(::) for making power of any number. For Example if we need 2 power 3 – Further you can also typeCaste to Int as let output = Int(pow(a,b))// prints 8Remember to add import Foundation for get rid of compile time error.
In general we use UIScrollView, UITableView or UICollectionView & sometimes we have to scroll programmatically to Top or bottom, so we can achieve it by using setContentOffset where we set where exactly to scroll Below are 4 helper methods which help in scrolling the Scroll view UIScrollView scroll to bottom UIScrollView scroll to Top UIScrollView …
How To Scroll To A Position Programmatically In UIScrollView Read More »
To populate a list of items in the iPhone you can use UITableView which provides vertical scrolling over the items. In this article we will UITableView in iOS with storyboard and add some items to it. Let’s Code Step 1: Create New Xcode Project & jump towards Main.StoryBoard Step 2: Click on + icon(Object Library) …
In this tutorial you will learn about how to fetch data from server or make HTTP Network request using inbuilt Apple’s URLSession, We will use a singleton shared method. You may have a different type of HTTP method like GET POST PUT DELETE. We can use all of them to fetch/update data from Server Let’s …
Drag UIScrollView to storyboard Add leading, trailing, top, bottom of UIScrollView Add UIView Inside UIScrollView & Rename it to scrollContainerView Add leading, trailing, top, bottom of UIScrollView with parent UIScrollView Add Equal Width content of scrollContainerView with respect to UIScrollVIew Add objects to the scrollContainerView – i have added two button make sure leading trailing …