LowkeyIcon_swift 192x268-01The KitLocate native SDK for iOS is written in Objective C. However, as Swift is gaining popularity with iOS developers we have developed a simple 2-step method to integrate KitLocate with your Swift application.

Before you start please make sure to:
1. Register and create a KitLocate App on our Dev Site
2. Download the KitLocate Swift Project Example
3. Download the KitLocate latest iOS Framework


Please follow the following steps:

(1) Include the following Objective C files in your project (both “.h” and “.m”):

“KitLocateSW”
“KLLocationSW”
“KLStatisticsServicesSW”
“KLGeneralUtilitiesSW”
“KitLocateHandlerSW”

Include “PROJECT_NAME-Bridging-Header.h” in your project. If you already have bridging-Header, add the 5 headers into it.

(You can find these files in the SWIFT-Project-Example)

(2) Use KitLocate similar to Objective C, with the addition of SW in the end of each class or delegate name, for example:

    KitLocateSW.initKitLocateWithDelegate(… , …)

To listen for KitLocate’s delegates, add the appropriate delegates at class declaration, for example:

    class AppDelegate: … , KitLocateDelegateSW

That is all you need.
If you have any questions – drop us a line we will be happy to hear and help.

Post written by Hadar Dubin.