Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6154383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:15:14+00:00 2026-05-23T20:15:14+00:00

I have a UIView control (white rectangle in image) Moreover I am able to

  • 0

I have a UIView control (white rectangle in image)

enter image description here

Moreover I am able to drag that control…

enter image description here

And when I press the button I load a subview which is another nib that I created and I placed random controls in it to illustrate my point…

enter image description here

If you guys are interested in finding out how I placed that nib file in that UIView control take a look at this question. I don’t thing you have to read it in order to understand my question.

Anyways the problem when loading that nib file is that I can no longer drag the top UIView. Because of this I changed:

enter image description here

for:

enter image description here

in the UIView of the subview. In otherwords the UIView of the nib file that I am placing in the UIView that has the white background.

and when I did that I was able to drag the control but the controls inside the subview no longer works. I have also tried placing the touchesMoved method in the subview instead but when I do that the application behaves strange. Plus the purpose of placing the nib file in a UIView control was to avoid repeating the same drag funcionality on several nib files.

I actually need to create an application like a power point presentation and I need to change the slide as the user slides the UIView and if it’s cords are less than x for example then I load the next slide (nib file) in that uiview controller. Maybe there is a simpler way of doing what I need but if I get this drag to work I am done cause I would just have to do that functionality just once.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T20:15:15+00:00Added an answer on May 23, 2026 at 8:15 pm

    You should leave the UserInteractionEnabled flag on for your subview if you want it to respond to events.

    One way to achieve this would be to do your dragging using a UIGestureRecognizer.

    UIPanGestureRecognizer is perfect for this (UIGestureRecognizer at apple)

    Basically you’d attach the gesturerecognizer to the view which you want to pan then adjust it’s position in the callbacks it provides.

    UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc]
                                          initWithTarget:self action:@selector(handlePanGesture:)];
    panGesture.minimumNumberOfTouches = 1;
    [draggableSubview addGestureRecognizer:panGesture];
    [panGesture release];
    

    Then in the handlePanGesture method you figure out how far the user panned using the translationInView method of the recognizer which it gets passed and translate the subview accordingly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a UIView control in the nib file that I am working on.
I have a UIViewController subclass to control a UIView that I want to add
I want to rotate a image with UIslider control. I have done that with
I have a UIScrollView to which I append multiple custom UIView's that contain UITextFields...
I have a UIView based control which I need to resize depending on various
I have a UIView that will eventually contain about 2 screens worth of information.
I have a UIView with a UITableView for a subview. The UIView has an
I have a UIView subclass ( CustomView for purposes of this question) that has
I have a UIView that has several UIImageViews as subviews. Each of these subviews
I have a UIView subclass that draws itself when -drawRect: is called. It only

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.