ios


UITableView requires double tap - but not first time


I have an UITableView, with cells that you can tap on.
When you tap, some actions are run, but that is not important in this context. First time I press, it handles the tap correctly. Second time it is running the code, but all View updates like showing a UIAlertView or showing a new view is delayed. But not delayed by time - It's waiting for me to touch the screen. No matter where I press or how long I wait, I just have to press. And it's every time but the first.
My TableView is set to single selection and not to show selection on touch. Any Ideas why it does this?
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
if ([cell isKindOfClass:[DetailTableViewCell class]]) {
DetailTableViewCell *detailCell = (DetailTableViewCell *)cell;
NSString *hourString = [detailCell hourString];
if (!detailCell.booking) {
NSDate *rightNow = [NSDate new];
NSDate *cellDate = [self.currentDate dateWithHour:indexPath.row andMinutes:0];
// Only allow future bookings (but allow people people to book within the hour)
if([rightNow compare:[cellDate nextHour]] == NSOrderedAscending){
[self performSegueWithIdentifier:#"roomBooking" sender:indexPath];
return;
} else {
[[[UIAlertView alloc] initWithTitle:#"Error" message:#"We currently do not allow our users make bookings in the past" delegate:nil cancelButtonTitle:#"Gotcha" otherButtonTitles:nil] show];
return;
}
} else if ([detailCell.booking hasPhoneNumber]) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:#"telprompt://%ld",(long)[detailCell.booking telephone]]]];
return;
} else {
//TODO: FIND OUT IF BOOKING IS OWNED BY THE CURRENT USER
[[[UIAlertView alloc] initWithTitle:#"Booking"
message:[NSString stringWithFormat:#"You are now removing the booking at %#.", hourString]
delegate:nil
cancelButtonTitle:#"OK" otherButtonTitles:nil] show];
#weakify(self);
[self.room removeBookingWithId:[detailCell.booking.bookingId integerValue] andCompletion:^(BOOL success, NSError *error) {
#strongify(self);
if (success) {
#weakify(self);
[self.room.location updateBookingsWithCompletion:^(BOOL success, NSError *error) {
#strongify(self);
if (success) {
[self.calendar reloadData];
}
}];
}
}];
return;
}
}
}
SelectionStyle was set to None, but we changed it to something else, which solved the problem.
Click on the TableViewCell itself.
In your properties section locate: "Selection"
Set to: Blue/Grey/Default.

Related Links

How to implement airplay in an iOS app for streaming video on Apple TV
Touch ID Passcode Integration in iOS
how to get today's date less 18 years
iOS Not able to change the frame of UITextField inputAccessoryView.superview
Publishing issue, Callkit is included even we are not using it
How to get crash information from a TestFlight launched app?
Parse: Updating relation on user in Local Datastore
iOS 10, Local notification show when app is in forground?
What is the reason for this UITableView not showing up on my view controller?
Xcode inserted fileprivate functions after updating to Swift 3 [duplicate]
Xamarin ios UItableView Empty rows at top using Task Scheduler in background
How to test iOS app's localization on a real device when using appium?
How to prevent NSInternalInconsistencyException with Realm and UICollectionView
(Swift, EarlGrey) move slider to the middle
How can I make physicBody dynamic only on needed levels?
check if item exists in core data EFFICIENTLY

Categories

HOME
validation
dynamic-programming
ffmpeg
codenameone
azure-search
styling
swashbuckle
xamarin.forms-listview
genetic-algorithm
httpbuilder-ng
regression
range
windows-10-desktop
tcplistener
pie-chart
higher-order-functions
imp
libssh
plc
jmespath
slowcheetah
collision
revitpythonshell
jpos
nested-set-model
csom
robotium
vnc
f2py
svn2git
kubernetes-go-client
stomp
django-users
subtotal
rhel7
nav
spring-data-cassandra
zipline
apartment-gem
texture-mapping
linechart
caldroid
pac
firedac
angular2-seed
sweet.js
free-diameter
msysgit
distributed-lock
recurrence
attributerouting
playback
column-oriented
qtcpserver
waf
jeditorpane
sqlite-net
android-chips
directsound
facebook-audience-network
sqlfiddle
singly-linked-list
4d
target-platform
scrutinizer
vimeo-ios
google-api-ruby-client
js-of-ocaml
thinktecture-ident-server
folder-structure
phone-number
chatjs
express-jwt
srp
qt4.7
preon
parsekit
modx-evolution
bochs
xcache
datapump
xcode4.2
timespan
cocosbuilder
mysql-backup
freeglut
arden-syntax
vim-fugitive
quilt
process.start
exact-synergy-enterprise
datatemplate
sdl.net
blackberry-os-v5
unitils
indextank

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App