{"action":"created","issue":{"url":"https://api.github.com/repos/JakeLin/IBAnimatable/issues/218","repository_url":"https://api.github.com/repos/JakeLin/IBAnimatable","labels_url":"https://api.github.com/repos/JakeLin/IBAnimatable/issues/218/labels{/name}","comments_url":"https://api.github.com/repos/JakeLin/IBAnimatable/issues/218/comments","events_url":"https://api.github.com/repos/JakeLin/IBAnimatable/issues/218/events","html_url":"https://github.com/JakeLin/IBAnimatable/issues/218","id":158712379,"number":218,"title":"API Improvement proposal","user":{"login":"lastMove","id":4633817,"avatar_url":"https://avatars.githubusercontent.com/u/4633817?v=3","gravatar_id":"","url":"https://api.github.com/users/lastMove","html_url":"https://github.com/lastMove","followers_url":"https://api.github.com/users/lastMove/followers","following_url":"https://api.github.com/users/lastMove/following{/other_user}","gists_url":"https://api.github.com/users/lastMove/gists{/gist_id}","starred_url":"https://api.github.com/users/lastMove/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lastMove/subscriptions","organizations_url":"https://api.github.com/users/lastMove/orgs","repos_url":"https://api.github.com/users/lastMove/repos","events_url":"https://api.github.com/users/lastMove/events{/privacy}","received_events_url":"https://api.github.com/users/lastMove/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/JakeLin/IBAnimatable/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"lastMove","id":4633817,"avatar_url":"https://avatars.githubusercontent.com/u/4633817?v=3","gravatar_id":"","url":"https://api.github.com/users/lastMove","html_url":"https://github.com/lastMove","followers_url":"https://api.github.com/users/lastMove/followers","following_url":"https://api.github.com/users/lastMove/following{/other_user}","gists_url":"https://api.github.com/users/lastMove/gists{/gist_id}","starred_url":"https://api.github.com/users/lastMove/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lastMove/subscriptions","organizations_url":"https://api.github.com/users/lastMove/orgs","repos_url":"https://api.github.com/users/lastMove/repos","events_url":"https://api.github.com/users/lastMove/events{/privacy}","received_events_url":"https://api.github.com/users/lastMove/received_events","type":"User","site_admin":false},"assignees":[{"login":"lastMove","id":4633817,"avatar_url":"https://avatars.githubusercontent.com/u/4633817?v=3","gravatar_id":"","url":"https://api.github.com/users/lastMove","html_url":"https://github.com/lastMove","followers_url":"https://api.github.com/users/lastMove/followers","following_url":"https://api.github.com/users/lastMove/following{/other_user}","gists_url":"https://api.github.com/users/lastMove/gists{/gist_id}","starred_url":"https://api.github.com/users/lastMove/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lastMove/subscriptions","organizations_url":"https://api.github.com/users/lastMove/orgs","repos_url":"https://api.github.com/users/lastMove/repos","events_url":"https://api.github.com/users/lastMove/events{/privacy}","received_events_url":"https://api.github.com/users/lastMove/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/JakeLin/IBAnimatable/milestones/2","html_url":"https://github.com/JakeLin/IBAnimatable/milestones/3.0","labels_url":"https://api.github.com/repos/JakeLin/IBAnimatable/milestones/2/labels","id":1580978,"number":2,"title":"3.0","description":"Major version theme: Improve all APIs to support Swift 3","creator":{"login":"JakeLin","id":573856,"avatar_url":"https://avatars.githubusercontent.com/u/573856?v=3","gravatar_id":"","url":"https://api.github.com/users/JakeLin","html_url":"https://github.com/JakeLin","followers_url":"https://api.github.com/users/JakeLin/followers","following_url":"https://api.github.com/users/JakeLin/following{/other_user}","gists_url":"https://api.github.com/users/JakeLin/gists{/gist_id}","starred_url":"https://api.github.com/users/JakeLin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JakeLin/subscriptions","organizations_url":"https://api.github.com/users/JakeLin/orgs","repos_url":"https://api.github.com/users/JakeLin/repos","events_url":"https://api.github.com/users/JakeLin/events{/privacy}","received_events_url":"https://api.github.com/users/JakeLin/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":0,"state":"open","created_at":"2016-02-13T10:09:26Z","updated_at":"2016-07-08T08:23:18Z","due_on":null,"closed_at":null},"comments":41,"created_at":"2016-06-06T15:56:09Z","updated_at":"2016-07-09T12:57:40Z","closed_at":null,"body":"**enum checklist to improve**\r\n- [x] MaskType\r\n- [ ] AnimationType\r\n- [ ] GradientStartPoint\r\n- [ ] BorderSide\r\n- [ ] BlurEffectStyle\r\n- [ ] ColorType - FlatColorsTypeScript.swift\r\n- [ ] GradientType - GradientsTypeScript.swift\r\n- [ ] InteractiveGestureType\r\n- [ ] TransitionAnimationType\r\n- [ ] SystemTransitionType\r\n- [ ] TransitionFromDirection\r\n- [ ] TransitionHollowState\r\n- [ ] TransitionPageType\r\n\r\n-------- Original Message --------\r\nHi All, I really love using this library. However i think that the API can be improved.\r\n\r\nPresently a lot of properties are String because of InterfaceBuilder. Some property would be more usable, self-documented and less error-prone if they were enums with associated type.\r\n\r\nEnums with associatedType are powerful and fit perfectly with IBAnimatable Purpose.\r\n\r\nBefore pursuing one example with maskType.using enums it will be possible to make this:\r\n\r\n```Swift\r\n\r\nanimatableView.maskType = MaskType.Parrallelogram(angle:45, direction: .Top)\r\n\r\nanimatableView.maskType = .Polygon(sides:8)\r\nanimatableView.maskType = .Circle\r\n\r\nanimatableView.maskType = “Polygon(8)“ // yes this is possible since the MaskType Enum adopts StringLiteralConvertible protocol\r\n\r\nBUT (sadly) this will NOT be possible \r\n\r\nlet string = “Polygon(8);\r\nanimatableView.maskType = string // Since there is no StringConvertible protocol in swift (yet) , only String Lterals are convertible \r\n\r\n```\r\n\r\n\r\nI tried a lot of thing to be able to do this AND to stay compatible with Interface Builder But No way :(\r\n\r\nThe most convenient way IMO is to make 2 properties. \r\n```Swift\r\n\r\nprivate var maskType : String\r\nvar eMaskType : MaskType\r\n\r\n```\r\nSince the string maskType is made for Interface Builder it can be private. \r\nThe advantage is that when accessing from code they will be just one way exposed. \r\nand since MaskType is StringLiteralConvertible, the existant code that looks like : \r\nview.maskType = “Circle”\r\n\r\nwill justNeed to be transformed to \r\n\r\n`view.eMaskType = “Circle”\r\n`\r\nAnd we could use` @avalable(iOS, renamed=“eMaskType”)` in order to simplify the migration\r\n\r\n\r\n\r\nHowever, Since WWDC is soon, we can just wait to see Interface Builder improvements :) \r\nI have already refactor maskType locally to an enum, for testing this. It works.\r\n\r\nWhat do you think about it ?"},"comment":{"url":"https://api.github.com/repos/JakeLin/IBAnimatable/issues/comments/231533270","html_url":"https://github.com/JakeLin/IBAnimatable/issues/218#issuecomment-231533270","issue_url":"https://api.github.com/repos/JakeLin/IBAnimatable/issues/218","id":231533270,"user":{"login":"lastMove","id":4633817,"avatar_url":"https://avatars.githubusercontent.com/u/4633817?v=3","gravatar_id":"","url":"https://api.github.com/users/lastMove","html_url":"https://github.com/lastMove","followers_url":"https://api.github.com/users/lastMove/followers","following_url":"https://api.github.com/users/lastMove/following{/other_user}","gists_url":"https://api.github.com/users/lastMove/gists{/gist_id}","starred_url":"https://api.github.com/users/lastMove/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lastMove/subscriptions","organizations_url":"https://api.github.com/users/lastMove/orgs","repos_url":"https://api.github.com/users/lastMove/repos","events_url":"https://api.github.com/users/lastMove/events{/privacy}","received_events_url":"https://api.github.com/users/lastMove/received_events","type":"User","site_admin":false},"created_at":"2016-07-09T12:57:40Z","updated_at":"2016-07-09T12:57:40Z","body":"Hi all. \r\nI started working on AnimationType. It's pretty straightforward.\r\nEverything seems to work from code. \r\nBut when using it in storyboard it can be painful since it's case-sensitive. \r\nfor example \"squeezein\" will not work. \r\nSo I will try (I don't know how yet) to make it case-insensitive. "}}
{"actor":{"display_login":"lastMove"}}