“Delay Touch Down” Property Seems to be Ignored on IOS <11
I have UITableView in a test project that is created this way:
class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {
@IBOutlet weak var tableView: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
tableView.delegate = self
tableView.dataSource = self
}
// height?
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
//return cellHeightWithoutSeparator + cellSeparatorHeight
//print("YES!")
return 80 // arbitrary
}
// table wants a UITableViewCell for each row
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) as! CustomCell
// customize cell here
return cell
}
// how many rows?
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 50 // arbitrary
}
}
The structure of the table view is:

So, as you can see the cell contains a button.
I want the button (or any clickable view that is a subview of the cell) to respond immediately to the touch-down event and so I unchecked "Delay Touch Down" in the ScrollView property inspector in the storyboard.
It is my understanding that unchecking that box is equivalent to the code:
tableView.delaysContentTouches = false
According to the docs, this method is supposed to work on IOS 2.0+
But setting this property true or false only works as expected on IOS 11 and 12, but on IOS 10 (and presumably earlier), it is as if the box was never unchecked and touches on the button are still delayed.
I understand that it is still possible to make views "clickable" in the cell, and respond immediately to "touch up inside," (because the touch-up event will cancel the delay on the touch-down), but I still want the touch down event to call immediately (on all IOS versions, not just 11+) because:
1) I want the re-order control to respond immediately
2) I want to have visual feedback for touch-down be normal/immediate on views in the cell
I have also consulted this similar, but not the same, question which was written 4 years ago, and I tried applying the answers, but none of those answers seem to apply to whatever the modern day reason for this problem is.
Does anyone know the cause and (preferably Swift) solution to this?
swift xcode uitableview cocoa-touch uiscrollview
add a comment |
I have UITableView in a test project that is created this way:
class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {
@IBOutlet weak var tableView: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
tableView.delegate = self
tableView.dataSource = self
}
// height?
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
//return cellHeightWithoutSeparator + cellSeparatorHeight
//print("YES!")
return 80 // arbitrary
}
// table wants a UITableViewCell for each row
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) as! CustomCell
// customize cell here
return cell
}
// how many rows?
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 50 // arbitrary
}
}
The structure of the table view is:

So, as you can see the cell contains a button.
I want the button (or any clickable view that is a subview of the cell) to respond immediately to the touch-down event and so I unchecked "Delay Touch Down" in the ScrollView property inspector in the storyboard.
It is my understanding that unchecking that box is equivalent to the code:
tableView.delaysContentTouches = false
According to the docs, this method is supposed to work on IOS 2.0+
But setting this property true or false only works as expected on IOS 11 and 12, but on IOS 10 (and presumably earlier), it is as if the box was never unchecked and touches on the button are still delayed.
I understand that it is still possible to make views "clickable" in the cell, and respond immediately to "touch up inside," (because the touch-up event will cancel the delay on the touch-down), but I still want the touch down event to call immediately (on all IOS versions, not just 11+) because:
1) I want the re-order control to respond immediately
2) I want to have visual feedback for touch-down be normal/immediate on views in the cell
I have also consulted this similar, but not the same, question which was written 4 years ago, and I tried applying the answers, but none of those answers seem to apply to whatever the modern day reason for this problem is.
Does anyone know the cause and (preferably Swift) solution to this?
swift xcode uitableview cocoa-touch uiscrollview
It always helps alot to include a demo which has the problem :)
– J. Doe
Dec 26 '18 at 16:27
How exactly are you detecting the button tap? I just used an action on the touch up event and the response is instantaneous on iOS 9.3 and iOS 10, in the simulator.
– m_katsifarakis
Dec 31 '18 at 21:04
Right... When you unpress/lift, the "touch up" cancels the downdelay and still fires... but the down event was still delayed in the first place... compare the button's visual feedback ("down state highlighting" reponse) between <11 and 11+. Thanks though I just learned/clarified this now by re-testing.
– Boober Bunz
Jan 1 at 0:15
add a comment |
I have UITableView in a test project that is created this way:
class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {
@IBOutlet weak var tableView: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
tableView.delegate = self
tableView.dataSource = self
}
// height?
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
//return cellHeightWithoutSeparator + cellSeparatorHeight
//print("YES!")
return 80 // arbitrary
}
// table wants a UITableViewCell for each row
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) as! CustomCell
// customize cell here
return cell
}
// how many rows?
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 50 // arbitrary
}
}
The structure of the table view is:

So, as you can see the cell contains a button.
I want the button (or any clickable view that is a subview of the cell) to respond immediately to the touch-down event and so I unchecked "Delay Touch Down" in the ScrollView property inspector in the storyboard.
It is my understanding that unchecking that box is equivalent to the code:
tableView.delaysContentTouches = false
According to the docs, this method is supposed to work on IOS 2.0+
But setting this property true or false only works as expected on IOS 11 and 12, but on IOS 10 (and presumably earlier), it is as if the box was never unchecked and touches on the button are still delayed.
I understand that it is still possible to make views "clickable" in the cell, and respond immediately to "touch up inside," (because the touch-up event will cancel the delay on the touch-down), but I still want the touch down event to call immediately (on all IOS versions, not just 11+) because:
1) I want the re-order control to respond immediately
2) I want to have visual feedback for touch-down be normal/immediate on views in the cell
I have also consulted this similar, but not the same, question which was written 4 years ago, and I tried applying the answers, but none of those answers seem to apply to whatever the modern day reason for this problem is.
Does anyone know the cause and (preferably Swift) solution to this?
swift xcode uitableview cocoa-touch uiscrollview
I have UITableView in a test project that is created this way:
class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {
@IBOutlet weak var tableView: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
tableView.delegate = self
tableView.dataSource = self
}
// height?
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
//return cellHeightWithoutSeparator + cellSeparatorHeight
//print("YES!")
return 80 // arbitrary
}
// table wants a UITableViewCell for each row
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) as! CustomCell
// customize cell here
return cell
}
// how many rows?
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 50 // arbitrary
}
}
The structure of the table view is:

So, as you can see the cell contains a button.
I want the button (or any clickable view that is a subview of the cell) to respond immediately to the touch-down event and so I unchecked "Delay Touch Down" in the ScrollView property inspector in the storyboard.
It is my understanding that unchecking that box is equivalent to the code:
tableView.delaysContentTouches = false
According to the docs, this method is supposed to work on IOS 2.0+
But setting this property true or false only works as expected on IOS 11 and 12, but on IOS 10 (and presumably earlier), it is as if the box was never unchecked and touches on the button are still delayed.
I understand that it is still possible to make views "clickable" in the cell, and respond immediately to "touch up inside," (because the touch-up event will cancel the delay on the touch-down), but I still want the touch down event to call immediately (on all IOS versions, not just 11+) because:
1) I want the re-order control to respond immediately
2) I want to have visual feedback for touch-down be normal/immediate on views in the cell
I have also consulted this similar, but not the same, question which was written 4 years ago, and I tried applying the answers, but none of those answers seem to apply to whatever the modern day reason for this problem is.
Does anyone know the cause and (preferably Swift) solution to this?
swift xcode uitableview cocoa-touch uiscrollview
swift xcode uitableview cocoa-touch uiscrollview
edited Jan 1 at 0:22
Boober Bunz
asked Dec 22 '18 at 10:15
Boober BunzBoober Bunz
1,329932
1,329932
It always helps alot to include a demo which has the problem :)
– J. Doe
Dec 26 '18 at 16:27
How exactly are you detecting the button tap? I just used an action on the touch up event and the response is instantaneous on iOS 9.3 and iOS 10, in the simulator.
– m_katsifarakis
Dec 31 '18 at 21:04
Right... When you unpress/lift, the "touch up" cancels the downdelay and still fires... but the down event was still delayed in the first place... compare the button's visual feedback ("down state highlighting" reponse) between <11 and 11+. Thanks though I just learned/clarified this now by re-testing.
– Boober Bunz
Jan 1 at 0:15
add a comment |
It always helps alot to include a demo which has the problem :)
– J. Doe
Dec 26 '18 at 16:27
How exactly are you detecting the button tap? I just used an action on the touch up event and the response is instantaneous on iOS 9.3 and iOS 10, in the simulator.
– m_katsifarakis
Dec 31 '18 at 21:04
Right... When you unpress/lift, the "touch up" cancels the downdelay and still fires... but the down event was still delayed in the first place... compare the button's visual feedback ("down state highlighting" reponse) between <11 and 11+. Thanks though I just learned/clarified this now by re-testing.
– Boober Bunz
Jan 1 at 0:15
It always helps alot to include a demo which has the problem :)
– J. Doe
Dec 26 '18 at 16:27
It always helps alot to include a demo which has the problem :)
– J. Doe
Dec 26 '18 at 16:27
How exactly are you detecting the button tap? I just used an action on the touch up event and the response is instantaneous on iOS 9.3 and iOS 10, in the simulator.
– m_katsifarakis
Dec 31 '18 at 21:04
How exactly are you detecting the button tap? I just used an action on the touch up event and the response is instantaneous on iOS 9.3 and iOS 10, in the simulator.
– m_katsifarakis
Dec 31 '18 at 21:04
Right... When you unpress/lift, the "touch up" cancels the downdelay and still fires... but the down event was still delayed in the first place... compare the button's visual feedback ("down state highlighting" reponse) between <11 and 11+. Thanks though I just learned/clarified this now by re-testing.
– Boober Bunz
Jan 1 at 0:15
Right... When you unpress/lift, the "touch up" cancels the downdelay and still fires... but the down event was still delayed in the first place... compare the button's visual feedback ("down state highlighting" reponse) between <11 and 11+. Thanks though I just learned/clarified this now by re-testing.
– Boober Bunz
Jan 1 at 0:15
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53894764%2fdelay-touch-down-property-seems-to-be-ignored-on-ios-11%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53894764%2fdelay-touch-down-property-seems-to-be-ignored-on-ios-11%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
It always helps alot to include a demo which has the problem :)
– J. Doe
Dec 26 '18 at 16:27
How exactly are you detecting the button tap? I just used an action on the touch up event and the response is instantaneous on iOS 9.3 and iOS 10, in the simulator.
– m_katsifarakis
Dec 31 '18 at 21:04
Right... When you unpress/lift, the "touch up" cancels the downdelay and still fires... but the down event was still delayed in the first place... compare the button's visual feedback ("down state highlighting" reponse) between <11 and 11+. Thanks though I just learned/clarified this now by re-testing.
– Boober Bunz
Jan 1 at 0:15