{"action":"created","issue":{"url":"https://api.github.com/repos/airbnb/lottie-ios/issues/568","repository_url":"https://api.github.com/repos/airbnb/lottie-ios","labels_url":"https://api.github.com/repos/airbnb/lottie-ios/issues/568/labels{/name}","comments_url":"https://api.github.com/repos/airbnb/lottie-ios/issues/568/comments","events_url":"https://api.github.com/repos/airbnb/lottie-ios/issues/568/events","html_url":"https://github.com/airbnb/lottie-ios/issues/568","id":300700492,"number":568,"title":"How do I return an Unmanaged<CGColor>!","user":{"login":"jlubeck","id":3067603,"avatar_url":"https://avatars3.githubusercontent.com/u/3067603?v=4","gravatar_id":"","url":"https://api.github.com/users/jlubeck","html_url":"https://github.com/jlubeck","followers_url":"https://api.github.com/users/jlubeck/followers","following_url":"https://api.github.com/users/jlubeck/following{/other_user}","gists_url":"https://api.github.com/users/jlubeck/gists{/gist_id}","starred_url":"https://api.github.com/users/jlubeck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlubeck/subscriptions","organizations_url":"https://api.github.com/users/jlubeck/orgs","repos_url":"https://api.github.com/users/jlubeck/repos","events_url":"https://api.github.com/users/jlubeck/events{/privacy}","received_events_url":"https://api.github.com/users/jlubeck/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-27T16:28:18Z","updated_at":"2018-03-29T23:08:51Z","closed_at":null,"author_association":"NONE","body":"<!--\r\n## Lottie-iOS Issue\r\nHello! Sorry you're having an Issue! Please help us make Lottie better by filling everything below out with as much information as you can, so we can try to reproduce and fix the issue!\r\n-->\r\n\r\n## Check these before submitting:\r\n- [x] Updated to the latest version of Lottie (2.5.0)\r\n- [x] The issue doesn't involve an [Unsupported Feature](https://github.com/airbnb/lottie-ios/blob/master/README.md#currently-unsupported-after-effects-features)\r\n- [x] This issue isn't related to another open issue\r\n\r\n## This issue is a:\r\n- [x] Non-Crashing Bug (Visual or otherwise)\r\n\r\n## What Platform are you on? \r\n<!-- (Specify Platform Version) -->\r\n- [x] iOS\r\n\r\nI'm trying to implement the new delegates for changing color during an animation, but I can't seem to get my head around it and couldn't find proper documentation about it. \r\n\r\nExamples are only about changing position, but not color. The only example I found for changing color it just says \r\n\r\n```\r\nlet colorBlock = LOTColorBlockCallback { (currentFrame, startKeyFrame, endKeyFrame, interpolatedProgress, startColor, endColor, interpolatedColor) -> Unmanaged<CGColor> in\r\n    return aColor\r\n}\r\n```\r\n\r\nBut doesn't say how that aColor is created.\r\n\r\nIf I just try to return  `UIColor.white.cgColor` I get an error that says \r\n\r\nCannot convert return expression of type 'CGColor' to return type 'Unmanaged<CGColor>!'\r\n\r\nThank you"},"comment":{"url":"https://api.github.com/repos/airbnb/lottie-ios/issues/comments/377399484","html_url":"https://github.com/airbnb/lottie-ios/issues/568#issuecomment-377399484","issue_url":"https://api.github.com/repos/airbnb/lottie-ios/issues/568","id":377399484,"user":{"login":"chansen22","id":680919,"avatar_url":"https://avatars3.githubusercontent.com/u/680919?v=4","gravatar_id":"","url":"https://api.github.com/users/chansen22","html_url":"https://github.com/chansen22","followers_url":"https://api.github.com/users/chansen22/followers","following_url":"https://api.github.com/users/chansen22/following{/other_user}","gists_url":"https://api.github.com/users/chansen22/gists{/gist_id}","starred_url":"https://api.github.com/users/chansen22/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chansen22/subscriptions","organizations_url":"https://api.github.com/users/chansen22/orgs","repos_url":"https://api.github.com/users/chansen22/repos","events_url":"https://api.github.com/users/chansen22/events{/privacy}","received_events_url":"https://api.github.com/users/chansen22/received_events","type":"User","site_admin":false},"created_at":"2018-03-29T23:08:51Z","updated_at":"2018-03-29T23:08:51Z","author_association":"NONE","body":"Unmanaged.passRetained(UIColor.red.cgColor) should give back Unmanged<CGColor>!, but the compiler complains about objc ownership.\r\nIt looks like there's updated docs on airbnb's website http://airbnb.io/lottie/ios/dynamic.html\r\n\r\nI think you're looking for something more like this:\r\n```\r\nlet a = LOTAnimationView(name: \"progress\")\r\nlet colorCallback = LOTColorValueCallback(color: UIColor.red.cgColor)\r\nlet keypath = LOTKeypath(string: \"Key.Path.Your.Designer.Gave.You\")\r\na.setValueDelegate(colorCallback, for: keypath)\r\na.frame = foodPlanProgressView.frame\r\naddSubview(a)\r\na.play()\r\n```"}}
{"actor":{"display_login":"chansen22"}}