iOS - add two-finger gesture on scrollview with scrollViewDidZoom and touchesMovedHelp with touchesMoved when dragging fingersConflicts between UIGestureRecognizer and in iPhoneMove a UIImageView in y axisiPhone: Click view behind transparent UIScrollViewChange UILabel based on UIButton control eventsScrollView with Images - changing tabs on touchesended does not workHow to write sketch app on iOSdrag images only when image is touchedDetect 2 Touch Pan vs 1 Touch Pan on UIScrollView?Switch UITouch management from touchesBegan to UIScrollViewDelegate
extract characters between two commas?
Domain expired, GoDaddy holds it and is asking more money
Synthetic Control Method
Unbreakable Formation vs. Cry of the Carnarium
How would photo IDs work for shapeshifters?
Einstein metrics on spheres
Is it wise to focus on putting odd beats on left when playing double bass drums?
Landlord wants to switch my lease to a "Land contract" to "get back at the city"
What does "enim et" mean?
Mapping arrows in commutative diagrams
COUNT(id) or MAX(id) - which is faster?
Why was the "bread communication" in the arena of Catching Fire left out in the movie?
How to manage monthly salary
Does a dangling wire really electrocute me if I'm standing in water?
Copycat chess is back
Latin words with no plurals in English
How many letters suffice to construct words with no repetition?
Is there a familial term for apples and pears?
Email Account under attack (really) - anything I can do?
Where to refill my bottle in India?
Are white and non-white police officers equally likely to kill black suspects?
What happens when a metallic dragon and a chromatic dragon mate?
Calculate Levenshtein distance between two strings in Python
aging parents with no investments
iOS - add two-finger gesture on scrollview with scrollViewDidZoom and touchesMoved
Help with touchesMoved when dragging fingersConflicts between UIGestureRecognizer and in iPhoneMove a UIImageView in y axisiPhone: Click view behind transparent UIScrollViewChange UILabel based on UIButton control eventsScrollView with Images - changing tabs on touchesended does not workHow to write sketch app on iOSdrag images only when image is touchedDetect 2 Touch Pan vs 1 Touch Pan on UIScrollView?Switch UITouch management from touchesBegan to UIScrollViewDelegate
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I'm working on adding a two-finger gesture to pan on a custom 3D view that is in a UIScrollView. The inner workings isn't made by me and is just calculation of points and how to plot them to the 3D view. My main concern is the scrollViewDidZoom and touchesMoved functions conflicting with the approaches I've tried.
I've tried counting the touches of the touchesMoved function, but it's not very stable.
I've tried adding a UIPanGestureRecognizer but it conflicts with the scrollViewDidZoom. Also, since I'm using a custom one, the minimumNumberOfTouches and maximumNumberOfTouches property is not working as expected.
I want to know how to add a two-finger gesture that won't conflict with the existing gestures in the view.
This is written in Obj-c hence the tag, but answers in Swift are welcomed.
This is an excerpt of the code. It's not revealing much, but basically I want to have better control of the panMode bool.
- (UIView*)viewForZoomingInScrollView:(UIScrollView*)scrollView
return zoomDummyView;
- (void)scrollViewDidZoom:(UIScrollView*)scrollView
if ([scrollView zoomScale] != 3.0f)
//do calculation on zooming
- (void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event
[super touchesBegan:touches withEvent:event];
NSArray* array = [touches allObjects];
//this is what I've tried so far - check count of touches and then use the bool to denote pan mode or not
panMode = array.count > 1 ? true : false
for ( int i = 0; i < [array count]; ++i )
//do point calculation
- (void)touchesMoved:(NSSet*)touches withEvent:(UIEvent*)event
[super touchesMoved:touches withEvent:event];
NSArray* array = [touches allObjects];
for ( int i = 0; i < [array count]; ++i )
//some point calculation
// simulation of mouse control for the 3D view, as you can see panMode is used to indicate movement between tilt and pan.
input.isLeftButtonDown = !panMode; // for tilt mode
input.isRightButtonDown = false;
input.isMiddleButtonDown = panMode; // for pan mode
input.isSideButton1Down = false;
input.isSideButton2Down = false;
//input simulation
ios objective-c
add a comment |
I'm working on adding a two-finger gesture to pan on a custom 3D view that is in a UIScrollView. The inner workings isn't made by me and is just calculation of points and how to plot them to the 3D view. My main concern is the scrollViewDidZoom and touchesMoved functions conflicting with the approaches I've tried.
I've tried counting the touches of the touchesMoved function, but it's not very stable.
I've tried adding a UIPanGestureRecognizer but it conflicts with the scrollViewDidZoom. Also, since I'm using a custom one, the minimumNumberOfTouches and maximumNumberOfTouches property is not working as expected.
I want to know how to add a two-finger gesture that won't conflict with the existing gestures in the view.
This is written in Obj-c hence the tag, but answers in Swift are welcomed.
This is an excerpt of the code. It's not revealing much, but basically I want to have better control of the panMode bool.
- (UIView*)viewForZoomingInScrollView:(UIScrollView*)scrollView
return zoomDummyView;
- (void)scrollViewDidZoom:(UIScrollView*)scrollView
if ([scrollView zoomScale] != 3.0f)
//do calculation on zooming
- (void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event
[super touchesBegan:touches withEvent:event];
NSArray* array = [touches allObjects];
//this is what I've tried so far - check count of touches and then use the bool to denote pan mode or not
panMode = array.count > 1 ? true : false
for ( int i = 0; i < [array count]; ++i )
//do point calculation
- (void)touchesMoved:(NSSet*)touches withEvent:(UIEvent*)event
[super touchesMoved:touches withEvent:event];
NSArray* array = [touches allObjects];
for ( int i = 0; i < [array count]; ++i )
//some point calculation
// simulation of mouse control for the 3D view, as you can see panMode is used to indicate movement between tilt and pan.
input.isLeftButtonDown = !panMode; // for tilt mode
input.isRightButtonDown = false;
input.isMiddleButtonDown = panMode; // for pan mode
input.isSideButton1Down = false;
input.isSideButton2Down = false;
//input simulation
ios objective-c
let's try this - gabrielghe.github.io/swift/2016/03/20/swipable-uitableviewcell
– Nilesh R Patel
Mar 8 at 8:45
Sorry for the broad question. I was asking about scrollViews. This has nothing to do with UITableViewCells or swipes.
– IBG
Mar 8 at 8:59
add a comment |
I'm working on adding a two-finger gesture to pan on a custom 3D view that is in a UIScrollView. The inner workings isn't made by me and is just calculation of points and how to plot them to the 3D view. My main concern is the scrollViewDidZoom and touchesMoved functions conflicting with the approaches I've tried.
I've tried counting the touches of the touchesMoved function, but it's not very stable.
I've tried adding a UIPanGestureRecognizer but it conflicts with the scrollViewDidZoom. Also, since I'm using a custom one, the minimumNumberOfTouches and maximumNumberOfTouches property is not working as expected.
I want to know how to add a two-finger gesture that won't conflict with the existing gestures in the view.
This is written in Obj-c hence the tag, but answers in Swift are welcomed.
This is an excerpt of the code. It's not revealing much, but basically I want to have better control of the panMode bool.
- (UIView*)viewForZoomingInScrollView:(UIScrollView*)scrollView
return zoomDummyView;
- (void)scrollViewDidZoom:(UIScrollView*)scrollView
if ([scrollView zoomScale] != 3.0f)
//do calculation on zooming
- (void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event
[super touchesBegan:touches withEvent:event];
NSArray* array = [touches allObjects];
//this is what I've tried so far - check count of touches and then use the bool to denote pan mode or not
panMode = array.count > 1 ? true : false
for ( int i = 0; i < [array count]; ++i )
//do point calculation
- (void)touchesMoved:(NSSet*)touches withEvent:(UIEvent*)event
[super touchesMoved:touches withEvent:event];
NSArray* array = [touches allObjects];
for ( int i = 0; i < [array count]; ++i )
//some point calculation
// simulation of mouse control for the 3D view, as you can see panMode is used to indicate movement between tilt and pan.
input.isLeftButtonDown = !panMode; // for tilt mode
input.isRightButtonDown = false;
input.isMiddleButtonDown = panMode; // for pan mode
input.isSideButton1Down = false;
input.isSideButton2Down = false;
//input simulation
ios objective-c
I'm working on adding a two-finger gesture to pan on a custom 3D view that is in a UIScrollView. The inner workings isn't made by me and is just calculation of points and how to plot them to the 3D view. My main concern is the scrollViewDidZoom and touchesMoved functions conflicting with the approaches I've tried.
I've tried counting the touches of the touchesMoved function, but it's not very stable.
I've tried adding a UIPanGestureRecognizer but it conflicts with the scrollViewDidZoom. Also, since I'm using a custom one, the minimumNumberOfTouches and maximumNumberOfTouches property is not working as expected.
I want to know how to add a two-finger gesture that won't conflict with the existing gestures in the view.
This is written in Obj-c hence the tag, but answers in Swift are welcomed.
This is an excerpt of the code. It's not revealing much, but basically I want to have better control of the panMode bool.
- (UIView*)viewForZoomingInScrollView:(UIScrollView*)scrollView
return zoomDummyView;
- (void)scrollViewDidZoom:(UIScrollView*)scrollView
if ([scrollView zoomScale] != 3.0f)
//do calculation on zooming
- (void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event
[super touchesBegan:touches withEvent:event];
NSArray* array = [touches allObjects];
//this is what I've tried so far - check count of touches and then use the bool to denote pan mode or not
panMode = array.count > 1 ? true : false
for ( int i = 0; i < [array count]; ++i )
//do point calculation
- (void)touchesMoved:(NSSet*)touches withEvent:(UIEvent*)event
[super touchesMoved:touches withEvent:event];
NSArray* array = [touches allObjects];
for ( int i = 0; i < [array count]; ++i )
//some point calculation
// simulation of mouse control for the 3D view, as you can see panMode is used to indicate movement between tilt and pan.
input.isLeftButtonDown = !panMode; // for tilt mode
input.isRightButtonDown = false;
input.isMiddleButtonDown = panMode; // for pan mode
input.isSideButton1Down = false;
input.isSideButton2Down = false;
//input simulation
ios objective-c
ios objective-c
edited Mar 8 at 8:56
IBG
asked Mar 8 at 6:56
IBGIBG
3551229
3551229
let's try this - gabrielghe.github.io/swift/2016/03/20/swipable-uitableviewcell
– Nilesh R Patel
Mar 8 at 8:45
Sorry for the broad question. I was asking about scrollViews. This has nothing to do with UITableViewCells or swipes.
– IBG
Mar 8 at 8:59
add a comment |
let's try this - gabrielghe.github.io/swift/2016/03/20/swipable-uitableviewcell
– Nilesh R Patel
Mar 8 at 8:45
Sorry for the broad question. I was asking about scrollViews. This has nothing to do with UITableViewCells or swipes.
– IBG
Mar 8 at 8:59
let's try this - gabrielghe.github.io/swift/2016/03/20/swipable-uitableviewcell
– Nilesh R Patel
Mar 8 at 8:45
let's try this - gabrielghe.github.io/swift/2016/03/20/swipable-uitableviewcell
– Nilesh R Patel
Mar 8 at 8:45
Sorry for the broad question. I was asking about scrollViews. This has nothing to do with UITableViewCells or swipes.
– IBG
Mar 8 at 8:59
Sorry for the broad question. I was asking about scrollViews. This has nothing to do with UITableViewCells or swipes.
– IBG
Mar 8 at 8:59
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%2f55058196%2fios-add-two-finger-gesture-on-scrollview-with-scrollviewdidzoom-and-touchesmov%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%2f55058196%2fios-add-two-finger-gesture-on-scrollview-with-scrollviewdidzoom-and-touchesmov%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
let's try this - gabrielghe.github.io/swift/2016/03/20/swipable-uitableviewcell
– Nilesh R Patel
Mar 8 at 8:45
Sorry for the broad question. I was asking about scrollViews. This has nothing to do with UITableViewCells or swipes.
– IBG
Mar 8 at 8:59