KB Tag: swift

  • How to exhibit UIPickerView in UIAlertController

    When you desire to describes the picker view in UIAlertController in the center of the screen or you need to show bottom action sheet. It will explain better view in iOS to implement picker view in UIAlertController rather than creating in UIView it also saves your many code to write and complexity too. An example okay…

  • How to check internet availability using swift

    Internet Availability For every application, it is mandatory to ensure internet connection is available or not. So you can confirm the internet availability by using SCNetworkReachabilityAPI of  SystemConfiguration Framework which is by default offered in iOS, You do not have to utilize any third party library for that. Follow these steps to ensure internet availability:- build a new…

  • How to use PayTabs payment gateway in iOS application?

    Hi everyone, here we will discuss how to use the PayTabs payment gateway in the iOS application. You can study their integration guide from the below-mentioned link:  https://www.paytabs.com/PayTabs_iOS_SDK_V2.0.pdf Before entering into code first we want to know what a payment gateway is, Get build your most engaging mobile experiences with best-in-class iOS application development!!! A payment…

  • How to Download Files Using URLSessionDownloadTask?

    Here, we are going to discuss how to download large files and save partial data even when the app is terminated and also updating the view when it is in the background. Get your tech solution built by top industry experts!!! Download Files Using URLSessionDownloadTask Creating an object of URLSessionDownloadTask Create an object of URLSessionDownloadTask…

  • Dictionaries in Swift

    You may know that in Swift arrays to read out a value, you can call it’s index value similar to: var someArray = [“Farhan”, “Syed”, “March”, “19”, “1996”] someArray[0] Instead of remembering the index value that is assigned to each value we can re-write this with a dictionary. By dictionaries, instead of arbitrary numbers you have read…

  • Conditional Statements in Swift

    When you desire your code to perform only if a certain condition is true then you can use an if statement. You can execute a if like so: var brand = “Apple” if brand == “Apple” { print(“Brand is Apple”) } An  if statement is begin with if followed by the condition then a block, open and close braces. Let’s include a else after the if:…

  • String interpolation in swift

    String interpolation is just several imagine term for combining variables and constants within a string. For example a string like so: var brand = “Apple” Now we might simply print this out by executing: print(“My favorite brand is \(brand)”) We might also utilize this way: print(“My favorite brand is ” + brand) But this technique…

  • Switch Cases in Swift

    You’ve mainly likely heard of an if statement, consider of switch cases to be the more advanced form of a if. To begin a switch statement you inform Swift what variable you want to run things by, and then give the list of possible cases. Swift will get the case that matches your code first and then perform it then exit the switch. Here’s a simple example: let someNumber =…

  • How to create funtion in Swift

    In this blog, I’ll explain you how to create simple functions in Swift along with a little more complex functions that take parameters and can return a value. An easy method to obtain some practice would be to open and follow beside. Let’s begin with a simple function: func someFunctionName () { print(“Hello World!”) }…

  • How to use UIImageView & UIScrollView to swipe through images – Swift iOS

    In this tutorial, we will show you How to use UIImageView & UIScrollView to swipe through images are followed: Start building your iOS apps in Swift with well-equipped solution UIImageView & UIScrollView to swipe through images Step 1: Create a new project Earlier you have your project set up, delete your storyboard. Step 2: Set ViewController.swift as the…

  • How to fetch JSON using NSURLSession

    In this tutorial I will discuss about iOS application that fetches some JSON from a web API While building this application we will be following: Functions Arrays Dictionaries NSURLSession Open Xcode Let’s open Xcode and build a single view application. Go to ViewController.swift. Your default ViewController.swift should appear like this: import UIKit class ViewController: UIViewController { override func viewDidLoad()…

  • How fetching Remote Data with core data in iOS app works?

    Learn how to fetch remote data with core data in the iOS app and like how it works in this case. Core Data is an object graph & persistence framework offered by Apple for developing iOS Apps. It holds object life cycle, object graph management, and persistence. It sustains various features for handling the model…