Skip to content
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

Ensure the API can be used in UIKit apps #615

Closed
7 tasks done
defagos opened this issue Oct 23, 2023 · 2 comments · Fixed by #642
Closed
7 tasks done

Ensure the API can be used in UIKit apps #615

defagos opened this issue Oct 23, 2023 · 2 comments · Fixed by #642
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@defagos
Copy link
Member

defagos commented Oct 23, 2023

As a developer integrating Pillarbox in a UIKit-based app I want to be able to add PiP support, as for SwiftUI-based application.

Acceptance criteria

  • An API is available for UIKit integration.
  • A UIKit-based sample app successfully implementing PiP is available.

Tasks

  • Produce UIKit-based sample app.
  • Improve the in-app PiP registration mechanism so that a single method call can be used to setup restoration / cleanup in a view controller (swizzling).
  • Enhance the API to support basic UIKit integration if needed.
  • Enhance the API to support advanced UIKit integration (dismissal / restoration).
  • Provide useful state information for use in UIKit (state publisher? KVO support?).
  • Decide whether the sample project should be part of the Pillarbox project (separate demo).
  • If yes update the CI to archive this project as well.
@defagos defagos converted this from a draft issue Oct 23, 2023
@defagos defagos added this to the PiP milestone Oct 23, 2023
@defagos defagos added the enhancement New feature or request label Oct 23, 2023
@defagos defagos moved this from ✏️ Draft to 📋 Backlog in Pillarbox Oct 23, 2023
@defagos
Copy link
Member Author

defagos commented Nov 20, 2023

According to what has been finally implemented:

  • No need for a specific UIKit life cycle, the API is the same and can be used in a UIKit-based router in the same way.
  • No state information needs to be published, see Hide controls when animating in and out of PiP #626. The recommendation is to use SwiftUI for player design, even if this view is then embedded into a UIKit view or view hierarchy.
  • No need for a dedicated sample project, would be superfluous.

@defagos defagos moved this from 📋 Backlog to 🚧 In Progress in Pillarbox Nov 21, 2023
@defagos
Copy link
Member Author

defagos commented Nov 21, 2023

We reused the UIKit example implemented in #605 and updated it successfully. It works fine with the existing modifuer, thus without the need for a dedicated API. This of course supposes that the player is implemented in SwiftUI, but this is the best way to create a player UI and wrapping into UIKit code is easy with UIHostingController.

For this reason no special UIKit API is required and no dirty tricks like swizzling to be considered. In fact we can hide methods which were initially made public but which are not helpful anymore.

@defagos defagos linked a pull request Nov 21, 2023 that will close this issue
5 tasks
@github-project-automation github-project-automation bot moved this from 🚧 In Progress to ✅ Done in Pillarbox Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants