Xcode 9/ Swift 4: Prevent UIButton from continuing to be highlighted, when you press it and drag the finger outside of its boundstouchesBegin & touchesMove Xcode Obj C QuestionUIButton events. What's the difference?How can you switch from using one UIButton to another while still holding down finger?Using UIControlEventTouchDragEnter to trigger a button's method… but doesn't work?Triggering a UIButton's method when user drags finger into button's area?Trigger an action on UIButton touch inside dragged outside and then release fingerStop the UIButton being 'active' when finger is dragged outside its boundsUnwanted Invisible detection area around UIButton when HighlightedChanging UIButton borderColor in sync with title when highlightingHighlight continues when touch outside of button in swift
Why does the trade federation become so alarmed upon learning the ambassadors are Jedi Knights?
Are local nested functions possible in elisp?
wavelength of seismic wave with a gaussian source
Can I play a first turn Simic Growth Chamber to have 3 mana available in the second turn?
How to convert 1k to 1000 and 1m to 1000000 in Excel
Back to the nineties!
Should you avoid redundant information after dialogue?
Bob's unnecessary trip to the shops
latinate or other words of foreign origin as opposed to Germanic words
Is purchasing foreign currency before going abroad a losing proposition?
How can I deal with a player trying to insert real-world mythology into my homebrew setting?
Why limit to revolvers?
What is temperature on a quantum level?
Is this floating-point optimization allowed?
Can a continent naturally split into two distant parts within a week?
Help with understanding nuances of extremely popular Kyoto-ben (?) tweet
Why the term 'unified' in "unified mass unit"?
The monorail explodes before I can get on it
What is a printer console?
How many matrices satisfy this equality?
Why is dry soil hydrophobic? Bad gardener paradox
Why did the Japanese attack the Aleutians at the same time as Midway?
If the derivative of a function is square of it then it is constant
Metric version of "footage"?
Xcode 9/ Swift 4: Prevent UIButton from continuing to be highlighted, when you press it and drag the finger outside of its bounds
touchesBegin & touchesMove Xcode Obj C QuestionUIButton events. What's the difference?How can you switch from using one UIButton to another while still holding down finger?Using UIControlEventTouchDragEnter to trigger a button's method… but doesn't work?Triggering a UIButton's method when user drags finger into button's area?Trigger an action on UIButton touch inside dragged outside and then release fingerStop the UIButton being 'active' when finger is dragged outside its boundsUnwanted Invisible detection area around UIButton when HighlightedChanging UIButton borderColor in sync with title when highlightingHighlight continues when touch outside of button in swift
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
When you press a UIButton, if you keep holding it while dragging your finger outside of its bounds, there's a certain distance that you can move you finger until the button's state is not "highlighted" anymore.
Essentially, you can press a button, move your finger outside of it, release it, and the button will still fire, even though your finger wasn't on it when it was released.
Is there any way to prevent this behavior? I want buttons to be "released" as soon as you're outside of them.
swift xcode uibutton swift4 xcode9
add a comment |
When you press a UIButton, if you keep holding it while dragging your finger outside of its bounds, there's a certain distance that you can move you finger until the button's state is not "highlighted" anymore.
Essentially, you can press a button, move your finger outside of it, release it, and the button will still fire, even though your finger wasn't on it when it was released.
Is there any way to prevent this behavior? I want buttons to be "released" as soon as you're outside of them.
swift xcode uibutton swift4 xcode9
What button action have you added to the UIButton ?
– Amit
Mar 26 at 5:44
You can bind Action UIControlEventTouchDragOutside of button and change the behavior whatever you want.
– Vishal Patel
Mar 26 at 5:44
add a comment |
When you press a UIButton, if you keep holding it while dragging your finger outside of its bounds, there's a certain distance that you can move you finger until the button's state is not "highlighted" anymore.
Essentially, you can press a button, move your finger outside of it, release it, and the button will still fire, even though your finger wasn't on it when it was released.
Is there any way to prevent this behavior? I want buttons to be "released" as soon as you're outside of them.
swift xcode uibutton swift4 xcode9
When you press a UIButton, if you keep holding it while dragging your finger outside of its bounds, there's a certain distance that you can move you finger until the button's state is not "highlighted" anymore.
Essentially, you can press a button, move your finger outside of it, release it, and the button will still fire, even though your finger wasn't on it when it was released.
Is there any way to prevent this behavior? I want buttons to be "released" as soon as you're outside of them.
swift xcode uibutton swift4 xcode9
swift xcode uibutton swift4 xcode9
edited Mar 26 at 5:44
Alex K
asked Mar 26 at 5:41
Alex KAlex K
2591 gold badge2 silver badges12 bronze badges
2591 gold badge2 silver badges12 bronze badges
What button action have you added to the UIButton ?
– Amit
Mar 26 at 5:44
You can bind Action UIControlEventTouchDragOutside of button and change the behavior whatever you want.
– Vishal Patel
Mar 26 at 5:44
add a comment |
What button action have you added to the UIButton ?
– Amit
Mar 26 at 5:44
You can bind Action UIControlEventTouchDragOutside of button and change the behavior whatever you want.
– Vishal Patel
Mar 26 at 5:44
What button action have you added to the UIButton ?
– Amit
Mar 26 at 5:44
What button action have you added to the UIButton ?
– Amit
Mar 26 at 5:44
You can bind Action UIControlEventTouchDragOutside of button and change the behavior whatever you want.
– Vishal Patel
Mar 26 at 5:44
You can bind Action UIControlEventTouchDragOutside of button and change the behavior whatever you want.
– Vishal Patel
Mar 26 at 5:44
add a comment |
1 Answer
1
active
oldest
votes
The UIControlEvent
you are looking for is UIControlEventTouchUpInside
- It works when touch is inside of the bound.
For more details check this URL:
https://developer.apple.com/documentation/uikit/uicontrolevents
https://developer.apple.com/documentation/uikit/uicontrolevents/uicontroleventtouchupinside?language=objc
How exactly would I go about disabling this event for all buttons in the application?
– Alex K
Mar 26 at 5:59
By default Control Events are disabled for the buttons. You have to add control event which you need.
– Amit
Mar 26 at 6:07
add a comment |
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%2f55350513%2fxcode-9-swift-4-prevent-uibutton-from-continuing-to-be-highlighted-when-you-p%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The UIControlEvent
you are looking for is UIControlEventTouchUpInside
- It works when touch is inside of the bound.
For more details check this URL:
https://developer.apple.com/documentation/uikit/uicontrolevents
https://developer.apple.com/documentation/uikit/uicontrolevents/uicontroleventtouchupinside?language=objc
How exactly would I go about disabling this event for all buttons in the application?
– Alex K
Mar 26 at 5:59
By default Control Events are disabled for the buttons. You have to add control event which you need.
– Amit
Mar 26 at 6:07
add a comment |
The UIControlEvent
you are looking for is UIControlEventTouchUpInside
- It works when touch is inside of the bound.
For more details check this URL:
https://developer.apple.com/documentation/uikit/uicontrolevents
https://developer.apple.com/documentation/uikit/uicontrolevents/uicontroleventtouchupinside?language=objc
How exactly would I go about disabling this event for all buttons in the application?
– Alex K
Mar 26 at 5:59
By default Control Events are disabled for the buttons. You have to add control event which you need.
– Amit
Mar 26 at 6:07
add a comment |
The UIControlEvent
you are looking for is UIControlEventTouchUpInside
- It works when touch is inside of the bound.
For more details check this URL:
https://developer.apple.com/documentation/uikit/uicontrolevents
https://developer.apple.com/documentation/uikit/uicontrolevents/uicontroleventtouchupinside?language=objc
The UIControlEvent
you are looking for is UIControlEventTouchUpInside
- It works when touch is inside of the bound.
For more details check this URL:
https://developer.apple.com/documentation/uikit/uicontrolevents
https://developer.apple.com/documentation/uikit/uicontrolevents/uicontroleventtouchupinside?language=objc
answered Mar 26 at 5:49
AmitAmit
2,5932 gold badges17 silver badges33 bronze badges
2,5932 gold badges17 silver badges33 bronze badges
How exactly would I go about disabling this event for all buttons in the application?
– Alex K
Mar 26 at 5:59
By default Control Events are disabled for the buttons. You have to add control event which you need.
– Amit
Mar 26 at 6:07
add a comment |
How exactly would I go about disabling this event for all buttons in the application?
– Alex K
Mar 26 at 5:59
By default Control Events are disabled for the buttons. You have to add control event which you need.
– Amit
Mar 26 at 6:07
How exactly would I go about disabling this event for all buttons in the application?
– Alex K
Mar 26 at 5:59
How exactly would I go about disabling this event for all buttons in the application?
– Alex K
Mar 26 at 5:59
By default Control Events are disabled for the buttons. You have to add control event which you need.
– Amit
Mar 26 at 6:07
By default Control Events are disabled for the buttons. You have to add control event which you need.
– Amit
Mar 26 at 6:07
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
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%2f55350513%2fxcode-9-swift-4-prevent-uibutton-from-continuing-to-be-highlighted-when-you-p%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
What button action have you added to the UIButton ?
– Amit
Mar 26 at 5:44
You can bind Action UIControlEventTouchDragOutside of button and change the behavior whatever you want.
– Vishal Patel
Mar 26 at 5:44