UPDATE: It appears to be my custom cell code that is slowing things down, when I used the frameworks UITableViewCell there is no delay when performing the segue.
Here is the custom tableview cell (which draws a background like a chat bubble):
@implementation SGEMessageCell
@synthesize defaultColor;
@synthesize backgroundView;
@synthesize backgroundRect;
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
// controls
self.dateLabel = [[UILabel alloc] initWithFrame:CGRectMake(15, 0, 290, 30)];
self.dateLabel.textColor = [UIColor lightGrayColor];
self.dateLabel.font = [UIFont fontWithName:@".HelveticaNeueInterface-Regular" size:10.0f];
self.descriptionLabel = [[UILabel alloc] initWithFrame:CGRectMake(15, 25, 300, 30)];
self.descriptionLabel.textColor = [UIColor whiteColor];
self.descriptionLabel.font = [UIFont fontWithName:@".HelveticaNeueInterface-Regular" size:14.0f];
backgroundView = [self createBackgroundView:self.defaultColor];
backgroundView.tag = @"backgroundTag";
[self addSubview:backgroundView];
[self addSubview:self.dateLabel];
[self addSubview:self.descriptionLabel];
[self setNeedsDisplay];
}
return self;
}
@end
That is the super class for two others event and action, here's an event:
@implementation SGEEventCell
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self.defaultColor = [UIColor colorWithRed:0.91 green:0.91 blue:0.91 alpha:1];
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
return self;
}
- (UIView *)createBackgroundView:(UIColor *)color
{
CGRect background = CGRectMake(10, 25, self.frame.size.width - 60, 90);
UIView *backgroundView = [[UIView alloc] initWithFrame:background];
backgroundView.backgroundColor = color;
[backgroundView.layer setCornerRadius:7.0f];
[backgroundView.layer setMasksToBounds:YES];
return backgroundView;
}
- (void)updateBackgroundViewColor:(UIColor *)color
{
UIView *bg = [self viewWithTag:@"backgroundTag"];
bg.backgroundColor = color;
}
@end
/UPDATE
I have the following code in my main view controller (a table view)
- (void)tableView:(UITableView *)theTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[self performSegueWithIdentifier:@"eventDetailsSegue" sender:self];
}
Originally it did have code which stored the selected cell's index but I removed it to see if it would fix the glitch/delay when the segue was performed but it still happens. The glitch is that you often have to touch twice on a cell for the segue to perform the first time, and from then on intermittent touches cause delayed segue transitions.
The target view controller was using FXForms but I've removed that as well to try and resolve the glitch so now it's an empty view controller with a ui builder linked dismiss message.
@implementation SGEEventDetailsViewController
- (IBAction)dismiss:(id)sender
{
[self.presentingViewController dismissViewControllerAnimated:YES
completion:NULL];
}
@end
thanks!