CEWendel / SWTableViewCell

An easy-to-use UITableViewCell subclass that implements a swippable content view which exposes utility buttons (similar to iOS 7 Mail Application)
MIT License
7.14k stars 1.27k forks source link

storyboard accessory view is nil #263

Open NeilTaylor opened 9 years ago

NeilTaylor commented 9 years ago

...and, of course unless there is not storyboard segue, neither does accessoryButtonTappedForRowWithIndexPath get called.

workaround: remove storyboard segues for accessory views (Detail Disclosure in my case) and add programmatic support in cellForRowAtIndexPath

// SWTableViewCellStuff setting accessoryView to nil? if (cell.accessoryView == nil) { cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton; cell.accessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];

    // set the action or delegate
    //cell.accessoryAction =
    [(UIButton *)cell.accessoryView addTarget:self action:@selector(accessoryButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
}
skyvalleystudio commented 9 years ago

I'm seeing the same problem. I don't really want to rip out the storyboard segue and reimplement all of that plumbing.

It seems like the accessoryView should be fine as nil since that is required for the accessoryButtonTappedForRowWithIndexPath to be called.

SWTableViewCell is setting the accessory frame, but I don't see where it is interfering with the accessory button tap.