- Finalised more module. - Made UI for notifications - Made notification cells - Added pull to refresh - Worked on logic for Favourites. - Getting the logic data, then separating the hindi web series - Added collection for Webseries hindi , English , Audio book, karaoke, games - MAde the data model for favourites
61 lines
1.3 KiB
Swift
61 lines
1.3 KiB
Swift
//
|
|
// RadioVC.swift
|
|
// WOKA
|
|
//
|
|
// Created by MacBook Pro on 13/06/24.
|
|
//
|
|
|
|
import UIKit
|
|
import WebKit
|
|
|
|
class RadioVC: UIViewController {
|
|
|
|
@IBOutlet weak var webView: WKWebView!
|
|
var url = "https://wokastaging.in/api/woka_fm"
|
|
@IBOutlet weak var backView: UIView!
|
|
|
|
deinit {
|
|
unloadWebView()
|
|
}
|
|
|
|
override func viewDidLoad() {
|
|
super.viewDidLoad()
|
|
let radioURL = URL(string: url)!
|
|
let request = URLRequest(url: radioURL)
|
|
webView.load(request)
|
|
|
|
backView.addTapGesture {
|
|
self.dismiss(animated: true) {
|
|
self.unloadWebView()
|
|
}
|
|
}
|
|
}
|
|
|
|
override func viewDidDisappear(_ animated: Bool) {
|
|
webView.stopLoading()
|
|
}
|
|
|
|
@IBAction func closeBtnTapped(_ sender: UIButton) {
|
|
self.dismiss(animated: true) {
|
|
self.unloadWebView()
|
|
}
|
|
}
|
|
|
|
func unloadWebView() {
|
|
// Cancel any ongoing navigation
|
|
webView.stopLoading()
|
|
|
|
// Set delegates to nil
|
|
webView.navigationDelegate = nil
|
|
webView.uiDelegate = nil
|
|
|
|
// Remove from superview
|
|
webView.removeFromSuperview()
|
|
|
|
// Release the web view
|
|
webView = nil
|
|
}
|
|
|
|
|
|
}
|