Maybe you should consider using CocoaPods
as it may be easier for you to integrate, and in the long-run, is easier to update.
To answer your specific question about a manual installation:
Yes, you can just drag the source code into your project. Instructions for creating the bridging header can be found on the internet (for example, here).
Next, as the instructions say, add #import "INTULocationManager.h"
to your bridging header, e.g:
#ifndef TestBridgingHeader_Bridging_Header_h
#define TestBridgingHeader_Bridging_Header_h
#import "INTULocationManager.h"
#endif /* TestBridgingHeader_Bridging_Header_h */
To use the library, you have to translate the example given on the Github page from Objective-C to Swift.
let locMgr = INTULocationManager.sharedInstance()
locMgr.requestLocationWithDesiredAccuracy(INTULocationAccuracy.City, timeout: 10, block: { currentLocation, achievedAccuracy, status in
if status == .Success {
} else if status == .TimedOut {
} else {
}
})
This is made easier by remembering a few rules:
- Method calls in Obj-C are called via enclosing square brackets (e.g.
[INTULocationManager sharedInstance]
) while in Swift they use dot-syntax (e.g. INTULocationManager.sharedInstance()
)
- Enums such as
INTULocationAccuracyCity
generally get translated to only their last part (.City
in this case). Swift infers that .City
is equivalent to INTULocationAccuracy.City
.
- Obj-C blocks such as
INTULocationRequestBlock
are equivalent to Swift closures of the same type.