Skip to content

Instantly share code, notes, and snippets.

View manucodin's full-sized avatar

Manu Rodríguez manucodin

View GitHub Profile
func addLookAroundController(lookAroundController: UIViewController) {
view.addSubview(lookAroundController.view)
lookAroundController.view.translatesAutoresizingMaskIntoConstraints = false
lookAroundController.view.heightAnchor.constraint(equalToConstant: 90).isActive = true
lookAroundController.view.widthAnchor.constraint(equalToConstant: 130).isActive = true
lookAroundController.view.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: 16).isActive = true
lookAroundController.view.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 16).isActive = true
func createLookAroundView(scene: MKLookAroundScene) -> MKLookAroundViewController {
let lookAroundViewController = MKLookAroundViewController(scene: scene)
lookAroundViewController.showsRoadLabels = true //Default value is true
lookAroundViewController.isNavigationEnabled = true //Default value is true
lookAroundViewController.pointOfInterestFilter = .includingAll //Default value is nil
return lookAroundViewController
}
@manucodin
manucodin / LookAroundSceneProvider.swift
Last active October 4, 2022 08:20
MKLookAroundRequest
func fetchLookAroundScene(withCoordinates coordinates: CLLocationCoordinate2D) async throws -> MKLookAroundScene? {
return try await MKLookAroundSceneRequest(coordinate: coordinates).scene
}