3

I have a custom UIView subclass. I'd like to add the disclosure indicator icon to it that is so easy to add to a UITableViewCell. Is there any way to do this?

Edit

I'm hoping to do this without the use of a UIButton and definitely without the use of a UITableViewCell. I understand that modifying my custom UIView to be a custom UIButton would allow me to just set the buttonType property but for my case, this seems less elegant than doing it all within a UIView.

Cameron Askew
  • 1,403
  • 1
  • 12
  • 20
  • `UITableViewCell` has a property accessoryType that you can set to UITableViewCellAccessoryDisclosureIndicator. – bbarnhart Feb 10 '15 at 03:40
  • @bbarnhart Yes as I mentioned in the question I know it is very easy to add to a `UITableViewCell`. However I was hoping to do this all within the context of a UIView if I could. – Cameron Askew Feb 10 '15 at 03:44
  • The `UITableViewCell` disclosure indicator image is not an accessible asset. You should use your own image. – bbarnhart Feb 10 '15 at 03:49
  • @bbarnhart Yes I was thinking of that, was hoping not to have to do that since now I would have to maintain my own image and make sure it looked similar to the default iOS icon image. They really don't expose those images anywhere? – Cameron Askew Feb 10 '15 at 03:51

1 Answers1

0

You could try using a UITapGestureRecognizer on the UIView and add an UIImageView with the disclosure indicator you prefer as a subview.

Hope it helps!

Catalina T.
  • 3,456
  • 19
  • 29