CocoaPods trunk is moving to be read-only. Read more on the blog, there are 11 months to go.
| TestsTested | ✗ |
| LangLanguage | SwiftSwift |
| License | MIT |
| ReleasedLast Release | Jun 2015 |
| SPMSupports SPM | ✗ |
Maintained by Ethem Ozcan.
Detects user’s angle to Kaaba.
QiblaDirection can be added to your project using Cocoapods.
pod 'QiblaDirection'
or just add the QiblaDirection.swift file to your project
Define QiblaDirection as an instance variable.
You can handle Location Authorization yourself or also let the QiblaDirection handle itself by sending true to the askForAuthorizationIfNeeded parameter in the constructor method.
var qibla: QiblaDirection?
override func viewDidLoad() {
super.viewDidLoad()
self.qibla = QiblaDirection(delegate: self, askForAuthorizationIfNeeded: true)
self.qibla?.tryStartUpdating()
} func qiblaDirectionNeedsAuthorization() {
// Authorisation can be handled here.
}
func qiblaHeadingDidChange(inPoint: Bool, headingAngle: Double) {
let text = inPoint ? "YES" : "NO"
println("Qibla in point: \(text) \nHeading angle \(headingAngle) degree")
}
func qiblaAngleDidChanged(angle: Double) {
println("Qibla Angle: \(angle) degree")
}