Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID
Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.

Touchevent troubleshooting

Esko2300Esko2300 Posts: 501Registered Users
Hi im in yet another dilemma with probably an easy solution but alas i can not find it at this juncture in my life. So I have a view which has a button as a subview. Nice and easy right. Now what is happening is my parent view can be touched for a couple of seconds and then can be moved around. Now when i go to tap the button not only does it call the functionality that button implements but also calls the functionality to move the view on screen. So is there a way i can just skip the parent views functionality when pressing the button?
Post edited by Esko2300 on

Replies

  • Duncan CDuncan C Posts: 8,039Tutorial Authors, Registered Users
    Esko2300;426259 said:
    Hi im in yet another dilemma with probably an easy solution but alas i can not find it at this juncture in my life. So I have a view which has a button as a subview. Nice and easy right. Now what is happening is my parent view can be touched for a couple of seconds and then can be moved around. Now when i go to tap the button not only does it call the functionality that button implements but also calls the functionality to move the view on screen. So is there a way i can just skip the parent views functionality when pressing the button?
    Normally touch events go to the view that is the deepest level into your view hierarchy first, and only get passed to the parent view if the child view doesn't handle them.

    How are you handling touches in your view, and in your button? Are you just putting target/actions on the button? What about the view? Gesture recognizers? Post the code from the parent view, and any custom touch/tap/gesture recognizer code for your button as well.
    Regards,

    Duncan C
    WareTo

    mug

    Animated GIF created with Face Dancer, available for free in the app store.
  • Esko2300Esko2300 Posts: 501Registered Users
    Well i did not create the parent view so i don't know as of yet. I downloaded this code called GMGridView. Its a third party gird display program that has a bunch of functionality i would need to implement in a current project i am doing. So i just downloaded it and started messing around with it as a prototype just to see its limitations. Im going to dissect the code and try and place a wrapper around everything i need and pretty much disregard what i don't. Or I'm going to write my own grid view while using that as a reference. I thought it was just a quick fix but I'm going to have to look more into it i guess. thanks man
  • Esko2300Esko2300 Posts: 501Registered Users
    "How are you handling touches in your view, and in your button? Are you just putting target/actions on the button? What about the view? Gesture recognizers? Post the code from the parent view, and any custom touch/tap/gesture recognizer code for your button as well."

    What i did was create a separate view which had just an image view and three buttons. Each button does a different function but they all will display a UIPopoverController from where the button is. i set up the view to post notifications using NSNotificationCenter when one of the buttons was pressed. And had the view controller as a listener to get the position of the button and display the Popover from there. If you think this is a good/bad idea please advise. But I'm trying to go with the whole MVC system. And this is the way i thought of doing it
Sign In or Register to comment.