{"action":"closed","issue":{"url":"https://api.github.com/repos/motion-kit/motion-kit/issues/134","repository_url":"https://api.github.com/repos/motion-kit/motion-kit","labels_url":"https://api.github.com/repos/motion-kit/motion-kit/issues/134/labels{/name}","comments_url":"https://api.github.com/repos/motion-kit/motion-kit/issues/134/comments","events_url":"https://api.github.com/repos/motion-kit/motion-kit/issues/134/events","html_url":"https://github.com/motion-kit/motion-kit/issues/134","id":155357719,"number":134,"title":"clarification on remove -- seems not to work?","user":{"login":"dchersey","id":800393,"avatar_url":"https://avatars.githubusercontent.com/u/800393?v=3","gravatar_id":"","url":"https://api.github.com/users/dchersey","html_url":"https://github.com/dchersey","followers_url":"https://api.github.com/users/dchersey/followers","following_url":"https://api.github.com/users/dchersey/following{/other_user}","gists_url":"https://api.github.com/users/dchersey/gists{/gist_id}","starred_url":"https://api.github.com/users/dchersey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dchersey/subscriptions","organizations_url":"https://api.github.com/users/dchersey/orgs","repos_url":"https://api.github.com/users/dchersey/repos","events_url":"https://api.github.com/users/dchersey/events{/privacy}","received_events_url":"https://api.github.com/users/dchersey/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-05-17T20:47:03Z","updated_at":"2016-07-27T14:55:27Z","closed_at":"2016-07-27T14:55:27Z","body":"README.md says \r\n\r\n> When you use the add method to add a subview, that view will be retained by the Layout even if you remove it from the view hierarchy. If you want the Layout to forget all about the view, call remove(view) (which also calls removeFromSuperview) or forget(element_id) (which only removes it from the Layout) on the Layout.\r\n> \r\n\r\nI'm dynamically adding some buttons to a scrollview and tagging them using RMQ (since they will all have the same element_id, being all the same style).\r\n\r\n```ruby\r\n def add_topic_filter filter_name\r\n    context get(:topic_filters) do\r\n      add UIButton, :topic_filter do\r\n        make_filter_label filter_name #this is a styling method that does some graphics stuff\r\n        rmq(target).tag(filter_name.to_sym)\r\n      end\r\n    end\r\n  end\r\n```\r\n\r\nThis works great.  When it comes time to remove the filter though, nothing happens: \r\n\r\n```ruby\r\n  def remove_topic_filter filter_name\r\n      filter = rmq.find(filter_name.to_sym).get\r\n      mp filter  #prints the correct UIButton instance\r\n      remove(filter) #nothing happens\r\n      mp self  #prints the layout, showing that the button is still in the layout\r\n  end\r\n```\r\n\r\nI could hide it, or use rmq to remove it but that doesn't seem right. What's the correct way to remove a view from the layout and the view?\r\n\r\nI also tried this within the context of the scroll view -- that didn't work either. \r\n\r\n\r\n\r\n\r\n"}}
{"actor":{"display_login":"dchersey"}}