Mixing JUCE GUI with native GUI on iOS - is it possible?


#1

Is it possible to create an application on iOS that uses JUCE GUI for most of the time, but that can also use native controls (such as this graphical keyboard that comes up when you want to enter some characters) “on top” of the JUCE components? I am asking this because I recently submitted a JUCE application for the iPhone to Apple and it was rejected because it didn’t match their GUI guidelines - obviously, because I didn’t use iPhone-like input components etc…


#2

Well, the juce component is just a UIView - you can get its UIView pointer with Component::getWindowHandle.


#3

So, is it possible to add iOS controls (i.e. buttons) to JUCE components? Is there no problem to show up the iOS keyboard and capture its input in JUCE, etc…?
Ofcourse it’s nice to use JUCE, but on iOS it’s very important to retain the standart look and feel. What I actually want to hear is a straight and honest answer if it makes sense to use JUCE on iOS for the GUI or if it is better to use native GUI elements.


#4

Yes, that’s what I meant - the juce comp is just a UIView, so you can do anything with it that you can do with a normal UIView.


#5

Ok, then I have another beginner question (I am not much into iOS): Is it possible to scroll between screens such as in Camera Roll: When you press “Albums” the iPhone smoothly scrolls to the prior screen back again. Can this be done easily?


#6

Yes this is really trivial to do in iOS with the UINavigationController (look for it the iOS dev doc).
You just push a new view controller and it switches to new screen with an animation. It even automatically displays the “back” button in the navigation bar with the name of the previous view and handles the default behaviour (switching back to previous screen in the stack of views).


#7

[quote]zamrate wrote:
I am asking this because I recently submitted a JUCE application for the iPhone to Apple and it was rejected because it didn’t match their GUI guidelines - obviously, because I didn’t use iPhone-like input components etc.[/quote]
This worries me. I see many non-standard applications in the app store. How come yours was rejected?
Could you provide some more details please?


#8

Well, for instance my app didn’t have the normal iOS alert window that shows up when there’s no network, I used a JUCE AlertWindow instead. I also had to “copy” the scroll behaviour that iOS has when you drag the finger over the screen (it keeps scrolling on iOS, I didn’t implement the scrolling). Basically, one has to copy things that are there already.


#9

Hey I’m interested in this thread. Can you all please update me with the status of mixing juce GUI with iOS?

Has anyone written code that they can give out that helps with apple’s interface compliance?


#10

In the latest version (modules branch), there’s a new UIViewComponent class that’ll let you embed any UIView in a juce component.


#11

With regards to the navigation problem you mentioned, you can also use Haydyn’s StackComponent that was talked about in this thread:

http://www.rawmaterialsoftware.com/viewtopic.php?f=2&t=1722&p=40152#p40152

I’ve been using it myself and it works nicely…

I personally don’t like objective C very much. So, I’ve been trying to make my own iOS application look native by simply creating juce based classes that look like their objective C counterparts and by creating my own LookAndFeel class. Maybe, in the post Juce quake world we could set up a repository location for iOS style components that people could contribute to. For example I had to write my own sliding toggle button, but I’m sure this would be useful to others as well. I’m not sure how many people would contribute classes that are as generalized and well documented as the Juce standard components are though. I wonder if Jules had already thought about how to enforce quality control if he’s going to let others contribute to particular modules…


#12

Just a word of caution - you’d better be pixel perfect if you try any copying, an icon that they notice is one pixel off in some way will get you in trouble very easily. Mac people on the whole are very sensitive to fake controls.

I also despise Obj-C, but you may be better off using your own GUI. There’s loads of apps with custom GUIs, it’s probably being ‘nearly’ like an iOS app that causes trouble.

We probably need to work on ways to mix the controls, at least a bit. Juce controls in iOS navigation views, with occasional native controls (ideally linking to juce values, and with juce callbacks) would probably be best.

Bruce


#13

I just sucessfully converted Component::getNativeHandle() to UIView and display it. However, it seems the view under it can't recevice touch event. For example, if I put it in a UIScrollView. If you try to scroll on top of the converted UIView, nothing happened. Any way I can avoid this? I already set ComponentPeer::windowIgnoresKeyPresses and ComponentPeer::windowIgnoresMouseClicks but it doesn't work. Thanks.