Search code examples
objective-ciosxcodecocoadylib

IOS - How to create a modal user/password outside the UIApplication?


I am not sure this can be done at all...

Background: I am constructing an in-house application which means it does not get into appstore so i am not limited by the appstore guidelines.

I have a dylib which loads before the main application. It is a kind of augmenting library for applications. I am using the constructor __attribute__ to load my stuff. In there i would like to put an alertview or any kind of popup which will receive a user/password question. If the password is correct than the user is allowed to continue into the original application.

Since this is in the dylib i do not yet have a UIApplication and i do not want to interfere in the original application or sources.

Suggestions, tips are welcome... Thanks.


Solution

  • This is how i've done very similar thing in my application:

    0) Intercept applicationDidFinishLaunching message, add your own code, run original implementation.

    1) Make opaque fullscrean UIWindow (for example, black).

    2) Set its windowLevel to UIWindowLevelAlert + 1 So it hides every other window in app.

    3) Add fields for user and password to this UIWindow.