Post

Replies

Boosts

Views

Activity

Comment on Adding MKCircle to the annotations on the map - Problem with setting CLLocationCoordinate2D
Yes, sorry it is: class ViewController: UIViewController, MKMapViewDelegate{ Now, the new struct is correct: struct Szczyt { var name: String var describtion: String var lattitude: CLLocationDegrees var longtitude: CLLocationDegrees var coordinate: CLLocationCoordinate2D { .init(latitude: lattitude, longitude: longtitude) // here Im trying to create var for this property to set it for all objects         }     } }
May ’21
Comment on AVPlayer UIButton - show play or pause image button depending on whether the stream is on or off
Hi @Claude31, I would like to have one button, which change the image from play.png to pause.png, whether the stream is playing or not. Now, as you can find in my code, I have two buttons: play and stop. I just need one button with play and pause image depending on whether stream is playing or not. When the user open the app, the play image on the button should be visible and the button should start an action of playing the stream, than when the stream is playing, user should see pause button to stop the stream etc.
Sep ’21
Comment on JSON parsing from a static JSON file into the label
Wow, I didint expect such a complex answer! Many thanks dor your help and for the quicktype url - it would be useful for the next time. Your solution works fine, but the songs are changing, while on my labels data is still the same. Do you know a solution how to force an update from my api? Is it possible? Data in it is changing when the song is changing, so when the api data is changing. Thank you in advance.
Sep ’21
Comment on JSON parsing from a static JSON file into the label
I think I've got two options: the first one is a workaround to call API every 5 seconds (I dont know if it is good idea) - is it hard to make it? The other option is to create webhook - my application can send POST HTTP request to the given URL of the webhook. POST is exactly the same as this: https://admin.radiopromil.online/api/nowplaying , but than I have still the problem with forcing the app to fetch data from webhook url.
Sep ’21
Comment on JSON parsing from a static JSON file into the label
In case of the album art - am i doing it right?: `                if let artUrl = URL(string: radio.nowPlaying.song.art) {                 //I need to load an image from artUrl                     let imageDatatask = session.dataTask(with: artUrl) { imageData, imageResponse, imageError in                     let albumArt = UIImage(data: imageData!)                     //let albumView = UIImageView(image: albumArt)                     }                     imageDatatask.resume()                     }`
Sep ’21