fethica / FRadioPlayer

A simple radio player framework for iOS, macOS, tvOS.

Home Page:https://fethica.github.io/FRadioPlayer/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use with SwiftUI?

dmnktoe opened this issue · comments

Can somebody tell me if it’s possible to use this library together with SwiftUI?

If yes, I would appreciate a brief example, thanks in advance!

I'm kinda getting stuck, when it comes to things like UIViewControllerRepresentable or to set the player it’s delegate due to the missing override function in a SwiftUI file.

any news?

I was working this week with swiftui and got almost a complete example. Have some stuff to figure it out yet.

would you share it maybe?

Sure, give a couple of hours and I upload to my repo what I have. Still needs work to do and some stuff I need to figure it out, but I think is a good start point.

Awesome, thanks a lot!

This is two screenshots of what I have today (dark and light theme) and the source in a zip file (more fast to share at the moment)

I am figuring out some stuff in SwiftUI yet, so suggestions and fixes are welcome

Maybe @fethica can help us creating a new brach.

Light Theme
https://azrockradio.com/wp-content/uploads/fradio/light.png

Dark Theme
https://azrockradio.com/wp-content/uploads/fradio/dark.png

Source
https://azrockradio.com/wp-content/uploads/fradio/FRadioPlayer-master-SwiftUI.zip

Very cool! I will check the code and add it to a new branch, thanks @urayoanm

Hey @fethica, @jaksatomovi:

I figure it out how to update the album artwork and metadata. Check this example better, I think you are gonna like it more.

It was all about the @ObservableObject and how to pass it around the views.

Check the FRadioPlayer_SwiftUIApp (the substitute of the App and Scene delegate).

The Station and Track model are shared from the main project.

Enjoy!

https://azrockradio.com/wp-content/uploads/fradio/FRadioPlayer-master_SwiftUI_2.zip

Very nice! I'll check the new implementation, thanks again @urayoanm

Your welcome @fethica

Hey @urayoanm, I checked the code, great work! Could you create a PR so we can merge it to the project and you get the credit for your work?
We can improve it more later :) Thanks!

Sure. Will do today. I got other nice changes:)

@fethica the pr id done.
Added forward and back to the controls and AirPlay button

Done! I checked the code everything looks good :) Thanks @urayoanm