Firebase Remote Config [Swift]

Firebase Remote Config is used to change the application behavior without publishing update of application.

Firebase Remote Config
Firebase Remote Config

Basic setup is to create project at firebase console.

Firebase Console
Firebase Console – Follow the steps to create a project

I am adding a video here to setup the firebase remote config.


Add core firebase to your project

Follow the steps available at : Add Firebase to your iOS Project

Steps to add remote config to your app

  1. Installation

    Update your project with required cocoapods

    Run pod install from terminal and open the created .xcworkspace file.

  2. Configure Firebase Module

    Just import firebase module and apply configure method. It will configure by itself by using GoogleService-Info.plist.

  3. Configure remote config

    Create Remote Config object, as shown in the following example:

    Create an plist file for default values of configuration and set it to remote config:

    FireSwiftRemoteConfigDefaults.plist with sampleURL key:

    Use current default key from your defaults set on plist file and send fetch request in remote config to get the configuration keys set on the firebase console:

    Note : If in developer mode cacheExpiration is set to 0 so each fetch will retrieve values from the server. The default expiration duration is 43200 (12 hours).

  4. All Done.

    Sample code available at Github. There are many other things with firebase, I will try give update in next tutorials.

    If you like then Buy me a coffee ☕️

    Happy Coding 🙂

Push Notifications in iOS 10 [Swift]

Push Notification iOS 10 Swift
Push Notification iOS 10 Swift

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.

So, Let see what we have to change to get the push notifications in iOS 10.

Continue reading

Steps to use Legacy Swift in Xcode 8

Xcode Swift iOS10

Xcode 8.0 is released with Swift 3 and Swift 2.3 compatibility.

If you already having a project with Swift 2.2 language support with Xcode 7.3.1 and you open the project in Xcode 8.0 then, you will be prompted for the migration assistant to do a migration pass. The assistant can also be invoked manually from the menu Edit -> Convert -> To Current Swift Syntax…

  • Use Swift 2.3 Modifies your project to enable the Use Legacy Swift build setting and provides source changes to be able to build against the new SDKs.
  • Use Swift 3 This is recommended. You will get source changes to be able to build your project using Swift 3 and take advantage of all the new features in Xcode 8.0.

If you want to work with new project and you want to work with Legacy code (Swift 2.3) or 3.0 then you can do settings from build settings as follows :

Build Settings - Swift Legacy Code
Build Settings – Swift Legacy Code

Default Setting is No (Swift 3). But if you want to do legacy code (Swift 2.3) then you have to select Yes (Swift 2.3).

Make sure you do this setting by starting of new project because many methods will change.

For Example :

Swift 3 Code

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    // Override point for customization after application launch.
    return true

Swift 2.3 Code

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) -> Bool {
    return true

As per my opinion Swift 3 is recommended.

Happy Coding 🙂

Bye Bye to NS from Swift!!


Many of the types are bridged to the Swift type like as (e.g., NSString being bridged to String).

Other Objective-C types are bridged to Swift are as follows :

Objective-C Swift
NSString String
NSArray Array
NSDictionary Dictionary
NSData Data
NSError Error (Added Swift 3 – Xcode 8 Beta 4)
NSNotificationCenter NotificationCenter

And more…

Bye Bye to NS from Swift!!

Happy Coding 🙂