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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:45:23+00:00 2026-05-22T18:45:23+00:00

I have intercepted URL opening by doing the following: – (BOOL)openURL:(NSURL *)url{ URLViewController *

  • 0

I have intercepted URL opening by doing the following:

- (BOOL)openURL:(NSURL *)url{
    URLViewController * web = [[URLViewController alloc] init];
    web.url = url;
    UINavigationController * nav = [[UINavigationController alloc] initWithRootViewController:web];
    [nav.navigationBar setTintColor:[UIColor blackColor]];
    [nav setModalPresentationStyle:UIModalPresentationFormSheet];
    [self.detailViewController presentModalViewController:nav animated:NO];
    [web release];
    [nav release];
    return YES;
}

I have a UITextView in which detects URL and when clicking on the URL it opens up the link in a ModalViewController. Full detail on what’s going on can be seen here. Now the issue is, what if I want to open a URL in safari, is it still possible?

  • 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-22T18:45:24+00:00Added an answer on May 22, 2026 at 6:45 pm

    You should add an override flag indicating whether you want to exercise control or not.

    @interface MyApplication : UIApplication {
    
    }
    
    -(BOOL)openURL:(NSURL *)url withOverride:(BOOL)override;
    
    @end
    
    @implementation MyApplication
    
    
    -(BOOL)openURL:(NSURL *)url withOverride:(BOOL)override {
        if ( !override ) {
            return [super openURL:url];
        }
    
        if  ([self.delegate openURL:url]) {
            return YES;
        } else {
            return [super openURL:url];
        }
    }
    
    -(BOOL)openURL:(NSURL *)url{
        return [self openURL:url withOverride:YES];
    }
    @end
    

    So now all calls that you want to bypass can be sent like this.

    [[MyApplication sharedApplication] openURL:url withOverride:NO];
    

    Original Answer

    This is what you should do. Put it before the return YES; statement.

    if ( [super canOpenURL:aURL] ) {
        return [super openURL:aURL];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.NET MVC app with the following deployment requirements: The URL structure
I have a web application that uses spring security. It uses <intercept-url ../> elements
I have the following spring security configuration: <security:http> ...... <security:intercept-url pattern=/auth/** access=ROLE_ADMIN/> ......... </security:http>
I have the following definition... <bean id=fsi class=org.springframework.security.intercept.web.FilterSecurityInterceptor> <property name=authenticationManager ref=authenticationManager/> <property name=accessDecisionManager ref=httpRequestAccessDecisionManager/>
I have the following Spring security configuration: <security:http> <security:intercept-url pattern=/** access=ROLE_USER/> <security:intercept-url pattern=/auth/** access=ROLE_ADMIN/>
I have a list of 100 proxies. The URL I am interested in is
I'm interested to know how people handle the following situation. Assume we have a
I have a web.py server that responds to various user requests. One of these
I have a problem applying css to the web pages, using spring security (3.0.7
I currently have a web application that is utilizing Spring Security hosted on a

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.