How to create #define Constants in Swift similarly in Objective C ?

By | March 4, 2016

This is actually fairly simple…

1. Create a new Swift file and name it say “MyConstants.swift”.

2. Declare your constants like below..

      let NOTIFICATION_ID : String = "NOT_ID"

3. Now you can directly use “NOTIFICATION_ID” in any class, Swift will directly import it for you.

Thats all….

Website Pin Facebook Twitter Myspace Friendfeed Technorati Digg Google StumbleUpon Premium Responsive

Leave a Reply

Your email address will not be published. Required fields are marked *