Category Archives: Apple

Simple Alert with two buttons in iOS Swift with callback

By | October 27, 2017

Dear Friends, Today I will show you how to create a simple alert with two buttons and how to write a callback for each button. The code is simple. Its written for Swift 3. Send your comments to coderzheaven@gmail.com

Class has not initialiser error in Swift – Solved.

By | August 16, 2017

Apart from other languages, when you write a class in Swift, It should have a initialiser. To solve this we have to write init() function in that particular class. Just like below. For example, look at the below class. Here we have 5 variables. The above error usually comes when you don’t initialize all variables… Read More »

Custom TimerView in iOS – Swift

By | March 16, 2017

Hello everyone, Here in this tutorial I will show you how you can create a Custom View for Timer without any layout in Swift. Custom Timer Class Our Custom timer class will look like this Here I am passing the superview in which timerview is going to be placed as the parameter. Then I am… Read More »

Core Image Tutorial in Swift

By | February 18, 2017

It allows developers to filter images in their apps. Advantages Core Image supplies 90+ filters. Powerful image filtering capabilities Core Image includes APIs for face detection Automatic image enhancements Custom effects through “chained” filters. You can get all kinds of effects, such as modifying the vibrance, hue, or exposure. It uses either the CPU or… Read More »

How to record Audio using AudioRecorder in iOS Swift

By | February 12, 2017

Well, its really easy for recording audio in an iOS application. We will decalre two variables in our View Controller Request Permisson from the User Start Recording Set Delegate Finish Recording Note : Sometimes iOS Stops the recording when a phone call comes. In that case we need to handle this. Since the delegate is… Read More »

Error Handling in Swift

By | October 1, 2016

When calling a method that may cause a failure, you normally pass it with an NSError object (as a pointer). If there is an error, the object will be set with the corresponding error. You then check if the error object is nil or not and respond to the error accordingly. That’s how you handle… Read More »

Create PDF in iOS

By | January 16, 2017

The UIKit framework provides a set of functions for generating PDF content using native drawing code. These functions let you create a graphics context that targets a PDF file or PDF data object. You can then create one or more PDF pages and draw into those pages using the same UIKit and Core Graphics drawing… Read More »

Custom TableView in iOS Swift

By | July 6, 2016

In this post we will see how we can create custom tableview cells in Swift. Let’s Start… Create a new project and name it the way you like. For creating Custom TableView we have to do below things 1. Drag a tableview and Drag a UITableView Cell into it. 2. For our example – Drag… Read More »

Apple MapKit – Loading Maps, Finding User Location, Searching for a Location, Adding Annotation, Interacting with Annotations, Drawing Lines in Maps, Adding Circle, Showing Route between two locations.

By | June 25, 2016

In this demo we will be doing the following things using Apple MapKit and Google Maps API. Load Maps Add Annotation Search for a Location Decode an Address Find route between locations For starting we will add a MapView to the Storyboard and hook it to a variable named mapView. You can simply run the… Read More »

In-App Purchase in iOS

By | May 7, 2016

In-App purchase is a way of selling digital content from inside the apps. This helps the app developers to sell their apps for free and monetize the app in a clean and efficient way. In-App purchase has been a major source of revenue for Apple and Developers almost similar to Paid Apps. Below are the… Read More »

What are optionals in Swift ( ? && ! ).

By | August 29, 2016

Swift introduces Optionals type, which handles the absence of a value. Optionals say if there are set a value, then take that value, it can be of any type AND else it is nil. Basically It has two possible values, None and Some(T), where T is an associated value of the correct data type available… Read More »

Using NSOperationQueue in iOS to do Serial/Concurrent Operations.

By | May 4, 2016

NSOperationQueue is used to do scheduled operations in iOS. You can customize NSOperationQueue to do Concurrent/Serial operations. You can set NSOperationQueue maxConcurrentOperationCount to tell it to do how many operations to execute at a time. Lets see this with an example [Swift Version] In the above example, we set maxConcurrentOperationCount to 1, telling it to… Read More »

Solution for CoreData Multithreading problem.

By | February 6, 2017

This post is for people who are at least familiar with CoreData. But just knowing is not everything.. CoreData creates problems when you access them from different threads… Most common problems are listed below CoreData: error: Serious application error. Exception was caught during Core Data change processing. This is usually a bug within an observer… Read More »

ld: warning: directory not found for option -F or -L, Xcode Error – Solved.

By | March 29, 2016

There are two errors like this that often happens with the Xcode. If it is a “directory not found for option ‘-L/…” error, that means it’s a Library Error, then Follow the below steps… Click on your project (targets) Click on Build Settings, Search for “Library Search Paths” Under Library Search Paths, delete the paths… Read More »

Advantages of NSURLSession over NSURLConnection in iOS and Sample Demo Code

By | April 2, 2016

In an application we usually works with Data tasks – Data tasks are used for requesting data from a server, such as JSON data. These data are usually stored in memory and never touches the File System We can use NSURLSessionDataTask. Upload Tasks – Upload tasks are used to upload data to a remote destination.… Read More »

Using “BackgroundFetch” in iOS to do task in the Background.

By | March 9, 2016

Hi Friends, Here is a simple way to do background task in iOS using “BackgroundFetch”. We will just try to send a message to the UI when a new data arrives in the background. You can do anything there you want. To enable “BackgroundFetch” in your app, you have to do some modifications in your… Read More »

Contacts Demo in Swift 2 – Showing Contacts Picker, Load Contacts in Custom TableView, Add New Contact, Update Contact, Delete Contact, Search Contact

By | February 21, 2016

In Today’s post I will show you How to do below things in Swift 2… 1. Show Contact Picker using System In-Built UI & Pick a Contact 2. Load all Contacts in a TableView 3. Search a Contact 4. Add a New Contact 5. Update a Contact 6. Delete a Contact Before using the contacts… Read More »

Missing iOS Distribution signing identity for … Xcode can request one for you/This Certificate has an Invalid Issuer – iOS Issue Solved

By | February 25, 2016

To Solve this 1. Download https://developer.apple.com/certificationauthority/AppleWWDRCA.cer 2. Double-click to install to Keychain. 3. Then in Keychain, Select View -> “Show Expired Certificates” in Keychain app. 4. It will list all the expired certifcates. 5. Delete “Apple Worldwide Developer Relations Certificate Authority certificates” from “login” tab 6. And also delete it from “System” tab. 7. Now… Read More »

Google Maps – iOS, Location tracking, Custom Markers, Multiple Markers StreetView, CameraView, IndoorView, Showing Route in Maps etc…

By | February 14, 2016

You know for using Google Maps,we need an API Key. You can check Google Maps for Android here… So for that we need to register in Google Developer Console.     Once you get your API Key. we can start with Integrating Google Maps in our app. I am going to show how we can… Read More »

Simple Core Data tutorial in iOS

By | July 15, 2015

In this tutorial we will be making a simple application to save a person details using Core Data. Here we will have two models or it can be said as Database tables – Model1 and Model2. Below are the basic things about Core Data… Core Data Stack The key objects of the stack are the… Read More »

Making a GridView in iOS using UICollectionView.

By | November 23, 2014

Hey all, In Today’s article you will study about the implementation of UICollectionView in iOS. It is similar to GridView in Android. First drag a UICollectionView [Not the Collection View Controller] in your interface and let it be there. we will come back to it later. We are going to create a UICollectionView with custom… Read More »