{"id":18739735,"url":"https://github.com/roblabs/ios-map-ui","last_synced_at":"2025-04-12T20:32:36.585Z","repository":{"id":136165068,"uuid":"111474923","full_name":"roblabs/ios-map-ui","owner":"roblabs","description":"Using Swift to create Mapbox \u0026 MapKit Maps while minimizing reliance on storyboards","archived":true,"fork":false,"pushed_at":"2021-06-18T22:50:12.000Z","size":6042,"stargazers_count":1,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T08:37:03.572Z","etag":null,"topics":["ios","mapbox-maps","storyboards","swift","xcode"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/roblabs.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-20T23:40:32.000Z","updated_at":"2024-04-30T20:52:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"ae9555b0-eaba-46fd-9419-13b11f9c7541","html_url":"https://github.com/roblabs/ios-map-ui","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roblabs%2Fios-map-ui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roblabs%2Fios-map-ui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roblabs%2Fios-map-ui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roblabs%2Fios-map-ui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roblabs","download_url":"https://codeload.github.com/roblabs/ios-map-ui/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248630206,"owners_count":21136392,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ios","mapbox-maps","storyboards","swift","xcode"],"created_at":"2024-11-07T15:37:11.779Z","updated_at":"2025-04-12T20:32:36.579Z","avatar_url":"https://github.com/roblabs.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Using Swift to create Maps while minimizing reliance on storyboards\n\nExplore the project at [github.com/roblabs/ios-map-ui](https://github.com/roblabs/ios-map-ui/)\n\n# Mapbox Starter\n\nA starter project for Mapbox maps in iOS\n\n## Features\n* A starter Mapbox project built off the steps documented at [https://www.mapbox.com/install](https://www.mapbox.com/install)\n* Built using Carthage\n  * `brew install carthage`\n  * Install by running `carthage update`\n* ~~Made with Xcode Version 9.1 (9B55), and Swift 4~~\n* Updated for Xcode Version 10.3 (10G8) and Swift 5\n\n### How to Use\n* Add a `MGLMapboxAccessToken` key to the `Info.plist`.\n  * See [https://www.mapbox.com/install/ios/carthage-permission](https://www.mapbox.com/install/ios/carthage-permission)\n  * See [https://www.mapbox.com/help/how-access-tokens-work/](https://www.mapbox.com/help/how-access-tokens-work/)\n\n\n#### Screen Shots\n\nInitial zoom and center\n\n![](Mapbox-starter/Mapbox-starter.png)\n\n##### Storyboard\n\n* Built using the option *Add with code*, so no storyboard was used in this demo.  Adding it for reference.\n\n![](Mapbox-starter/add-with-code.png)\n\n---\n\nEmpty Storyboard; all views added via code\n\n![](Mapbox-starter/main.storyboard.png)\n\n\n---\n\n# Mapbox-UIBarButton\n\nA Mapbox map with `UIBarButtonItem` added using Swift, with minimal use of the storyboard.\n\n## Features\n* Built upon Mapbox Starter\n* Made with Xcode Version 9.1 (9B55), and Swift 4\n* Added [`UIBarButtonItem`](https://developer.apple.com/documentation/uikit/uibarbuttonsystemitem) and code handlers to take action when they are clicked.\n``` Swift\noverride func viewDidLoad() {\n    super.viewDidLoad()\n\n    // MARK:- UIBarButtonItem\n    self.navigationItem.leftBarButtonItem = UIBarButtonItem(\n        barButtonSystemItem: .search,\n        target: self,\n        action: #selector(handleLeftBarButton))\n\n    self.navigationItem.rightBarButtonItem = UIBarButtonItem(\n      barButtonSystemItem: .action,\n      target: self,\n      action: #selector(handleRightBarButton))\n}\n```\n\n#### Screen Shots\n\nInitial zoom and center\n\n![](Mapbox-UIBarButton/Mapbox-UIBarButton.png)\n\n##### Storyboard\n\n* Added a [UINavigationBar](https://developer.apple.com/documentation/uikit/uinavigationbar), which is done by Embedding the view controller in Navigation Controller\n  * Click your view controller\n  * `Editor` \u003e `Embed In` \u003e `Navigation Controller`\n\n![](Mapbox-UIBarButton/Editor.Embed-in.Navigation-Controller.png)\n\n---\n\n![](Mapbox-UIBarButton/main.storyboard.png)\n\n---\n\n\n# Mapbox-Search\n\nA Mapbox map with `UISearchBar` added using Swift, with minimal use of the storyboard.\n\n\n## Features\n* Built upon Mapbox UIBarButtonItem\n* Made with Xcode Version 9.1 (9B55), and Swift 4\n* Mapbox map disappears when searching and a `UITableView` pops up with filtered search results\n* The Search portion is based on the tutorial called *UISearchController Tutorial: Getting Started* from [RayWenderlich.com](https://www.raywenderlich.com/157864/uisearchcontroller-tutorial-getting-started).  Please see the license file in each file for information.\n* Integrating `UISearchController` is a mixture of Storyboards and Swift code.\n* Based on event handlers for when the search is started or ended, the Mapbox `mapView` is hidden or displayed.\n\n\n#### Screen Shots\n\n\n\n![](Mapbox-Search/Mapbox-Search.gif)\n\n##### Storyboard\n\n---\n\n![](Mapbox-Search/main.storyboard.png)\n\n---\n\n\n# MapKit Starter\n\nTo make a MapKit view without a storyboard\n\n1. In `Info.plist`, delete the key `Main Storyboard file base name`\n1. Be sure to add the *Maps* Capability in Project \u003e Capabilities\n1. In your `AppDelegate.swift`, ```\nfunc application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -\u003e Bool {\n\n    window = UIWindow(frame: UIScreen.main.bounds)\n\n    if let window = window {\n        window.backgroundColor = UIColor.white\n        window.rootViewController = ViewController()\n        window.makeKeyAndVisible()\n    }\n\n    return true\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froblabs%2Fios-map-ui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froblabs%2Fios-map-ui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froblabs%2Fios-map-ui/lists"}