{"action":"created","issue":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/6389","repository_url":"https://api.github.com/repos/mapbox/mapbox-gl-native","labels_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/6389/labels{/name}","comments_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/6389/comments","events_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/6389/events","html_url":"https://github.com/mapbox/mapbox-gl-native/pull/6389","id":177944762,"number":6389,"title":"revamp iOS settings UI","user":{"login":"incanus","id":17722,"avatar_url":"https://avatars.githubusercontent.com/u/17722?v=3","gravatar_id":"","url":"https://api.github.com/users/incanus","html_url":"https://github.com/incanus","followers_url":"https://api.github.com/users/incanus/followers","following_url":"https://api.github.com/users/incanus/following{/other_user}","gists_url":"https://api.github.com/users/incanus/gists{/gist_id}","starred_url":"https://api.github.com/users/incanus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/incanus/subscriptions","organizations_url":"https://api.github.com/users/incanus/orgs","repos_url":"https://api.github.com/users/incanus/repos","events_url":"https://api.github.com/users/incanus/events{/privacy}","received_events_url":"https://api.github.com/users/incanus/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/labels/iOS","name":"iOS","color":"000000"},{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/labels/refactor","name":"refactor","color":"0052cc"},{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/labels/tests","name":"tests","color":"0052cc"}],"state":"closed","locked":false,"assignee":{"login":"incanus","id":17722,"avatar_url":"https://avatars.githubusercontent.com/u/17722?v=3","gravatar_id":"","url":"https://api.github.com/users/incanus","html_url":"https://github.com/incanus","followers_url":"https://api.github.com/users/incanus/followers","following_url":"https://api.github.com/users/incanus/following{/other_user}","gists_url":"https://api.github.com/users/incanus/gists{/gist_id}","starred_url":"https://api.github.com/users/incanus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/incanus/subscriptions","organizations_url":"https://api.github.com/users/incanus/orgs","repos_url":"https://api.github.com/users/incanus/repos","events_url":"https://api.github.com/users/incanus/events{/privacy}","received_events_url":"https://api.github.com/users/incanus/received_events","type":"User","site_admin":false},"assignees":[{"login":"incanus","id":17722,"avatar_url":"https://avatars.githubusercontent.com/u/17722?v=3","gravatar_id":"","url":"https://api.github.com/users/incanus","html_url":"https://github.com/incanus","followers_url":"https://api.github.com/users/incanus/followers","following_url":"https://api.github.com/users/incanus/following{/other_user}","gists_url":"https://api.github.com/users/incanus/gists{/gist_id}","starred_url":"https://api.github.com/users/incanus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/incanus/subscriptions","organizations_url":"https://api.github.com/users/incanus/orgs","repos_url":"https://api.github.com/users/incanus/repos","events_url":"https://api.github.com/users/incanus/events{/privacy}","received_events_url":"https://api.github.com/users/incanus/received_events","type":"User","site_admin":false}],"milestone":null,"comments":9,"created_at":"2016-09-20T02:06:00Z","updated_at":"2016-09-21T21:47:41Z","closed_at":"2016-09-21T21:47:41Z","pull_request":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/6389","html_url":"https://github.com/mapbox/mapbox-gl-native/pull/6389","diff_url":"https://github.com/mapbox/mapbox-gl-native/pull/6389.diff","patch_url":"https://github.com/mapbox/mapbox-gl-native/pull/6389.patch"},"body":"This was a bit of a yak shave as a result of getting frustrated starting work on #6379 (adding a new runtime styling action), but I think it's long overdue anyway and helps us scale. \r\n\r\nThe goal here is a reorganization of our iOS settings UI, which is currently an action sheet and here a modal table view. Here's why: \r\n\r\n1. The action sheet paradigm dates from a time[<sup>1</sup>](https://github.com/mapbox/mapbox-gl-native/commit/d4d4cd44151423d374e373798f09d12157babc27#diff-33b34b5f099a16158c8462652a0c3688R129) that only had **three** actions, all of which would always fit on the screen. Action sheets are ideal for this sort of UI. \r\n\r\n1. At current `master` we now have 18-20 (depending on `debugLoggingEnabled`) actions. Even if we cull a few, no matter how we slice it, we're going to have to scroll. Might as well use a UI that's designed for it: a table view. We're probably going to keep adding actions. \r\n\r\n1. Speaking of adding actions, this separates the UI (section & row labels) from the code that performs the actions, putting the actions all in one routine [<sup>2</sup>](https://github.com/mapbox/mapbox-gl-native/blob/6ade86ad55a712f13126882a47f485e40383719f/platform/ios/app/MBXViewController.m#L280-L391). This breaks out some of the inline routines around simple runtime styling, custom callout, custom user dot, and some others. This is more scalable and easier to read. \r\n\r\n1. Breaking out runtime styling into individually-labeled actions is better because:\r\n\r\n  - Each could possibly benefit from a custom viewport set (out of scope for this here revamp). Right now you need to know that tapping `Manipulate Style` does like eight things, including styling buildings and removing parks, which might not be relevant to the current viewport, making it look like nothing happened. \r\n\r\n  - It's easier to remember what the test UI is capable of with labeled actions right there to remind you, helping us maintain the list going forward. \r\n\r\n1. Scrolling _any_ list as long as this action one is a pain. Here I use a group-style table view to break things up a bit by functional task. Now we can add new actions [<sup>3</sup>](https://github.com/mapbox/mapbox-gl-native/blob/6ade86ad55a712f13126882a47f485e40383719f/platform/ios/app/MBXViewController.m#L215-L273) as well as whole new sections [<sup>4</sup>](https://github.com/mapbox/mapbox-gl-native/blob/6ade86ad55a712f13126882a47f485e40383719f/platform/ios/app/MBXViewController.m#L201-L206) and things still stay tidy and easy to recall from muscle memory. \r\n\r\n1. This avoids the need for a new view controller class by doing some minimal `UITableViewController` setup along with making our main app view controller the table `delegate` and `dataSource`. I started down a different route of settings label & action abstraction in a bigass dictionary, but this is cleaner and is what the delegate pattern is designed for. \r\n\r\n1. This actually performs the debug action after the table view completes dismissal. With the action sheet, its requisite animated dismissal sometimes covered up or distracted from the actual debug action being performed. Now you get a clean look at the viewport right before the chosen action happens. \r\n\r\n1. This opens up the possibility of new kinds of interaction UI such as sliders, switches, color pickers, etc. for debugging. \r\n\r\n![anigif-1474336839](https://cloud.githubusercontent.com/assets/17722/18655160/60b5a4ca-7e9b-11e6-8a6f-f64e8f1394a5.gif)\r\n\r\n/cc @1ec5 @friedbunny @frederoni "},"comment":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/comments/248752935","html_url":"https://github.com/mapbox/mapbox-gl-native/pull/6389#issuecomment-248752935","issue_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/6389","id":248752935,"user":{"login":"incanus","id":17722,"avatar_url":"https://avatars.githubusercontent.com/u/17722?v=3","gravatar_id":"","url":"https://api.github.com/users/incanus","html_url":"https://github.com/incanus","followers_url":"https://api.github.com/users/incanus/followers","following_url":"https://api.github.com/users/incanus/following{/other_user}","gists_url":"https://api.github.com/users/incanus/gists{/gist_id}","starred_url":"https://api.github.com/users/incanus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/incanus/subscriptions","organizations_url":"https://api.github.com/users/incanus/orgs","repos_url":"https://api.github.com/users/incanus/repos","events_url":"https://api.github.com/users/incanus/events{/privacy}","received_events_url":"https://api.github.com/users/incanus/received_events","type":"User","site_admin":false},"created_at":"2016-09-21T21:47:41Z","updated_at":"2016-09-21T21:47:41Z","body":"👉 https://github.com/mapbox/mapbox-gl-native/pull/6421 to avoid Emoji pain. "}}
{"actor":{"display_login":"incanus"}}