{"action":"created","issue":{"url":"https://api.github.com/repos/xmartlabs/Eureka/issues/810","repository_url":"https://api.github.com/repos/xmartlabs/Eureka","labels_url":"https://api.github.com/repos/xmartlabs/Eureka/issues/810/labels{/name}","comments_url":"https://api.github.com/repos/xmartlabs/Eureka/issues/810/comments","events_url":"https://api.github.com/repos/xmartlabs/Eureka/issues/810/events","html_url":"https://github.com/xmartlabs/Eureka/issues/810","id":192383657,"number":810,"title":"Custom Row fails to update its subviews on updateCell()","user":{"login":"Laptopmini","id":7481777,"avatar_url":"https://avatars.githubusercontent.com/u/7481777?v=3","gravatar_id":"","url":"https://api.github.com/users/Laptopmini","html_url":"https://github.com/Laptopmini","followers_url":"https://api.github.com/users/Laptopmini/followers","following_url":"https://api.github.com/users/Laptopmini/following{/other_user}","gists_url":"https://api.github.com/users/Laptopmini/gists{/gist_id}","starred_url":"https://api.github.com/users/Laptopmini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Laptopmini/subscriptions","organizations_url":"https://api.github.com/users/Laptopmini/orgs","repos_url":"https://api.github.com/users/Laptopmini/repos","events_url":"https://api.github.com/users/Laptopmini/events{/privacy}","received_events_url":"https://api.github.com/users/Laptopmini/received_events","type":"User","site_admin":false},"labels":[{"id":283124064,"url":"https://api.github.com/repos/xmartlabs/Eureka/labels/custom%20row","name":"custom row","color":"5319e7","default":false},{"id":323232860,"url":"https://api.github.com/repos/xmartlabs/Eureka/labels/type:%20awaiting%20response","name":"type: awaiting response","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-11-29T19:58:36Z","updated_at":"2016-12-19T22:55:33Z","closed_at":null,"body":"Eureka: 1.7 (Swift 2 Branch)\r\nXCode: 7.3.1 (Swift 2.2)\r\niOS Target: 9.0\r\n\r\nI have a form which lets you access a Color Picker and I am trying to make a custom row to represent the user's selection when coming back to the form. After multiple attempts using Custom Presenter Rows, without any success, I decided to just use a normal row and its `onCellSelection` method to present the new controller. \r\n\r\nThe Color Picker presented uses the Form as a delegate so that when the User makes a selection, the delegate method in the Form is called and I can update the corresponding row that presented it. \r\n\r\nHere is the code I have for my custom row:\r\n\r\n```swift\r\npublic class ColorPickerEurekaFormCell: Cell<Bool>, CellType {\r\n    \r\n    @IBOutlet var title: UILabel!  // Default Value: \"Color\"\r\n    @IBOutlet var colorIndicator: UIView!\r\n    \r\n    public override func setup() {\r\n        super.setup()\r\n        colorIndicator.backgroundColor = .clearColor()\r\n        colorIndicator.layer.cornerRadius = 10\r\n        colorIndicator.layer.borderWidth = 1\r\n        colorIndicator.layer.borderColor = UIColor.lightGrayColor().CGColor\r\n    }\r\n    \r\n    func changeTitle(title: String) {\r\n        self.title.text = title\r\n        row.updateCell()\r\n    }\r\n    \r\n    func changeColorIndicator(color: UIColor) {\r\n        self.colorIndicator.backgroundColor = color\r\n        row.updateCell()\r\n    }\r\n}\r\n\r\n\r\npublic final class ColorPickerEurekaFormRow: Row<Bool, ColorPickerEurekaFormCell>, RowType {\r\n    required public init(tag: String?) {\r\n        super.init(tag: tag)\r\n        cellProvider = CellProvider<ColorPickerEurekaFormCell>(nibName: \"ColorPickerEurekaFormCell\")\r\n    }\r\n}\r\n```\r\n\r\nAs you can see, the row's layout is defined in a `.xib` with 2 outlets: the title and color indicator (a UIView with rounded corners on the right hand side of the row).\r\n\r\nWhen my delegate method from my Color Picker is called and returns a UIColor, I call `.changeColorIndicator(color)` with it. However I can't get the `colorIndicator` UIView to update its color for the life of me. \r\n\r\nIn `changeColorIndicator()`, if I do:\r\n```swift\r\nself.backgroundColor = .greenColor()\r\nself.row.updateCell()\r\n```\r\nThe background color of the cell changes to green, which means its updating the cell itself fine, but it can't seem to redraw/update the UIView I defined in my `.xib`. I also tried calling `.setNeedsDisplay` on the `colorIndicator`, but nothing changed either.\r\n\r\nDo you guys have any idea how to get the cell to redraw a subview? Or why this subview isn't updating?"},"comment":{"url":"https://api.github.com/repos/xmartlabs/Eureka/issues/comments/268102849","html_url":"https://github.com/xmartlabs/Eureka/issues/810#issuecomment-268102849","issue_url":"https://api.github.com/repos/xmartlabs/Eureka/issues/810","id":268102849,"user":{"login":"Laptopmini","id":7481777,"avatar_url":"https://avatars.githubusercontent.com/u/7481777?v=3","gravatar_id":"","url":"https://api.github.com/users/Laptopmini","html_url":"https://github.com/Laptopmini","followers_url":"https://api.github.com/users/Laptopmini/followers","following_url":"https://api.github.com/users/Laptopmini/following{/other_user}","gists_url":"https://api.github.com/users/Laptopmini/gists{/gist_id}","starred_url":"https://api.github.com/users/Laptopmini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Laptopmini/subscriptions","organizations_url":"https://api.github.com/users/Laptopmini/orgs","repos_url":"https://api.github.com/users/Laptopmini/repos","events_url":"https://api.github.com/users/Laptopmini/events{/privacy}","received_events_url":"https://api.github.com/users/Laptopmini/received_events","type":"User","site_admin":false},"created_at":"2016-12-19T22:55:33Z","updated_at":"2016-12-19T22:55:33Z","body":"@mtnbarreto You can remove the awaiting response tag."}}
{"actor":{"display_login":"Laptopmini"}}