After the huge success of the first control I submitted to CocoaControls, MKInfoPanel, I altered it to make it behave like a input panel.


MKEntryPanel shows a semi full screen window similar to the UISearchBarController. You can dismiss it by tapping anywhere else.

Demo

Here is a quick 30 sec demo of the Entry panel in action.

Code

The source code is available at github. Pick it up, clone it or do whatever you want from here.

https://github.com/MugunthKumar/MKEntryPanelDemo

How to use

Using MKEntryPanel is easier tha using an UIAlertView. Similar to the previous MKInfoPanel, You just make one single call and the panel shows and hides itself.


 [MKEntryPanel showPanelWithTitle:NSLocalizedString(@"Enter a text name", @"") 
                              inView:self.view 
                       onTextEntered:^(NSString* enteredString)
     {
         NSLog(@"Entered: %@", enteredString);
     }];

To use this in your own apps, open the project on XCode, drag the MKEntryPanel group into your project. Link your project against QuartzCore.Framework if you haven’t already. You are good to go!


Hope you liked it!


Mugunth

Follow me on Twitter

  • Josh

    Love it!  I modified it slightly to support iPad, take an initial value for the text box, and to allow altering the keyboard type.  Very nice design pattern!

    • Anonymous

      i need to run a function after i have hidden the panel…how can i “wait” until i finish to write before call method? thanks

  • Anonymous

    no landscape?!… :(

  • Yuchen

    I downloaded it from github. But when I tried the demo program, I got an error: 

    error: MugunthKumar-MKInfoPanelDemo-1661c3b/MKInfoBundle/Blue.png: No such file or directory When I took a look, none of the images is included. Do you know where can I find those images? Thank you very much!

    • Yuchen

      oops, this should be on the MkInfoPanel thread, instead of here …

  • Valentin Filip

    Hey. Thank you very much for the component. I was curious, what is the license on this?

    • MugunthKumar

      All my open source components are MIT licensed unless otherwise stated :)