Files
Woka_Native_iOS/WOKA/Home/Controller/ExploreWokaVC.swift
BilalKhanWDI 1d6add0322 - Added DropDown
- Added api for show listing , made data model, updated the dropdown
- Added api for category, made data model
- Made the dynamic height tableview to show all the shows
- On fav add remove , will refresh the mylist screen
- Added default load on hindi
- On category selection change, updating the show list data
- Handled the fav category id as int, string , string seeprated with “,”
- Modifying my list with bookmark id with above
2024-06-19 20:07:47 +05:30

119 lines
4.3 KiB
Swift

//
// ExploreWokaVC.swift
// WOKA
//
// Created by MacBook Pro on 21/05/24.
//
import UIKit
class ExploreWokaVC: UIViewController {
@IBOutlet weak var blurView: UIView!
@IBOutlet weak var extraView: UIView!
@IBOutlet weak var customView: UIView!
@IBOutlet weak var wokaFmBtn: UIButton!
@IBOutlet weak var liveTvBtn: UIButton!
@IBOutlet weak var layerView: UIView!
override func viewDidLoad() {
super.viewDidLoad()
drawBackgroundBlur()
// Do any additional setup after loading the view.
}
override func viewDidLayoutSubviews() {
// customView.drawCustomShape()
}
func drawBackgroundBlur() {
let blurEffect = UIBlurEffect(style: .light)
let blurredView = UIVisualEffectView(effect: blurEffect)
blurredView.frame = self.view.bounds
blurredView.alpha = 0.95
self.extraView.addSubview(blurredView)
let vibrancyEffect = UIVibrancyEffect(blurEffect: blurEffect)
let vibrancyView = UIVisualEffectView(effect: vibrancyEffect)
vibrancyView.translatesAutoresizingMaskIntoConstraints = false
vibrancyView.contentView.addSubview(blurView)
blurredView.contentView.addSubview(vibrancyView)
}
@IBAction func btnTapped(_ sender: UIButton) {
switch sender{
case wokaFmBtn:
self.dismiss(animated: true) {
// let sb = UIStoryboard(name: K.StoryBoard.theme, bundle: nil)
// let vcPush = sb.instantiateViewController(withIdentifier: K.StoryBoardID.Theme.radioVC) as! RadioVC
// vcPush.modalPresentationStyle = .overCurrentContext
// vcPush.modalTransitionStyle = .crossDissolve
// self.present(vcPush, animated: true)
}
case liveTvBtn:
self.dismiss(animated: true)
default:
break
}
}
@IBAction func closeTapped(_ sender: UIButton) {
self.dismiss(animated: true)
}
}
extension UIView{
func drawCustomShape() {
let cornerRadius: CGFloat = 18.0
let shapeOffset = self.frame.size.height * 0.2
let triangleHeight: CGFloat = 20.0 // height of the triangle pointer
let triangleWidth: CGFloat = 40.0 // width of the triangle pointer
// create shape layer
let shapeLayer = CAShapeLayer()
shapeLayer.frame = self.bounds
shapeLayer.lineWidth = 1.0
shapeLayer.fillColor = UIColor.white.cgColor
self.layer.addSublayer(shapeLayer)
// create path
let path = UIBezierPath()
// top left point
path.move(to: CGPoint(x: 0, y: cornerRadius))
// top left corner
path.addQuadCurve(to: CGPoint(x: cornerRadius, y: 0), controlPoint: CGPoint(x: 0, y: 0))
// top right point
path.addLine(to: CGPoint(x: self.frame.size.width - cornerRadius, y: 0))
// top right corner
path.addQuadCurve(to: CGPoint(x: self.frame.size.width, y: cornerRadius), controlPoint: CGPoint(x: self.frame.size.width, y: 0))
// bottom right point before corner
path.addLine(to: CGPoint(x: self.frame.size.width, y: self.frame.size.height - shapeOffset - cornerRadius))
// bottom right corner
path.addQuadCurve(to: CGPoint(x: self.frame.size.width - cornerRadius, y: self.frame.size.height - shapeOffset), controlPoint: CGPoint(x: self.frame.size.width, y: self.frame.size.height - shapeOffset))
// move to bottom center point before the triangle
path.addLine(to: CGPoint(x: self.frame.size.width / 2 + triangleWidth / 2, y: self.frame.size.height - shapeOffset))
// add triangle pointer
path.addLine(to: CGPoint(x: self.frame.size.width / 2, y: self.frame.size.height - shapeOffset + triangleHeight))
path.addLine(to: CGPoint(x: self.frame.size.width / 2 - triangleWidth / 2, y: self.frame.size.height - shapeOffset))
// // bottom left point before corner
// path.addLine(to: CGPoint(x: cornerRadius, y: self.frame.size.height - shapeOffset))
// // bottom left corner
path.addQuadCurve(to: CGPoint(x: 0, y: self.frame.size.height - cornerRadius), controlPoint: CGPoint(x: 0, y: self.frame.size.height))
path.close()
shapeLayer.path = path.cgPath
}
}