CategoryiOS

Applying Query in core data

A

There are few cases when we prefer to use Core data that Sqlite. Core data is faster in fetching records than SQLite. As like sqlite we can fetch data by specifying query in Core data. Following is the way to set your query for fetch request of core data. let request = NSFetchRequest() if #available(iOS 10.0, *) { request.entity = EmpData.entity() } else { request.entity = NSEntityDescription...

UserDefaults with NSCoding and Codable to save any kind of Data… Part – 1 ?

U

 UserDefaults  is one of the good and handy storage you can use. You can use UserDefaults to store any basic data type for as long as the app is installed. For example, you can use basic types as Bool, Float, Double, Int, String, or URL, but you can also write more complex types such as arrays, dictionaries and Date – and even Data values. Advantage: After writing data to UserDefaults, when you...

Push Notification displayed when application in foreground in iOS 10

P

Introduction:  The new framework called “UserNotifications” is introduced with iOS 10 SDK. The UserNotifications framework (UserNotifications.framework) supports the delivery and handling of local and remote notifications when application is in foreground Steps for implement code to handle push notifications in iOS 10 Import UserNotifications.framework in your AppDelegate file :                 ...

Custom Protocol and Delegate

C

Custom protocols and delegate is the very efficient way to passing values to other controller from one controller. If we required pass the value for only one controller in entire project the we should not go for declaring “Global Variable” to pass the values. Example:  Display PopOver for option selection on button click event which placed on TableViewCell. On option selection make...

Get CrashLogs with Fabric Crashlytics

G

Crashlytics provides deep and actionable insights, even the exact line of code your app crashed on. While Crashlytics gives you powerful crash reporting, with one additional click you can enable real-time analytics that help you understand what’s happening in your app. Installation: 1. Add kit to your Podfile. use_frameworks! pod ‘Fabric’ pod ‘Crashlytics’ Then run...

Subclassing in Swift

S

Subclassing is a very simple and useful concept of inheritance, when we create a subclass of any existing class then that custom class inherits all the methods and properties of existing or predefined class and moreover we can add our own user defined properties and methods to it.   Here is the syntax with example for subclassing , class myCustomButton : UIButton { var section = Int() }...

Scanning QR Code Using AVFoundation Framework

S

QR (short for Quick Response) code. QR code has gained popularity in consumer space in recent years as a way to encode URL of a landing page or marketing information. Unlike the basic barcode that we’re familiar with QR code contains information in both horizontal and vertical direction. Thus this contributes to its capability of storing larger amount of data in both numeric and letter form.In...

Animation like floating Buttons.

A

Hi all, today we will check out simple but cool floating buttons using UIViewAnimations methods. So, in this we are going to show 4 buttons which came out upside from another button. Here we are using constraints of  buttons, button and UIViewAnimations. Let’s start with  adding constraint to each buttons. 1) Setting constraints for buttons:-     Add constraint such that bottom constraint...

Download PDF file using Alamofire in Swift3

D

Almofire is a very popular library for networking related coding(eg. API call, Downloading Stuffs etc) and totally developed in swift which is replacement of AFNetworking library of ObjectiveC. It has multiple features like Image cacheing, API call integration,File downloading etc. Today we are going to dive into Download PDF file using Alamofire in Swift. Pods are available for almofire on...

One fantastic way to Load ‘CollectionView’ inside ‘TableViewCell’ using Two ‘Extensions’ in swift3, iOS

O

As We know we, Often, we assign a collection view’s data source to its view controller. But here the problem is that we have only one view controller and many collection views. As I have taken number of ‘Sections’ inside table view. so following is the Solution to distinguish between a collection view on the first section , and one on the second , third and fourth… So here is a way to...

Category