Detecting Which Floor the User is on in a Building in Swift

I am developing the application where the application has to detect which floor the user is on in a building.


I have tried using CLLocation (

location.floor?.level
) but this value always returns nil.


Please suggest me, Is there any other way to get floor level apart from CLLocation?

The documentation say that If floor information is not available for the current location, the value of this property is nil.


https://developer.apple.com/documentation/corelocation/cllocation/1616762-floor

Detecting Which Floor the User is on in a Building in Swift
 
 
Q