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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:41:24+00:00 2026-06-13T01:41:24+00:00

I have 10 different pages built into a slider control in my app, these

  • 0

I have 10 different pages built into a slider control in my app, these pages are setup using storyboards.

The only difference on each page is a different web view to display rich text and a different image as a background are used.

Is it possible for me to have one view controller for all 10 pages and setup some flags in the constructor which would be executed on every page when its loaded to tell it what image and web view to show? If so what would this look like?

Thanks,

Lewis.

  • 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-06-13T01:41:25+00:00Added an answer on June 13, 2026 at 1:41 am

    You can create subclass of UIViewController, for example MyViewController.
    And then replace your .h file with:

    #import <UIKit/UIKit.h>
    
    @interface MyViewController : UIViewController
    
    @property (nonatomic, strong) UIWebView *myWebView;
    @property (nonatomic, strong) UIImageView *myImageView;
    
    - (id)initWithURLString:(NSString *)urlString image:(NSString *)imageName;
    
    @end
    

    And your .m file with:

    #import "MyViewController.h"
    
    @interface MyViewController ()
    
    @end
    
    @implementation MyViewController
    
    @synthesize myWebView = _myWebView;
    @synthesize myImageView = _myImageView;
    
    - (id)initWithURLString:(NSString *)urlString image:(NSString *)imageName
    {
        self = [super init];
    
        if (self) {
            NSURL *url = [NSURL URLWithString:urlString];
            NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url];
    
            _myWebView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 400)];
            [_myWebView loadRequest:urlRequest];
    
            _myImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:imageName]];
            _myImageView.frame = CGRectMake(0, 400, 60, 60);
        }
    
        return self;
    }
    
    @end
    

    And then just create an instances of your UIViewController subclass:

    MyViewController *vCon = [[MyViewController alloc] initWithURLString:someURLString image:imageName];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a head file which I am using for a few different pages.
I'm playing with a GWT/GAE project which will have three different pages, although it
so i have a .js file that 2 different jsp pages call. .js file
Is it possible to have multiple login pages for different folders within an asp.net
Lets say there are two pages with two different html elements which have the
I have the exact same html sitting on two different servers. Both pages call
I am using django-registration and would like to have a different page for failed
I have 2 different group page with 2 look alike classes which using the
I have a application built using Zend Framework. I have decided to go with
In my Web Application, i have a data table(Displayed from DB using PreparedStatement). Each

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.