Skip to content

New iOS examples and fix dated iOS examples #7678

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
5 tasks
ofTheo opened this issue Sep 25, 2023 · 14 comments
Open
5 tasks

New iOS examples and fix dated iOS examples #7678

ofTheo opened this issue Sep 25, 2023 · 14 comments

Comments

@ofTheo
Copy link
Member

ofTheo commented Sep 25, 2023

Some of the old native UI examples didn't work anymore so they were removed for 0.12.0
It would be great to do an audit of current examples and see what works, what doesn't and what is missing.

Needed:

  • example showing OF running with native UI buttons
  • check video grabber example
  • check sound examples
  • check 3D / Assimp examples and make up to date with macOS ones
  • check for any examples that have non-ARC code ( we have ARC enabled by default now ).
@ofTheo ofTheo mentioned this issue Sep 25, 2023
54 tasks
@artificiel
Copy link
Contributor

artificiel commented Sep 25, 2023

what about simulator support? it would facilitate a refactor of the examples.

in #6966 (comment) @danoli3 says "Designed for iPad works" but on M1 (13.4) I get this error (both with 0.12 and git-master):

[edit to change image // copy-paste mistake sorry -- previously pasted the simulator error]
image

@ofTheo
Copy link
Member Author

ofTheo commented Sep 25, 2023

Oh yes - @artificiel that's a separate known issue. I think will get fixed with @danoli3's changes.
I think currently the only way to use the simulator is launching Xcode in Rosetta mode.

This issue was just for updating the examples.

@artificiel
Copy link
Contributor

ah yes sorry for not being clearer — I meant that having the simulator working would facilite this task, suggesting a form of priority, and reported that the work-around does not seem to be working.

NB I get the same error with a simulator build through rosetta on M1, launched with:

arch -x86_64 /Applications/Xcode.app/Contents/MacOS/Xcode

@danoli3
Copy link
Member

danoli3 commented Oct 16, 2023

Make sure on latest Xcode for Rosetta stuff: it should look like this
Screenshot 2023-10-16 at 6 59 27 pm

@artificiel
Copy link
Contributor

hmmm a bit more digging and I realize starting in x64 gives the "double amount" of entries for simulators... but no mention of rosetta. however trying the "the other one" for a given pair does compile and run!

I don't know if I missed did some extra step but I don't see the same things as you do:

image

@ofTheo
Copy link
Member Author

ofTheo commented Oct 16, 2023

@artificiel Rosetta would just mean x86_64 which you can see at the top in the menu bar, so I think that is what he meant.

image

@artificiel
Copy link
Contributor

@ofTheo yes, I just wanted to state the Xcode GUI behaviour I have is not the same — in @danoli3 's screenshot the entries are marked Rosetta, which makes them clear to choose from. Here my entries are not marked, which makes it a trial-and-error thing to somehow "discover" there are rosetta ones.

so someone trying to use the simulator might not get @danoli3's described behaviour, and I wonder why the behaviour is different. but maybe it's moot as the proper simulator will soon be fixed?

@azuremous
Copy link
Contributor

@artificiel

@ofTheo yes, I just wanted to state the Xcode GUI behaviour I have is not the same — in @danoli3 's screenshot the entries are marked Rosetta, which makes them clear to choose from. Here my entries are not marked, which makes it a trial-and-error thing to somehow "discover" there are rosetta ones.

You can find rosetta from Product > Destination > Destination Architectures > Show Rosetta Destinations

@azuremous
Copy link
Contributor

@ofTheo
I try to update iPhoneGuiExample using storyboard not nib.

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MyGuiView" bundle:nil]; myGuiViewController = [storyboard instantiateViewControllerWithIdentifier:@"MyGuiView"];

Screenshot 2024-01-24 at 17 33 53

@azuremous
Copy link
Contributor

azuremous commented Jan 25, 2024

I'm currently trying to use iOS examples, but some of them are not working.
UIActionSheet does not work in iosOrientationExample.
So, I modified the example and used UIAlertController instead of UIActionSheet. This means we no longer use the UIActionSheet delegate. How about changing the file name? Naturally, we should update the interface name as well.

I will also make modifications to other iOS examples as much as I can.

@ofTheo
Copy link
Member Author

ofTheo commented Jan 25, 2024

Amazing @azuremous !!

I would say all the iOS examples are completely open to being changed / rewritten to be brought up to date.
So definitely do what makes the most sense to you.

Happy if you want to do per example Pull Requests or larger PRs for multiple examples, whatever works best for you.

Thanks so much!
Great to get some energy on this!!

@artificiel
Copy link
Contributor

artificiel commented Mar 1, 2025

status report as of 20250301: most examples works!

low hanging fruit:

unsure:

  • iosNativeARCExample crashes in usage. it's a more complex app; getting it to run correctly is a bit of work. I don't know if it should stay in the broken condition. not sure if relevant as it seems to target the ARC which is now standard.

  • iosExternalDisplayExample: it mostly works (via USB-C HDMI adapter) but the UX is broken mostly due to the rotation ambiguity which is a known problem. I think it should stay because the 2nd output management does work, so depending on use case the demo problems might not be true problems (TLDR: the 2nd screen stuff works; the demo is buggy due to other issues)

also some observations, none dealbreaker but maybe while the project/template or build system is being tweaked:

also: I'm still not able to get something running in the simulator:

Building for 'iOS-simulator', but linking in object file 
(../../../libs/openFrameworksCompiled/lib/ios/openFrameworksiOS.a[2](of3dPrimitives.o)) 
built for 'iOS'

@ofTheo
Copy link
Member Author

ofTheo commented Mar 1, 2025

@artificiel thanks for diving into these.
I think we should either remove or fix the ARC example whichever is easier.

Def would be good to fix the iosExternalDisplayExample that's a handy one! :)

I added most of the issues you mentioned to #7588

@artificiel
Copy link
Contributor

@ofTheo PR #8324 for removal of ARC (any substantial native/modern iOS demo energy should go into a fresh one, ideally swiftUI).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants