1

How to create a shortcut on ios home to access a specific viewcontroller on my application using objective c?

kadben
  • 185
  • 2
  • 14
  • so you want to create an alias in the list of all iOS applications that will launch your application and go to a specific view controller within your application? – Michael Dautermann Jun 21 '13 at 15:25
  • Yes, so I have mutliple web application in my ios application, my web application run on a webview. I want to have two possibilities to access a web application: via shortcut with all the ios application or accessing my ios application than access a web application. – kadben Jun 22 '13 at 08:36

2 Answers2

4

You can access your apps with a custom schema, like:

myApp://....

If you register your app to use that schema, every time an app calls that or a webpage starts with that, it will open your app. Then, you can detect that your app was opened like that and open the view you want.

Apple iOS Custom Schemas

But what you can't do is to create an app/webpage on your home screen programatically from your code, that's not allowed. You can save a webpage from safari in your home, and that webpage will open your app, but not from your app.

Antonio MG
  • 20,382
  • 3
  • 43
  • 62
  • Thank you for your response, so I can't create shortcut for the web applications Embedded in my ios application. – kadben Jun 22 '13 at 08:48
-2

Your question is a little confusing, but I can think of an answer for either of the two scenarios you could be asking about:

If you want to know how to easily access certain view controller code in Xcode more easily, start using tabs in your window (command-T) to have multiple views open at once, just like browsing on the web.

However (and this is more likely) if you want to have access to a view controller in an app, you need to put a UIButton on the viewController you're looking at, and either present the new controller modally:

NewViewController *newVC = [[NewViewController alloc] init];
[self presentViewController:newVC animated:YES completion:nil];

Or, if your current view controller is embedded in a Navigation Controller:

NewViewController *newVC = [[NewViewController alloc] init];
[self.navigationController pushViewController:newVC animated:YES];
dokun1
  • 2,120
  • 19
  • 37
  • By the way, you need to put either of those code snippets in the method that gets targeted when a button touch event is registered. – dokun1 Jun 21 '13 at 15:44
  • No, it's not that what i'm searching for, my scenario I have multiple web application Embedded in my ios application running on uiwebview, so I'm searching a way to access a web application from ios home screen insead of accessing my ios application than executing my web application. – kadben Jun 22 '13 at 08:50