{"action":"created","issue":{"url":"https://api.github.com/repos/mac-cain13/R.swift/issues/134","labels_url":"https://api.github.com/repos/mac-cain13/R.swift/issues/134/labels{/name}","comments_url":"https://api.github.com/repos/mac-cain13/R.swift/issues/134/comments","events_url":"https://api.github.com/repos/mac-cain13/R.swift/issues/134/events","html_url":"https://github.com/mac-cain13/R.swift/issues/134","id":122472349,"number":134,"title":"Expose name for UIImage","user":{"login":"danishin","id":8480743,"avatar_url":"https://avatars.githubusercontent.com/u/8480743?v=3","gravatar_id":"","url":"https://api.github.com/users/danishin","html_url":"https://github.com/danishin","followers_url":"https://api.github.com/users/danishin/followers","following_url":"https://api.github.com/users/danishin/following{/other_user}","gists_url":"https://api.github.com/users/danishin/gists{/gist_id}","starred_url":"https://api.github.com/users/danishin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danishin/subscriptions","organizations_url":"https://api.github.com/users/danishin/orgs","repos_url":"https://api.github.com/users/danishin/repos","events_url":"https://api.github.com/users/danishin/events{/privacy}","received_events_url":"https://api.github.com/users/danishin/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mac-cain13/R.swift/labels/difficulty:%20easy","name":"difficulty: easy","color":"00B952"},{"url":"https://api.github.com/repos/mac-cain13/R.swift/labels/state:%20awaiting%20input","name":"state: awaiting input","color":"EDCE24"},{"url":"https://api.github.com/repos/mac-cain13/R.swift/labels/type:%20enhancement","name":"type: enhancement","color":"02AFE1"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/mac-cain13/R.swift/milestones/2","html_url":"https://github.com/mac-cain13/R.swift/milestones/1.0.0","labels_url":"https://api.github.com/repos/mac-cain13/R.swift/milestones/2/labels","id":1462229,"number":2,"title":"1.0.0","description":"","creator":{"login":"mac-cain13","id":618233,"avatar_url":"https://avatars.githubusercontent.com/u/618233?v=3","gravatar_id":"","url":"https://api.github.com/users/mac-cain13","html_url":"https://github.com/mac-cain13","followers_url":"https://api.github.com/users/mac-cain13/followers","following_url":"https://api.github.com/users/mac-cain13/following{/other_user}","gists_url":"https://api.github.com/users/mac-cain13/gists{/gist_id}","starred_url":"https://api.github.com/users/mac-cain13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mac-cain13/subscriptions","organizations_url":"https://api.github.com/users/mac-cain13/orgs","repos_url":"https://api.github.com/users/mac-cain13/repos","events_url":"https://api.github.com/users/mac-cain13/events{/privacy}","received_events_url":"https://api.github.com/users/mac-cain13/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":1,"state":"open","created_at":"2015-12-15T22:35:15Z","updated_at":"2015-12-16T22:46:06Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2015-12-16T10:27:31Z","updated_at":"2015-12-17T03:46:06Z","closed_at":null,"body":"I find myself often in my tests converting `UIImage` to `NSData` to compare their bytes for equality.\r\n\r\nIt'd be nice to simply do string equality for all the images that are exposed through R.swift!\r\n\r\nI found `name` is provided for `R.nib.*`. \r\n\r\nCould we add this? Perhaps we can make `R.imageName` or something similar if wrapping `R.image` with another `struct` is not preferable?\r\n \r\nBTW, great library! No more stupid runtime errors :smile: :+1: "},"comment":{"url":"https://api.github.com/repos/mac-cain13/R.swift/issues/comments/165329338","html_url":"https://github.com/mac-cain13/R.swift/issues/134#issuecomment-165329338","issue_url":"https://api.github.com/repos/mac-cain13/R.swift/issues/134","id":165329338,"user":{"login":"danishin","id":8480743,"avatar_url":"https://avatars.githubusercontent.com/u/8480743?v=3","gravatar_id":"","url":"https://api.github.com/users/danishin","html_url":"https://github.com/danishin","followers_url":"https://api.github.com/users/danishin/followers","following_url":"https://api.github.com/users/danishin/following{/other_user}","gists_url":"https://api.github.com/users/danishin/gists{/gist_id}","starred_url":"https://api.github.com/users/danishin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danishin/subscriptions","organizations_url":"https://api.github.com/users/danishin/orgs","repos_url":"https://api.github.com/users/danishin/repos","events_url":"https://api.github.com/users/danishin/events{/privacy}","received_events_url":"https://api.github.com/users/danishin/received_events","type":"User","site_admin":false},"created_at":"2015-12-17T03:46:06Z","updated_at":"2015-12-17T03:46:06Z","body":"Thanks for your response! \r\n\r\nHaving a wrapper object for `UIImage` with type safety can be very useful not only for testing but also we can do lazy evaluation for returning `UIImage`. Instead of passing around memory hogging `UIImage` around by prematurely creating it, we can easily pass around this `ImageInfo` struct and only call `instance()` method when it is strictly needed.\r\n\r\nI'm currently using MVVM pattern and this would be immensely useful not only for testing but also for performance reasons. Currently, my `ViewModel`s exposes `UIImage`, which causes the image to be created prematurely. Instead, vm can expose `ImageInfo` struct and `View` can call `instance()` when the view is actually loaded.\r\n\r\nI'm sure there are many other beneficial use cases for both performance, clarity and testing by enabling advanced `UIImage` handling which is simply not possible with plain Cocoa (more than just a mere type safety)"}}