Trying to add a UITextField to my JUCE iOS app

I am trying to add a UITextField component to my JUCE app instead of using a JUCE textbox as I want to be able to copy/paste, auto-fill, access my passwords, etc. I know that this is possible because I’ve seen it in other JUCE apps, and that I can use getWindowHandle() to access the native window handle for the component, but I’m not sure how to go from there… Can anyone help me out?

3 Likes

I agree it would be helpful to have a little more guidance on how to include native UIKit element into a JUCE window. There’s lots of guides on plugins but doing mobile / iOS with JUCE is a little less documented. I’ve seen some ADC talks on this but they seems to require a lot of boiler to get this working.

1 Like

Following…
Been wanting to get native IOS stuff in my UI for awhile

1 Like

Have you taken a look at UIViewComponent?

You’ll need to do it in a .mm file (Objective C++) but should be fairly straightforward to create a UITextView, although I’ve not actually done this before, I assume you’ll need some way to get the text to your JUCE app.

1 Like

Look at this thread Displaying an UITableView in a JUCE iOS app?. Attached code from last comment works.

1 Like

Hmm. This looks very useful but I can’t seem to get it to work! You said you got it working? How did you actually implement it in a JUCE component because I can’t call addAndMakeVisible() and IOSPopupMenu::showMenu() doesn’t seem to work either. I don’t know obj-c at all so it’s hard to decipher what’s going on in the mm file :confused:

ios_popup_menu.h (699 Bytes)
ios_popup_menu.mm (11.6 KB)

I edited code bit to get it to compile. There is part with Juce’s conditional imports (#ifdef) which I cannot get to work. But this code still should work. Just use it as normal Juce PopupMenu::showMenu().
It would be nice if Juce had more native views (platform specific) at least for iOS. I don’t really like how scrolling work in ListBox for example. I most likely will try to replace them with UITableViewController in the app I’m working on right now.

Hmm. I’m still getting this error Invalid application of 'sizeof' to an incomplete type 'IOSPopupMenu::Impl', and I can’t see an implementation for Impl anywhere… anyways, I’m not actually looking to implement an IOS popup menu, but rather a native IOS TextField and using this popup menu as an example… so either way this is very helpful :slight_smile:

1 Like