{"action":"created","issue":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/5970","repository_url":"https://api.github.com/repos/mapbox/mapbox-gl-native","labels_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/5970/labels{/name}","comments_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/5970/comments","events_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/5970/events","html_url":"https://github.com/mapbox/mapbox-gl-native/issues/5970","id":170808386,"number":5970,"title":"Runtime styling properties are too loosely typed","user":{"login":"1ec5","id":1231218,"avatar_url":"https://avatars.githubusercontent.com/u/1231218?v=3","gravatar_id":"","url":"https://api.github.com/users/1ec5","html_url":"https://github.com/1ec5","followers_url":"https://api.github.com/users/1ec5/followers","following_url":"https://api.github.com/users/1ec5/following{/other_user}","gists_url":"https://api.github.com/users/1ec5/gists{/gist_id}","starred_url":"https://api.github.com/users/1ec5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/1ec5/subscriptions","organizations_url":"https://api.github.com/users/1ec5/orgs","repos_url":"https://api.github.com/users/1ec5/repos","events_url":"https://api.github.com/users/1ec5/events{/privacy}","received_events_url":"https://api.github.com/users/1ec5/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/macOS","name":"macOS","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/runtime%20styling","name":"runtime styling","color":"fbca04"}],"state":"open","locked":false,"assignee":{"login":"frederoni","id":764476,"avatar_url":"https://avatars.githubusercontent.com/u/764476?v=3","gravatar_id":"","url":"https://api.github.com/users/frederoni","html_url":"https://github.com/frederoni","followers_url":"https://api.github.com/users/frederoni/followers","following_url":"https://api.github.com/users/frederoni/following{/other_user}","gists_url":"https://api.github.com/users/frederoni/gists{/gist_id}","starred_url":"https://api.github.com/users/frederoni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frederoni/subscriptions","organizations_url":"https://api.github.com/users/frederoni/orgs","repos_url":"https://api.github.com/users/frederoni/repos","events_url":"https://api.github.com/users/frederoni/events{/privacy}","received_events_url":"https://api.github.com/users/frederoni/received_events","type":"User","site_admin":false},"assignees":[{"login":"frederoni","id":764476,"avatar_url":"https://avatars.githubusercontent.com/u/764476?v=3","gravatar_id":"","url":"https://api.github.com/users/frederoni","html_url":"https://github.com/frederoni","followers_url":"https://api.github.com/users/frederoni/followers","following_url":"https://api.github.com/users/frederoni/following{/other_user}","gists_url":"https://api.github.com/users/frederoni/gists{/gist_id}","starred_url":"https://api.github.com/users/frederoni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frederoni/subscriptions","organizations_url":"https://api.github.com/users/frederoni/orgs","repos_url":"https://api.github.com/users/frederoni/repos","events_url":"https://api.github.com/users/frederoni/events{/privacy}","received_events_url":"https://api.github.com/users/frederoni/received_events","type":"User","site_admin":false},{"login":"1ec5","id":1231218,"avatar_url":"https://avatars.githubusercontent.com/u/1231218?v=3","gravatar_id":"","url":"https://api.github.com/users/1ec5","html_url":"https://github.com/1ec5","followers_url":"https://api.github.com/users/1ec5/followers","following_url":"https://api.github.com/users/1ec5/following{/other_user}","gists_url":"https://api.github.com/users/1ec5/gists{/gist_id}","starred_url":"https://api.github.com/users/1ec5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/1ec5/subscriptions","organizations_url":"https://api.github.com/users/1ec5/orgs","repos_url":"https://api.github.com/users/1ec5/repos","events_url":"https://api.github.com/users/1ec5/events{/privacy}","received_events_url":"https://api.github.com/users/1ec5/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/milestones/37","html_url":"https://github.com/mapbox/mapbox-gl-native/milestones/ios-v3.4.0","labels_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/milestones/37/labels","id":1783804,"number":37,"title":"ios-v3.4.0","description":"The release will go through a series of alpha and beta versions until it reaches a stable state and is made generally available. In the alpha phase, we publish a version that have enough new features as to be useful for developers who would like to test and help report issues. In the beta phase, we've locked down new feature development and are focused mostly on stability issues. In general, after the first alpha, we aim to release a new alpha (or beta) version once per week.\r\n\r\n## Releases\r\n\r\n- Alpha 1: 8/11\r\n- Alpha 2: 8/18 (planned)\r\n","creator":{"login":"friedbunny","id":1198851,"avatar_url":"https://avatars.githubusercontent.com/u/1198851?v=3","gravatar_id":"","url":"https://api.github.com/users/friedbunny","html_url":"https://github.com/friedbunny","followers_url":"https://api.github.com/users/friedbunny/followers","following_url":"https://api.github.com/users/friedbunny/following{/other_user}","gists_url":"https://api.github.com/users/friedbunny/gists{/gist_id}","starred_url":"https://api.github.com/users/friedbunny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/friedbunny/subscriptions","organizations_url":"https://api.github.com/users/friedbunny/orgs","repos_url":"https://api.github.com/users/friedbunny/repos","events_url":"https://api.github.com/users/friedbunny/events{/privacy}","received_events_url":"https://api.github.com/users/friedbunny/received_events","type":"User","site_admin":false},"open_issues":43,"closed_issues":44,"state":"open","created_at":"2016-05-23T22:50:20Z","updated_at":"2016-08-18T12:44:41Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2016-08-12T06:40:04Z","updated_at":"2016-08-18T14:56:38Z","closed_at":null,"body":"We currently use the MGLStyleAttributeValue protocol to allow any style attribute property to be set to the appropriate value type or an instance of MGLStyleAttributeFunction. While this approach is slightly more strongly typed than `id`, preventing the developer from setting a property to e.g. a UIButton, it doesn’t keep the developer from setting the property to an NSString where an NSNumber is expected or an NSArray where an NSValue is expected. The attribute properties’ types should be more specific, allowing the compiler to catch common developer errors.\r\n\r\n/cc @frederoni @incanus @jfirebaugh"},"comment":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/comments/240749474","html_url":"https://github.com/mapbox/mapbox-gl-native/issues/5970#issuecomment-240749474","issue_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/5970","id":240749474,"user":{"login":"1ec5","id":1231218,"avatar_url":"https://avatars.githubusercontent.com/u/1231218?v=3","gravatar_id":"","url":"https://api.github.com/users/1ec5","html_url":"https://github.com/1ec5","followers_url":"https://api.github.com/users/1ec5/followers","following_url":"https://api.github.com/users/1ec5/following{/other_user}","gists_url":"https://api.github.com/users/1ec5/gists{/gist_id}","starred_url":"https://api.github.com/users/1ec5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/1ec5/subscriptions","organizations_url":"https://api.github.com/users/1ec5/orgs","repos_url":"https://api.github.com/users/1ec5/repos","events_url":"https://api.github.com/users/1ec5/events{/privacy}","received_events_url":"https://api.github.com/users/1ec5/received_events","type":"User","site_admin":false},"created_at":"2016-08-18T14:56:38Z","updated_at":"2016-08-18T14:56:38Z","body":"> They're actually independent in that sense, setting a function will override the constant and vice versa as excepted.\r\n\r\nYes, that’s what we’d have to do, but it still isn’t as straightforward as having one property for each attribute. It will be possible to make this approach KVO compliant, but it means more work on the part of the developer: if the icon padding is undefined, you need to check two different properties to determine that.\r\n\r\n> Function stops would still be weakly typed, unfortunately. No improvements there.\r\nPerhaps we can solve that by splitting up functions into `MGLStyleZoomFunction` or even into different types for padding, offset etc.\r\n\r\nThat’s exactly what the lightweight generics in solution 2 are meant to address. One class can handle every type, be it an NSNumber, NSString, or NSValue."}}
{"actor":{"display_login":"1ec5"}}