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 1097591
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:27:25+00:00 2026-05-17T00:27:25+00:00

hope someone can help me on this as been stuck for hours. I am

  • 0

hope someone can help me on this as been stuck for hours.

I am trying to make a kind of picture book.
I have a view which is my container and I add subviews to that by using addsubview.

On the subview, I have swipe gestures etc that I want to trigger off method in the parent view. I worked out how to trigger the delegate but I cant get the delegate to trigger the parent view. I have read over 10 different ways of doing it and none work.

I now very confused about what a super view is to. Just to confuse matters, the delegate has a tabcontroller and the parent view is tab button 1

I tried

[self.view.superview method]
[self.superview method]

On the delegate I tried
self.tabcontroller.parentviewcontroller, selectedview, super view.super

UPDATE :
The subview needs to be independant of the parent view as its a reusable view.
Also I have not set the parentview to superview as I just thought a superview is a view with subviews (please don’t kill me). So maybe I just need to set the parentview to a superview?

  • 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-17T00:27:25+00:00Added an answer on May 17, 2026 at 12:27 am

    The proper way of doing such things is to use protocol and delegate pattern.

    Define a protocol like

    @protocol subViewDelegate
       -(void)somethingHappened:(id)sender;
    @end
    

    then implement that protocol in your superview :

    @interface superView:UIViewController<subViewDelegate> {
    ...
    }
    ...
    @end
    

    define a delegate property in your SubView like this

    @interface subView : UIView {
       id<subViewDelegate> delegate;
       ...
    }
    @propery (nonatomic, assign) id<subViewDelegate> delegate;
    ...
    @end
    

    the in your subview, call the delegate like this

    [self.delegate somethingHappened :self];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to figure this out for days. Hope someone can help.
I hope someone can help... This issue has been discussed here and I have
I have been stuck on this problem for quite awhile... I hope someone out
I hope that someone can help me with this problem that I've been having
Hope someone can help with this. I've been up and down the web and
I hope someone can help with this. I have created a map app that
I have been stuck in this problem for two weeks, I hope someone could
Hi guys I hope someone can help me with this I´m really stuck although
I hope someone can help me. This has been driving me crazy for days.
I hope someone can help me with this Javascript. I have an Object called

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.