{"action":"closed","issue":{"url":"https://api.github.com/repos/uchicago-mobi/2016-Winter-Forum/issues/149","repository_url":"https://api.github.com/repos/uchicago-mobi/2016-Winter-Forum","labels_url":"https://api.github.com/repos/uchicago-mobi/2016-Winter-Forum/issues/149/labels{/name}","comments_url":"https://api.github.com/repos/uchicago-mobi/2016-Winter-Forum/issues/149/comments","events_url":"https://api.github.com/repos/uchicago-mobi/2016-Winter-Forum/issues/149/events","html_url":"https://github.com/uchicago-mobi/2016-Winter-Forum/issues/149","id":133398948,"number":149,"title":"init functions","user":{"login":"aaizuss","id":11274851,"avatar_url":"https://avatars.githubusercontent.com/u/11274851?v=3","gravatar_id":"","url":"https://api.github.com/users/aaizuss","html_url":"https://github.com/aaizuss","followers_url":"https://api.github.com/users/aaizuss/followers","following_url":"https://api.github.com/users/aaizuss/following{/other_user}","gists_url":"https://api.github.com/users/aaizuss/gists{/gist_id}","starred_url":"https://api.github.com/users/aaizuss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaizuss/subscriptions","organizations_url":"https://api.github.com/users/aaizuss/orgs","repos_url":"https://api.github.com/users/aaizuss/repos","events_url":"https://api.github.com/users/aaizuss/events{/privacy}","received_events_url":"https://api.github.com/users/aaizuss/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-13T05:15:44Z","updated_at":"2016-02-13T18:30:32Z","closed_at":"2016-02-13T18:30:32Z","body":"I'm confused about when we need initialization functions in the ViewController. I created the custom subclass of UIImageView to use for X's and O's, which has an init method that calls `super.init(image: image)`, enables user interaction, and adds a `UIPanGestureRecognizer`. Xcode forces me to also add `required init?(coder aDecoder: NSCoder) {\r\n        fatalError(\"init(coder:) has not been implemented\")\r\n    }`.\r\n\r\nI want to implement the required init method in my ViewController class, but I don't know what to put in it. Currently, I add my X and O images as subviews to my main view in `viewDidLoad`, and that's also where I fill the array of the UIViews, so I don't know what is left to put in the required init function. If I only call `super.init(coder: aDecoder)`, the app crashes with a fatal error (from the custom UIImageView subclass).\r\n\r\nI looked at the FoodTracker tutorial again to see how it uses initialization functions, but it isn't helping."}}