Category: Programming
Auto Layout in iOS
Using Auto Layout feature developers can align UI controls for different devices, screen sizes and orientation. This reduces the code to be maintained and makes life easy for the developers. Auto Layout solves UI design issues by creating relationship between the UI elements. This follows constraint based layout system where you can define contraints for…
Type Casting in Swift
In Swift, we have a tool called “type casting” to help us solve this problem. Let’s see how it works! What is Type Casting? Type casting is a way to check the type of an instance or to treat that instance as a different type. It’s like asking, “What are you?” or saying, “I’m going…
Higher-Order Functions in Swift
Higher Order function are powerful tools can help you transform, filter, and combine data with ease. What are Higher-Order Functions? Higher order functions can take other functions as input or return functions as output. In Swift, we often use them with closures to work with collections like arrays. Let’s start with a sample dataset to…
Closures, Extensions and Generics in Swift
Closures Closures are self contained lines of code that can be passed around the application and similar to blocks in Objective-C. A typical closure syntax in Swift looks as shown below Closure Syntax { (parameters) -> return type in statements } Example closure in Swift var greetings = { (name:String, message:String) -> (String) in message…
Class and Struct in Swift
Download the playground file from github (Classes and Struct) Class A class is a blue print for a real-word entity such Player, Person etc. and it is used for creating objects. Class can have properties to store values and methods to add behaviour. Let us see this with an example class called Rectangle which has…
Understanding Closures in Swift
Closures are little blocks of code can make your Swift programming more efficient and elegant. Let’s dive in and explore what closures are and how to use them. What Are Closures? Think of closures as self-contained chunks of code that you can pass around and use in your Swift programs. They’re like mini-functions that you…
Tab Bar Controller with WebView
In this article, we will see step by step instruction on working of Tab Bar Controller, UIWebView and Activity Indicator by loading couple of web pages using UIWebView in two different Tabs. Tab Bar Controller Tab Bar Controller is used for organising list of View Controllers by having separate tabs for each View Controller. Check…