Add a UICollectionView to your view controller using the story board or programmatically.

Add constraints to the newly added UICollectionView. It’s important to have a fixed height for this collection view as it will scroll in one direction.

Getting the GPS location of your iOS device is pretty easy (thanks to Apple). First you need a location manager, which “The object that you use to start and stop the delivery of location-related events to your app.” according to Apple.

Add the following code to your class. You will need this manager to request access to the device’s location. Set your class to be a delegate of CLLocationManagerDelegate

let locationManager = CLLocationManager()

For this to work, you will need to import the CoreLocation framework to your class.

In your viewDidLoad() method, add the following code:

locationManager.delegate = selflocationManager.desiredAccuracy…

Faris Michael Halteh

BodyAttack | iOS Dev

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store