{"action":"created","issue":{"url":"https://api.github.com/repos/michaelarmstrong/SuperRecord/issues/45","labels_url":"https://api.github.com/repos/michaelarmstrong/SuperRecord/issues/45/labels{/name}","comments_url":"https://api.github.com/repos/michaelarmstrong/SuperRecord/issues/45/comments","events_url":"https://api.github.com/repos/michaelarmstrong/SuperRecord/issues/45/events","html_url":"https://github.com/michaelarmstrong/SuperRecord/issues/45","id":113054070,"number":45,"title":"Use Generics in NSManagedObject Extension","user":{"login":"PGLongo","id":3647884,"avatar_url":"https://avatars.githubusercontent.com/u/3647884?v=3","gravatar_id":"","url":"https://api.github.com/users/PGLongo","html_url":"https://github.com/PGLongo","followers_url":"https://api.github.com/users/PGLongo/followers","following_url":"https://api.github.com/users/PGLongo/following{/other_user}","gists_url":"https://api.github.com/users/PGLongo/gists{/gist_id}","starred_url":"https://api.github.com/users/PGLongo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PGLongo/subscriptions","organizations_url":"https://api.github.com/users/PGLongo/orgs","repos_url":"https://api.github.com/users/PGLongo/repos","events_url":"https://api.github.com/users/PGLongo/events{/privacy}","received_events_url":"https://api.github.com/users/PGLongo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/michaelarmstrong/SuperRecord/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-23T16:25:16Z","updated_at":"2015-10-23T17:34:41Z","closed_at":null,"body":"I think that we could change NSManagedObject extension using generics. \r\n\r\nFor example:\r\n\r\nNow \r\n```swift\r\nfunc createNewEntity(context:) -> NSManagedObject {}\r\n...\r\nlet pokemon = Pokemon.createNewEntity() as! Pokemon\r\n```\r\n\r\nAfter\r\n```swift\r\nclass func createNewEntity <T> (context:) ->  T {}\r\n...\r\nlet pokemon : Pokemon = Pokemon.createNewEntity()\r\n```\r\n\r\nIn my opinion is more secure because you receive a compile error if the type is not explicit!\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/michaelarmstrong/SuperRecord/issues/comments/150641266","html_url":"https://github.com/michaelarmstrong/SuperRecord/issues/45#issuecomment-150641266","issue_url":"https://api.github.com/repos/michaelarmstrong/SuperRecord/issues/45","id":150641266,"user":{"login":"PGLongo","id":3647884,"avatar_url":"https://avatars.githubusercontent.com/u/3647884?v=3","gravatar_id":"","url":"https://api.github.com/users/PGLongo","html_url":"https://github.com/PGLongo","followers_url":"https://api.github.com/users/PGLongo/followers","following_url":"https://api.github.com/users/PGLongo/following{/other_user}","gists_url":"https://api.github.com/users/PGLongo/gists{/gist_id}","starred_url":"https://api.github.com/users/PGLongo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PGLongo/subscriptions","organizations_url":"https://api.github.com/users/PGLongo/orgs","repos_url":"https://api.github.com/users/PGLongo/repos","events_url":"https://api.github.com/users/PGLongo/events{/privacy}","received_events_url":"https://api.github.com/users/PGLongo/received_events","type":"User","site_admin":false},"created_at":"2015-10-23T17:34:41Z","updated_at":"2015-10-23T17:34:41Z","body":"Obj-c with Xcode 7 has Generics, but I have never tried"}}