- Added haptics for theme and language change.

- Added haptics for app load
- Added JWplayer Pods.
- Added Av player for home live stream
- Made the Explore Woka Screen.
- Made button Effect for the selection
This commit is contained in:
2024-05-30 19:49:41 +05:30
parent b832b483da
commit 33141797b8
56 changed files with 1120 additions and 105 deletions

View File

@@ -16,6 +16,9 @@ target 'WOKA' do
# Image Loading & Caching
pod 'SDWebImage', '~> 5.19.1'
#JwPlayer
pod 'JWPlayerKit', '>= 4.0.0'
# Bottom line is for removing IPHONEOS_DEPLOYMENT_TARGET
post_install do |installer|
installer.generated_projects.each do |project|

View File

@@ -9,6 +9,7 @@
/* Begin PBXBuildFile section */
5202AAFE2BDF90590043B7BD /* TextFieldImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5202AAFD2BDF90590043B7BD /* TextFieldImage.swift */; };
5202AB012BDFA7900043B7BD /* EmailValidation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5202AB002BDFA7900043B7BD /* EmailValidation.swift */; };
5219C2C22C086D9C00A1DF4D /* DataTypeConversion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5219C2C12C086D9B00A1DF4D /* DataTypeConversion.swift */; };
522242662BFC74380085C632 /* MyListVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 522242632BFC74380085C632 /* MyListVC.swift */; };
522242682BFC74380085C632 /* TabBarVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 522242652BFC74380085C632 /* TabBarVC.swift */; };
5222426A2BFC7AFC0085C632 /* SideMenuVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 522242692BFC7AFC0085C632 /* SideMenuVC.swift */; };
@@ -72,6 +73,7 @@
52A3F6AB2BECBF550000BB0B /* LinkedChildVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52A3F6AA2BECBF550000BB0B /* LinkedChildVC.swift */; };
52A3F6AD2BECC0340000BB0B /* TypeAlias.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52A3F6AC2BECC0340000BB0B /* TypeAlias.swift */; };
52A3F6AF2BECC0690000BB0B /* LinkedChildVM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52A3F6AE2BECC0690000BB0B /* LinkedChildVM.swift */; };
52AECA802C08BCB6004A7579 /* PlayerVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52AECA7F2C08BCB6004A7579 /* PlayerVC.swift */; };
52B8D4D92C04A25E00ED65F3 /* UIViewController+Container.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52B8D4CE2C04A25D00ED65F3 /* UIViewController+Container.swift */; };
52B8D4DA2C04A25E00ED65F3 /* Preferences.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52B8D4CF2C04A25D00ED65F3 /* Preferences.swift */; };
52B8D4DB2C04A25E00ED65F3 /* TransitionContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52B8D4D02C04A25D00ED65F3 /* TransitionContext.swift */; };
@@ -177,6 +179,7 @@
5202AB002BDFA7900043B7BD /* EmailValidation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmailValidation.swift; sourceTree = "<group>"; };
520B6E3E2C0751E90091C478 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Theme.strings; sourceTree = "<group>"; };
520B6E402C0751EF0091C478 /* hi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hi; path = hi.lproj/Theme.strings; sourceTree = "<group>"; };
5219C2C12C086D9B00A1DF4D /* DataTypeConversion.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataTypeConversion.swift; sourceTree = "<group>"; };
522242632BFC74380085C632 /* MyListVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MyListVC.swift; sourceTree = "<group>"; };
522242652BFC74380085C632 /* TabBarVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TabBarVC.swift; sourceTree = "<group>"; };
522242692BFC7AFC0085C632 /* SideMenuVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SideMenuVC.swift; sourceTree = "<group>"; };
@@ -238,6 +241,7 @@
52A3F6AA2BECBF550000BB0B /* LinkedChildVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LinkedChildVC.swift; sourceTree = "<group>"; };
52A3F6AC2BECC0340000BB0B /* TypeAlias.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TypeAlias.swift; sourceTree = "<group>"; };
52A3F6AE2BECC0690000BB0B /* LinkedChildVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LinkedChildVM.swift; sourceTree = "<group>"; };
52AECA7F2C08BCB6004A7579 /* PlayerVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerVC.swift; sourceTree = "<group>"; };
52B8D4CE2C04A25D00ED65F3 /* UIViewController+Container.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIViewController+Container.swift"; sourceTree = "<group>"; };
52B8D4CF2C04A25D00ED65F3 /* Preferences.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Preferences.swift; sourceTree = "<group>"; };
52B8D4D02C04A25D00ED65F3 /* TransitionContext.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TransitionContext.swift; sourceTree = "<group>"; };
@@ -690,6 +694,7 @@
525954592BEB67D200191286 /* DateFormatterLib.swift */,
5259545D2BEBBA1A00191286 /* LoadingIndicatorImageView.swift */,
52A3F6AC2BECC0340000BB0B /* TypeAlias.swift */,
5219C2C12C086D9B00A1DF4D /* DataTypeConversion.swift */,
);
path = Helpers;
sourceTree = "<group>";
@@ -819,6 +824,7 @@
children = (
9CBCB2A92BE51A52007D7934 /* ThemeOneVC.swift */,
9C535DC12C00B36900DA6DCD /* ThemeTwoVC.swift */,
52AECA7F2C08BCB6004A7579 /* PlayerVC.swift */,
);
path = Controller;
sourceTree = "<group>";
@@ -1157,6 +1163,7 @@
522242662BFC74380085C632 /* MyListVC.swift in Sources */,
5259542B2BEA292800191286 /* UserRegPostModel.swift in Sources */,
52C8B0572BDA57DB003B51D0 /* Constant.swift in Sources */,
52AECA802C08BCB6004A7579 /* PlayerVC.swift in Sources */,
5202AB012BDFA7900043B7BD /* EmailValidation.swift in Sources */,
52B8D4E12C04A25E00ED65F3 /* BasicTransitionAnimator.swift in Sources */,
525954192BE8CC3400191286 /* ConstantString.swift in Sources */,
@@ -1206,6 +1213,7 @@
52C6E01E2BE3847F00E22D59 /* BorderView.swift in Sources */,
52FDBA7D2BFF481A009D7AC7 /* ThemeOneVM.swift in Sources */,
52C8B0742BDA7626003B51D0 /* OnBoardVC.swift in Sources */,
5219C2C22C086D9C00A1DF4D /* DataTypeConversion.swift in Sources */,
525953CF2BE8B28F00191286 /* Utilities.swift in Sources */,
9CBCB2A12BE4E50A007D7934 /* TextFieldPassword.swift in Sources */,
9C56E8482BDBEFAB00E4CA14 /* AssetColor.swift in Sources */,
@@ -1370,7 +1378,7 @@
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GCC_C_LANGUAGE_STANDARD = gnu17;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
@@ -1435,7 +1443,7 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GCC_C_LANGUAGE_STANDARD = gnu17;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1530"
LastUpgradeVersion = "1540"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"

View File

@@ -0,0 +1,26 @@
{
"images" : [
{
"filename" : "Group 248.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group 248@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group 248@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "original"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -0,0 +1,26 @@
{
"images" : [
{
"filename" : "image_2024_05_30T09_44_51_663Z.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "image_2024_05_30T09_44_51_663Z@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "image_2024_05_30T09_44_51_663Z@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "original"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -0,0 +1,26 @@
{
"images" : [
{
"filename" : "img_games_exp.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "img_games_exp@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "img_games_exp@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "original"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -0,0 +1,26 @@
{
"images" : [
{
"filename" : "img_karaoke_exp.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "img_karaoke_exp@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "img_karaoke_exp@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "original"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

View File

@@ -0,0 +1,26 @@
{
"images" : [
{
"filename" : "img_live_tv_exp.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "img_live_tv_exp@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "img_live_tv_exp@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "original"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -0,0 +1,26 @@
{
"images" : [
{
"filename" : "img_shop_exp.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "img_shop_exp@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "img_shop_exp@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "original"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -0,0 +1,26 @@
{
"images" : [
{
"filename" : "img_web_series_exp.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "img_web_series_exp@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "img_web_series_exp@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "original"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -0,0 +1,26 @@
{
"images" : [
{
"filename" : "img_woka_fm_exp.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "img_woka_fm_exp@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "img_woka_fm_exp@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "original"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

View File

@@ -101,7 +101,7 @@ class LoginVM{
if user is not logined on other device directly nav him to home
*/
self.vc.toast(msg: data.message ?? K.ConstantString.unRecognised, time: 2) {
self.loginDefaults(data: dataResult)
AuthFunc.shareInstance.loginDefaults(data: dataResult)
}
}
default:
@@ -137,7 +137,7 @@ class LoginVM{
Utilities.dismissProgressHUD()
guard let dataResult = data.data?.result else{return}
self.vc.toast(msg: data.message ?? "Unrecognised error" , time: 2) {
self.loginDefaults(data: dataResult)
AuthFunc.shareInstance.loginDefaults(data: dataResult)
}
default:
break
@@ -149,13 +149,6 @@ class LoginVM{
}
}
private func loginDefaults(data : UserDataDM.ResultData){
AuthFunc.shareInstance.userData = data
UserDefaults.standard.set(true, forKey: K.UserDefaultsStruct.isUserLogined)
UserDefaults.standard.set(data.rememberToken, forKey: K.UserDefaultsStruct.userAccessToken)
UIApplication.setRootView(SideMenuController.instantiate(from: .Home))
}
/*
Guest Login
*/
@@ -170,7 +163,7 @@ class LoginVM{
"Accept-Language" : AuthFunc.shareInstance.languageSelected == .english ? "English" : "Hindi"]
Utilities.startProgressHUD()
NetworkManager.shareInstance.apiRequest(url: APIEndPoints.Auth.guest_login, method: .post ,parameters: params, headers: header) {(result : Result<BaseResponseModel<UserDataDM>, NetworkManager.APIError>) in
NetworkManager.shareInstance.apiRequest(url: APIEndPoints.Auth.guest_login, method: .post ,parameters: params, headers: header) {(result : Result<BaseResponseModel<GuestDataDM>, NetworkManager.APIError>) in
switch result{
case .success(let data):
switch data.success{
@@ -179,8 +172,10 @@ class LoginVM{
self.vc.toast(msg: data.message ?? "Unrecognised error" , time: 2)
case 1:
Utilities.dismissProgressHUD()
guard let dataUser = data.data else{return}
self.vc.toast(msg: data.message ?? "Unrecognised error" , time: 2) {
UIApplication.setRootView(SideMenuController.instantiate(from: .Home))
let userDataConverted = UserDataDM.ResultData(id: nil, username: dataUser.username, fullname: dataUser.fullname, birthdate: nil, email: nil, avtar: nil, userType: "3", languageMasterID: nil, lastLogin: nil, rememberToken: nil, childDetail: nil, language: nil, alreadyLoggedIn: nil)
AuthFunc.shareInstance.loginDefaults(data: userDataConverted)
}
default:
break

View File

@@ -120,7 +120,7 @@ class OnBoardVM{
]
let header : HTTPHeaders = ["device-id" : AuthFunc.shareInstance.getDeviceUUID(),
"Accept-Language" : AuthFunc.shareInstance.languageSelected == .english ? "English" : "Hindi"]
animationView?.pause()
Utilities.startProgressHUD()
NetworkManager.shareInstance.apiRequest(url: APIEndPoints.Auth.guest_login, method: .post ,parameters: params, headers: header) {(result : Result<BaseResponseModel<GuestDataDM>, NetworkManager.APIError>) in
switch result{
@@ -132,9 +132,10 @@ class OnBoardVM{
case 1:
Utilities.dismissProgressHUD()
guard let dataUser = data.data else{return}
AuthFunc.shareInstance.userData = UserDataDM.ResultData(id: nil, username: dataUser.username, fullname: dataUser.fullname, birthdate: nil, email: nil, avtar: nil, userType: "3", languageMasterID: nil, lastLogin: nil, rememberToken: nil, childDetail: nil, language: nil, alreadyLoggedIn: nil)
self.vc.toast(msg: data.message ?? "Unrecognised error" , time: 2) {
UIApplication.setRootView(SideMenuController.instantiate(from: .Home))
let userDataConverted = UserDataDM.ResultData(id: nil, username: dataUser.username, fullname: dataUser.fullname, birthdate: nil, email: nil, avtar: nil, userType: "3", languageMasterID: nil, lastLogin: nil, rememberToken: nil, childDetail: nil, language: nil, alreadyLoggedIn: nil)
AuthFunc.shareInstance.loginDefaults(data: userDataConverted)
}
default:
break

View File

@@ -21,6 +21,7 @@ extension K{
static let isUserLogined = "isUserLogined"
static let userAccessToken = "userAccessToken"
static let defaultLanguage = "defaultLanguage"
static let userType = "userType"
}
}

View File

@@ -0,0 +1,125 @@
//
// DataTypeConversion.swift
// WOKA
//
// Created by MacBook Pro on 30/05/24.
//
import UIKit
// MARK: - Rounding Double
extension Double {
var threeDigits: Double {
return (self * 1000).rounded(.toNearestOrEven) / 1000
}
var twoDigits: Double {
return (self * 100).rounded(.toNearestOrEven) / 100
}
var oneDigit: Double {
return (self * 10).rounded(.toNearestOrEven) / 10
}
}
//MARK: - Int To String
extension Int{
func toString() -> String{
let myString = String(self)
return myString
}
func strFormat(decimal : Int)-> String{
return String(format: "%.\(decimal)f%", self)
}
}
extension Float{
func strFormat(decimal : Int)-> String{
return String(format: "%.\(decimal)f%", self)
}
}
//MARK: - String To Double
extension String {
func toDouble() -> Double? {
return NumberFormatter().number(from: self)?.doubleValue
}
}
//MARK: - Double To String
extension Double {
func toString() -> String {
return String(format: "%.2f",self)
}
func simpleString() -> String {
return String(self)
}
func strFormat(decimal : Int)-> String{
return String(format: "%.\(decimal)f%", self)
}
func rounded(decimalPoint: Int) -> Double {
let power = pow(10, Double(decimalPoint))
return (self * power).rounded() / power
}
}
//MARK: - Double To Int
extension Double {
func toInt() -> Int {
return Int(self)
}
}
//MARK: - String To Int
extension String {
func toInt() -> Int {
return Int(Double(self) ?? 0.0)
}
}
//MARK: - String To Int
extension String {
func toCgFloat() -> CGFloat {
let val = Float(self) ?? 0.0
return CGFloat(val)
}
}
//MARK: - Int To String
extension Int {
func toCgFloat() -> CGFloat {
return CGFloat(self)
}
}
//MARK: - Int To Double
extension Int {
func toDouble() -> Double {
return Double(self)
}
}
//MARK: - filter number from string
extension String {
var numbers: String {
return filter { "0"..."9" ~= $0 }
}
}
extension Double {
func round(to decimalPlaces: Int) -> Double {
let precisionNumber = pow(10,Double(decimalPlaces))
var n = self // self is a current value of the Double that you will round
n = n * precisionNumber
n.round()
n = n / precisionNumber
return n
}
}

View File

@@ -11,6 +11,8 @@ class ExploreWokaVC: UIViewController {
@IBOutlet weak var blurView: UIView!
@IBOutlet weak var extraView: UIView!
@IBOutlet weak var customView: UIView!
@IBOutlet weak var layerView: UIView!
override func viewDidLoad() {
super.viewDidLoad()
@@ -18,6 +20,10 @@ class ExploreWokaVC: UIViewController {
// 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)
@@ -36,3 +42,55 @@ class ExploreWokaVC: UIViewController {
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
}
}

View File

@@ -15,6 +15,9 @@
<array key="Exo2-Medium.ttf">
<string>Exo2-Medium</string>
</array>
<array key="Exo2-SemiBold.ttf">
<string>Exo2-SemiBold</string>
</array>
</customFonts>
<scenes>
<!--Side Menu Controller-->
@@ -532,6 +535,212 @@
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0ic-QF-hpl">
<rect key="frame" x="186" y="437" width="42" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="DNc-fQ-fy8">
<rect key="frame" x="97" y="352" width="220" height="440"/>
<subviews>
<stackView opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="iPr-OV-7V5">
<rect key="frame" x="0.0" y="0.0" width="220" height="440"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="c2y-F6-AqI">
<rect key="frame" x="0.0" y="0.0" width="220" height="55"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="nOR-gr-8Ab">
<rect key="frame" x="10" y="2" width="200" height="51"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="15"/>
<inset key="titleEdgeInsets" minX="40" minY="0.0" maxX="0.0" maxY="0.0"/>
<inset key="imageEdgeInsets" minX="25" minY="0.0" maxX="10" maxY="0.0"/>
<state key="normal" title="WOKA FM" image="WokaFmIcon">
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
</button>
</subviews>
<color key="backgroundColor" red="0.78431372549019607" green="0.70588235294117641" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="nOR-gr-8Ab" firstAttribute="leading" secondItem="c2y-F6-AqI" secondAttribute="leading" constant="10" id="0d1-gu-9JD"/>
<constraint firstItem="nOR-gr-8Ab" firstAttribute="top" secondItem="c2y-F6-AqI" secondAttribute="top" constant="2" id="9de-7W-fKm"/>
<constraint firstAttribute="bottom" secondItem="nOR-gr-8Ab" secondAttribute="bottom" constant="2" id="Btq-ob-Tg6"/>
<constraint firstAttribute="height" constant="55" id="DAq-Y8-V3k"/>
<constraint firstAttribute="trailing" secondItem="nOR-gr-8Ab" secondAttribute="trailing" constant="10" id="Vtt-FU-GZa"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="aOq-F2-okk">
<rect key="frame" x="0.0" y="55" width="220" height="55"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="pfM-e9-xeS">
<rect key="frame" x="10" y="2" width="200" height="51"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="15"/>
<inset key="titleEdgeInsets" minX="40" minY="0.0" maxX="0.0" maxY="0.0"/>
<inset key="imageEdgeInsets" minX="25" minY="0.0" maxX="10" maxY="0.0"/>
<state key="normal" title="LIVE TV" image="LiveTvIcon">
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
</button>
</subviews>
<color key="backgroundColor" red="0.0" green="0.63529411764705879" blue="0.87058823529411766" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="pfM-e9-xeS" secondAttribute="bottom" constant="2" id="Y6l-zl-LZs"/>
<constraint firstItem="pfM-e9-xeS" firstAttribute="top" secondItem="aOq-F2-okk" secondAttribute="top" constant="2" id="hqx-nu-Wya"/>
<constraint firstItem="pfM-e9-xeS" firstAttribute="leading" secondItem="aOq-F2-okk" secondAttribute="leading" constant="10" id="jg1-9k-bKr"/>
<constraint firstAttribute="height" constant="55" id="q4E-5i-tfI"/>
<constraint firstAttribute="trailing" secondItem="pfM-e9-xeS" secondAttribute="trailing" constant="10" id="qSC-Za-YgM"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="yWe-87-bOu">
<rect key="frame" x="0.0" y="110" width="220" height="55"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="31D-NF-WIr">
<rect key="frame" x="10" y="2" width="200" height="51"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="15"/>
<inset key="titleEdgeInsets" minX="40" minY="0.0" maxX="0.0" maxY="0.0"/>
<inset key="imageEdgeInsets" minX="25" minY="0.0" maxX="10" maxY="0.0"/>
<state key="normal" title="WEB SERIES" image="WebSeriesIcon">
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
</button>
</subviews>
<color key="backgroundColor" red="0.36862745098039218" green="0.12156862745098039" blue="0.76862745098039209" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="31D-NF-WIr" secondAttribute="bottom" constant="2" id="4eT-nj-ca1"/>
<constraint firstItem="31D-NF-WIr" firstAttribute="leading" secondItem="yWe-87-bOu" secondAttribute="leading" constant="10" id="DUr-4P-7N1"/>
<constraint firstAttribute="trailing" secondItem="31D-NF-WIr" secondAttribute="trailing" constant="10" id="Gdd-O8-sQw"/>
<constraint firstItem="31D-NF-WIr" firstAttribute="top" secondItem="yWe-87-bOu" secondAttribute="top" constant="2" id="YJb-T1-Ihr"/>
<constraint firstAttribute="height" constant="55" id="vmm-f6-Jyd"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ClJ-4O-Ne4">
<rect key="frame" x="0.0" y="165" width="220" height="55"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="5de-tc-WUV">
<rect key="frame" x="10" y="2" width="200" height="51"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="15"/>
<inset key="titleEdgeInsets" minX="40" minY="0.0" maxX="0.0" maxY="0.0"/>
<inset key="imageEdgeInsets" minX="25" minY="0.0" maxX="10" maxY="0.0"/>
<state key="normal" title="GAMES" image="GamesIcon">
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
</button>
</subviews>
<color key="backgroundColor" red="0.95294117647058818" green="0.52549019607843139" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="5de-tc-WUV" secondAttribute="bottom" constant="2" id="7cy-18-vvS"/>
<constraint firstItem="5de-tc-WUV" firstAttribute="leading" secondItem="ClJ-4O-Ne4" secondAttribute="leading" constant="10" id="CQL-hg-cu4"/>
<constraint firstAttribute="height" constant="55" id="ptl-vj-caT"/>
<constraint firstAttribute="trailing" secondItem="5de-tc-WUV" secondAttribute="trailing" constant="10" id="vCd-nc-hRo"/>
<constraint firstItem="5de-tc-WUV" firstAttribute="top" secondItem="ClJ-4O-Ne4" secondAttribute="top" constant="2" id="xIx-hR-rzH"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="EB0-q2-d6p">
<rect key="frame" x="0.0" y="220" width="220" height="55"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Zxm-AD-QSC">
<rect key="frame" x="10" y="2" width="200" height="51"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="15"/>
<inset key="titleEdgeInsets" minX="40" minY="0.0" maxX="0.0" maxY="0.0"/>
<inset key="imageEdgeInsets" minX="25" minY="0.0" maxX="10" maxY="0.0"/>
<state key="normal" title="AUDIO BOOKS" image="AudioBookIcon">
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
</button>
</subviews>
<color key="backgroundColor" red="0.0" green="0.47843137254901957" blue="0.75294117647058822" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="55" id="Bju-mN-nXR"/>
<constraint firstItem="Zxm-AD-QSC" firstAttribute="top" secondItem="EB0-q2-d6p" secondAttribute="top" constant="2" id="GE7-mW-hev"/>
<constraint firstAttribute="trailing" secondItem="Zxm-AD-QSC" secondAttribute="trailing" constant="10" id="Poi-1j-PbX"/>
<constraint firstItem="Zxm-AD-QSC" firstAttribute="leading" secondItem="EB0-q2-d6p" secondAttribute="leading" constant="10" id="YGw-Of-AnG"/>
<constraint firstAttribute="bottom" secondItem="Zxm-AD-QSC" secondAttribute="bottom" constant="2" id="hps-6c-5XM"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="jjX-jF-HeM">
<rect key="frame" x="0.0" y="275" width="220" height="55"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="rry-dK-R12">
<rect key="frame" x="10" y="2" width="200" height="51"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="15"/>
<inset key="titleEdgeInsets" minX="40" minY="0.0" maxX="0.0" maxY="0.0"/>
<inset key="imageEdgeInsets" minX="25" minY="0.0" maxX="10" maxY="0.0"/>
<state key="normal" title="BLOG" image="BlogsIcon">
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
</button>
</subviews>
<color key="backgroundColor" red="0.0039215686274509803" green="0.60392156862745094" blue="0.29019607843137252" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="rry-dK-R12" firstAttribute="top" secondItem="jjX-jF-HeM" secondAttribute="top" constant="2" id="3o2-9G-Vv4"/>
<constraint firstAttribute="trailing" secondItem="rry-dK-R12" secondAttribute="trailing" constant="10" id="PrB-g3-br9"/>
<constraint firstAttribute="height" constant="55" id="X6c-GK-0JP"/>
<constraint firstAttribute="bottom" secondItem="rry-dK-R12" secondAttribute="bottom" constant="2" id="mpy-JJ-ym2"/>
<constraint firstItem="rry-dK-R12" firstAttribute="leading" secondItem="jjX-jF-HeM" secondAttribute="leading" constant="10" id="nHz-sb-6rf"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="HXv-Ph-s5n">
<rect key="frame" x="0.0" y="330" width="220" height="55"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="cDI-gA-Sfd">
<rect key="frame" x="10" y="2" width="200" height="51"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="15"/>
<inset key="titleEdgeInsets" minX="40" minY="0.0" maxX="0.0" maxY="0.0"/>
<inset key="imageEdgeInsets" minX="25" minY="0.0" maxX="10" maxY="0.0"/>
<state key="normal" title="KARAOKE" image="KaraokeIcon">
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
</button>
</subviews>
<color key="backgroundColor" red="0.80000000000000004" green="0.29019607843137252" blue="0.10980392156862745" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="cDI-gA-Sfd" firstAttribute="leading" secondItem="HXv-Ph-s5n" secondAttribute="leading" constant="10" id="XxX-LE-mIL"/>
<constraint firstAttribute="bottom" secondItem="cDI-gA-Sfd" secondAttribute="bottom" constant="2" id="Zaf-kd-GoG"/>
<constraint firstItem="cDI-gA-Sfd" firstAttribute="top" secondItem="HXv-Ph-s5n" secondAttribute="top" constant="2" id="ggv-XX-fcC"/>
<constraint firstAttribute="height" constant="55" id="k1i-dG-0Rw"/>
<constraint firstAttribute="trailing" secondItem="cDI-gA-Sfd" secondAttribute="trailing" constant="10" id="qHT-Qb-Dbu"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="aug-R4-Sg7">
<rect key="frame" x="0.0" y="385" width="220" height="55"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="HH9-9q-T6X">
<rect key="frame" x="10" y="2" width="200" height="51"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="15"/>
<inset key="titleEdgeInsets" minX="40" minY="0.0" maxX="0.0" maxY="0.0"/>
<inset key="imageEdgeInsets" minX="25" minY="0.0" maxX="10" maxY="0.0"/>
<state key="normal" title="SHOP" image="ShopIcon">
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
</button>
</subviews>
<color key="backgroundColor" red="0.54509803921568623" green="0.67450980392156867" blue="0.17254901960784313" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="HH9-9q-T6X" firstAttribute="leading" secondItem="aug-R4-Sg7" secondAttribute="leading" constant="10" id="SI5-az-lZF"/>
<constraint firstAttribute="height" constant="55" id="cPw-D2-Hx1"/>
<constraint firstAttribute="bottom" secondItem="HH9-9q-T6X" secondAttribute="bottom" constant="2" id="hxM-uh-1bZ"/>
<constraint firstItem="HH9-9q-T6X" firstAttribute="top" secondItem="aug-R4-Sg7" secondAttribute="top" constant="2" id="o2X-co-bqD"/>
<constraint firstAttribute="trailing" secondItem="HH9-9q-T6X" secondAttribute="trailing" constant="10" id="wQS-oN-biG"/>
</constraints>
</view>
</subviews>
</stackView>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="iPr-OV-7V5" firstAttribute="top" secondItem="DNc-fQ-fy8" secondAttribute="top" id="B0u-p9-9q6"/>
<constraint firstAttribute="trailing" secondItem="iPr-OV-7V5" secondAttribute="trailing" id="G9w-cK-uMa"/>
<constraint firstAttribute="bottom" secondItem="iPr-OV-7V5" secondAttribute="bottom" id="Ig9-vq-qt2"/>
<constraint firstAttribute="width" constant="220" id="KZf-jN-jCA"/>
<constraint firstItem="iPr-OV-7V5" firstAttribute="leading" secondItem="DNc-fQ-fy8" secondAttribute="leading" id="sSk-em-jlT"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<integer key="value" value="20"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="P1N-m9-rvT">
<rect key="frame" x="177" y="802" width="60" height="60"/>
<constraints>
@@ -554,7 +763,9 @@
<constraint firstAttribute="bottom" secondItem="bkq-AU-CNT" secondAttribute="bottom" id="6em-C5-wsM"/>
<constraint firstAttribute="bottom" secondItem="lxy-WU-CSd" secondAttribute="bottom" id="DuA-io-xu1"/>
<constraint firstItem="bkq-AU-CNT" firstAttribute="leading" secondItem="D79-Dn-2Pj" secondAttribute="leading" id="OuW-WU-gkg"/>
<constraint firstItem="DNc-fQ-fy8" firstAttribute="centerX" secondItem="D79-Dn-2Pj" secondAttribute="centerX" id="UHE-3N-XqC"/>
<constraint firstItem="lxy-WU-CSd" firstAttribute="leading" secondItem="D79-Dn-2Pj" secondAttribute="leading" id="cxe-Gq-rhA"/>
<constraint firstItem="P1N-m9-rvT" firstAttribute="top" secondItem="DNc-fQ-fy8" secondAttribute="bottom" constant="10" id="kOg-TC-VcQ"/>
<constraint firstItem="P1N-m9-rvT" firstAttribute="centerX" secondItem="D79-Dn-2Pj" secondAttribute="centerX" id="kWw-aG-YDa"/>
<constraint firstItem="P1N-m9-rvT" firstAttribute="height" secondItem="HLg-jy-523" secondAttribute="height" multiplier="0.0669643" id="sh2-E1-RKO"/>
<constraint firstItem="bkq-AU-CNT" firstAttribute="top" secondItem="HLg-jy-523" secondAttribute="top" id="v3g-LP-cO8"/>
@@ -566,6 +777,7 @@
<tabBarItem key="tabBarItem" title="Item" id="waB-zL-0Fo"/>
<connections>
<outlet property="blurView" destination="bkq-AU-CNT" id="0nM-J2-yrv"/>
<outlet property="customView" destination="DNc-fQ-fy8" id="zKU-Vc-wBz"/>
<outlet property="extraView" destination="lxy-WU-CSd" id="ba7-wu-ZGj"/>
</connections>
</viewController>
@@ -682,23 +894,31 @@
</scene>
</scenes>
<resources>
<image name="AudioBookIcon" width="33.5" height="30"/>
<image name="BlogsIcon" width="33" height="33"/>
<image name="CheckMark" width="48" height="48"/>
<image name="CloseIcon" width="61.333332061767578" height="61.333332061767578"/>
<image name="ExploreWoka" width="36.5" height="25"/>
<image name="GamesIcon" width="33.5" height="30"/>
<image name="HeartIcon" width="26.5" height="26.5"/>
<image name="HomeIcon" width="26.5" height="26.5"/>
<image name="KaraokeIcon" width="33.5" height="30"/>
<image name="LiveTvIcon" width="37" height="35"/>
<image name="ShopIcon" width="38" height="39"/>
<image name="SideMenu" width="44" height="44"/>
<image name="Theme1" width="106" height="160"/>
<image name="Theme2" width="106" height="160"/>
<image name="WebSeriesIcon" width="33" height="30"/>
<image name="WokaFmIcon" width="35" height="35"/>
<image name="xmark" catalog="system" width="128" height="113"/>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
<systemColor name="systemCyanColor">
<color red="0.1960784314" green="0.67843137249999996" blue="0.90196078430000004" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.19607843137254902" green="0.67843137254901964" blue="0.90196078431372551" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
<systemColor name="systemGreenColor">
<color red="0.20392156859999999" green="0.78039215689999997" blue="0.34901960780000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.20392156862745098" green="0.7803921568627451" blue="0.34901960784313724" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
</resources>
</document>

View File

@@ -81,29 +81,37 @@ class AuthFunc{
return accessToken ?? ""
}
/*
Get/Set the default language in Userdefaults
*/
func getSetDefaultLanguage(language : LocalizedEnum? ,getSet : GetSet) -> LocalizedEnum?{
switch getSet{
case .get:
let accessToken = UserDefaults.standard.string(forKey: K.UserDefaultsStruct.defaultLanguage)
if accessToken == LocalizedEnum.english.rawValue{
return .english
}else{
return .hindi
}
case .set:
guard let language else{return nil}
AuthFunc.shareInstance.languageSelected = language
UserDefaults.standard.setValue(language.rawValue, forKey: K.UserDefaultsStruct.userAccessToken)
return nil
// MARK: - Get & Set the User Type
func getUserType() -> Int?{
let language = UserDefaults.standard.integer(forKey: K.UserDefaultsStruct.userType)
return language
}
func setUserType(user : Int){
UserDefaults.standard.setValue(user, forKey: K.UserDefaultsStruct.userType)
}
// MARK: - Get & Set the Default Language
func getDefaultLanguage() -> LocalizedEnum?{
let language = UserDefaults.standard.string(forKey: K.UserDefaultsStruct.defaultLanguage)
switch language {
case LocalizedEnum.hindi.rawValue:
return .hindi
case LocalizedEnum.english.rawValue:
return .english
default:
return .english
}
}
/*
This func will remove the selected userdefaults while logout
*/
func setDefaultLanguage(language : LocalizedEnum){
AuthFunc.shareInstance.languageSelected = language
UserDefaults.standard.setValue(language.rawValue, forKey: K.UserDefaultsStruct.defaultLanguage)
}
// MARK: - Login , Logout Defaults
func logout(){
//Reset All to defaults
UserDefaults.standard.setValue(nil, forKey: K.UserDefaultsStruct.themeDefault)
@@ -111,6 +119,14 @@ class AuthFunc{
userData = nil
selectedTheme = .theme1
}
func loginDefaults(data : UserDataDM.ResultData){
AuthFunc.shareInstance.userData = data
UserDefaults.standard.set(true, forKey: K.UserDefaultsStruct.isUserLogined)
UserDefaults.standard.set(data.rememberToken, forKey: K.UserDefaultsStruct.userAccessToken)
UserDefaults.standard.set(data.userType?.toInt(), forKey: K.UserDefaultsStruct.userType)
UIApplication.setRootView(SideMenuController.instantiate(from: .Home))
}
}
// MARK: - Language Enum

View File

@@ -8,6 +8,7 @@
import UIKit
import Lottie
import IQKeyboardManagerSwift
import JWPlayerKit
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
@@ -32,6 +33,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
//Configure and modify the side bar
configureSideBar()
JWPlayerKitLicense.setLicenseKey("Lgok1t7H4PKY+M8FZqmCx54ibUF+NeCTn+xgd+/LVTaRdc+L")
return true
}

View File

@@ -39,8 +39,10 @@ class SplashVM{
vc.activityIndicator.stopAnimating()
// check if user has selected the default language
if let language = AuthFunc.shareInstance.getSetDefaultLanguage(language: nil, getSet: .get){
if let language = AuthFunc.shareInstance.getDefaultLanguage(){
AuthFunc.shareInstance.languageSelected = language
}else{
AuthFunc.shareInstance.setDefaultLanguage(language: .english)
}
}
@@ -55,6 +57,13 @@ class SplashVM{
func getUserData(){
/*
If user is guest then dont do the nw call
*/
if AuthFunc.shareInstance.getUserType() == 3{
UIApplication.setRootView(SideMenuController.instantiate(from: .Home))
return
}
let headers : HTTPHeaders = ["Accept-Language" : AuthFunc.shareInstance.languageSelected == .english ? "English" : "Hindi",
"access-token": AuthFunc.shareInstance.getAccessToken()]
startStopIndicator(start: true)

View File

@@ -72,12 +72,14 @@ class SideMenuVC: UIViewController {
}
@IBAction func languageSwitchSlide(_ sender: CustomizableSegmentControl) {
let generator = UINotificationFeedbackGenerator()
generator.notificationOccurred(.success)
Timer.scheduledTimer(withTimeInterval: 0.2, repeats: false) { _ in
switch sender.selectedSegmentIndex{
case 0: // English
_ = AuthFunc.shareInstance.getSetDefaultLanguage(language: .english, getSet: .set)
AuthFunc.shareInstance.setDefaultLanguage(language: .english)
case 1: // Hindi
_ = AuthFunc.shareInstance.getSetDefaultLanguage(language: .english, getSet: .set)
AuthFunc.shareInstance.setDefaultLanguage(language: .hindi)
default:
break
}

View File

@@ -200,6 +200,8 @@ open class SideMenuController: UIViewController {
configureGesturesRecognizer()
setUpNotifications()
let generator = UINotificationFeedbackGenerator()
generator.notificationOccurred(.error)
}
private func resolveDirection(with view: UIView) {

View File

@@ -12,7 +12,7 @@ class SideMenuVM{
weak var vc : SideMenuVC!
func initView(){
AuthFunc.shareInstance.getSetDefaultLanguage(language: nil, getSet: .get) == .english ? (vc.languageControl.selectedSegmentIndex = 0) : (vc.languageControl.selectedSegmentIndex = 1)
AuthFunc.shareInstance.getDefaultLanguage() == .english ? (vc.languageControl.selectedSegmentIndex = 0) : (vc.languageControl.selectedSegmentIndex = 1)
customizeSegmentControl()
let color1 = #colorLiteral(red: 0.144693464, green: 0.1426281333, blue: 0.6686832905, alpha: 1)
@@ -34,9 +34,16 @@ class SideMenuVM{
vc.theme2.addBorderView(width: 1.5, color: UIColor.white)
vc.theme1.addTapGesture { [weak self] in
guard let self else {return}
if AuthFunc.shareInstance.selectedTheme == .theme1{
return
}
UserDefaults.standard.setValue(ThemeSelect.theme1.rawValue, forKey: K.UserDefaultsStruct.themeDefault)
AuthFunc.shareInstance.selectedTheme = .theme1
guard let self else {return}
let generator = UINotificationFeedbackGenerator()
generator.notificationOccurred(.success)
ViewButtonAnimation.sharedInstance.btnTapped(in: self.vc, view: vc.theme1) {
NotificationCenter.default.post(name: NSNotification.Name(K.NotificationCenterReloads.reloadTheme), object: nil, userInfo: nil)
@@ -45,9 +52,16 @@ class SideMenuVM{
}
vc.theme2.addTapGesture { [weak self] in
guard let self else {return}
if AuthFunc.shareInstance.selectedTheme == .theme2{
return
}
UserDefaults.standard.setValue(ThemeSelect.theme2.rawValue, forKey: K.UserDefaultsStruct.themeDefault)
AuthFunc.shareInstance.selectedTheme = .theme2
guard let self else {return}
let generator = UINotificationFeedbackGenerator()
generator.notificationOccurred(.success)
ViewButtonAnimation.sharedInstance.btnTapped(in: self.vc, view: vc.theme2) {
NotificationCenter.default.post(name: NSNotification.Name(K.NotificationCenterReloads.reloadTheme), object: nil, userInfo: nil)
self.themeSelect()

View File

@@ -82,14 +82,16 @@
<stackView opaque="NO" contentMode="scaleToFill" spacing="3" translatesAutoresizingMaskIntoConstraints="NO" id="Pal-S1-L45">
<rect key="frame" x="35.666666666666664" y="52.666666666666671" width="103.66666666666669" height="24"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Hello" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="YmK-3m-WeD" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Hello" textAlignment="right" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="YmK-3m-WeD" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="50.333333333333336" height="24"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="20"/>
<color key="textColor" red="0.035294117649999998" green="0.0" blue="0.36470588240000001" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="User" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tQN-s8-9SK">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tQN-s8-9SK">
<rect key="frame" x="53.333333333333343" y="0.0" width="50.333333333333343" height="24"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="20"/>
<color key="textColor" red="0.035294117649999998" green="0.0" blue="0.36470588240000001" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
@@ -188,6 +190,7 @@
<rect key="frame" x="0.0" y="0.0" width="40" height="40"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="BZw-eT-gDG"/>
<constraint firstAttribute="width" secondItem="twV-da-k4L" secondAttribute="height" multiplier="1:1" id="VOj-ve-OKI"/>
<constraint firstAttribute="width" secondItem="twV-da-k4L" secondAttribute="height" multiplier="1:1" id="cI0-SX-Tnr"/>
</constraints>
<fontDescription key="fontDescription" name="HelveticaNeue" family="Helvetica Neue" pointSize="15"/>
@@ -199,9 +202,6 @@
</connections>
</button>
</subviews>
<constraints>
<constraint firstItem="twV-da-k4L" firstAttribute="width" secondItem="twV-da-k4L" secondAttribute="height" multiplier="1:1" id="VOj-ve-OKI"/>
</constraints>
</stackView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ppi-HI-rj1" userLabel="IconView">
<rect key="frame" x="0.0" y="395.66666666666674" width="393" height="456.33333333333326"/>
@@ -477,17 +477,17 @@
<rect key="frame" x="60" y="0.0" width="175" height="50"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" spacing="3" translatesAutoresizingMaskIntoConstraints="NO" id="Eb9-At-Mtt">
<rect key="frame" x="0.0" y="0.0" width="103.66666666666667" height="25.666666666666668"/>
<rect key="frame" x="0.0" y="0.0" width="53.333333333333336" height="25.666666666666668"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" text="Hello" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="IFj-XX-sbq" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" text="Hello" lineBreakMode="wordWrap" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="IFj-XX-sbq" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="50.333333333333336" height="25.666666666666668"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="20"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" text="User" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Qn2-Bb-Ud6">
<rect key="frame" x="53.333333333333329" y="0.0" width="50.333333333333329" height="25.666666666666668"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" text="" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Qn2-Bb-Ud6">
<rect key="frame" x="53.333333333333329" y="0.0" width="0.0" height="25.666666666666668"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="20"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
@@ -580,6 +580,21 @@
</objects>
<point key="canvasLocation" x="2881.679389312977" y="-1602.1126760563382"/>
</scene>
<!--PlayerVC-->
<scene sceneID="hKC-gA-FN2">
<objects>
<viewController storyboardIdentifier="PlayerVC" id="gNO-Lg-5q3" customClass="PlayerVC" customModule="WOKA" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Rgf-VB-8Sg">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<viewLayoutGuide key="safeArea" id="2gp-j2-aWC"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="IIL-mJ-o64" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="3677" y="-1602"/>
</scene>
</scenes>
<resources>
<image name="AudioBooks" width="172" height="120"/>
@@ -602,6 +617,9 @@
<image name="SideMenu" width="44" height="44"/>
<image name="Star" width="62.666667938232422" height="62.666667938232422"/>
<image name="WebSeries" width="164" height="118.66666412353516"/>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
<systemColor name="systemGreenColor">
<color red="0.20392156859999999" green="0.78039215689999997" blue="0.34901960780000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>

View File

@@ -0,0 +1,239 @@
//
// PlayerVC.swift
// WOKA
//
// Created by MacBook Pro on 30/05/24.
//
import UIKit
import JWPlayerKit
import AVKit
class PlayerVC: JWPlayerViewController ,JWPlayerViewControllerDelegate{
func playerViewController(_ controller: JWPlayerKit.JWPlayerViewController, relatedItemBeganPlaying item: JWPlayerKit.JWPlayerItem, atIndex index: Int, withMethod method: JWPlayerKit.JWRelatedMethod) {
}
override func jwplayer(_ player: any JWPlayer, didFinishLoadingWithTime loadTime: TimeInterval) {
print("LoadTime " , loadTime)
self.player.play()
}
@IBOutlet weak var innerPlayerView: UIView!
var previousScale: CGFloat = 1.0
let backButton = UIButton(type: .system)
var config : JWPlayerConfiguration!
var dismissTapped : (() -> Void)?
override func viewDidLoad() {
super.viewDidLoad()
self.delegate = self
//
// self.forceFullScreenOnLandscape = true
// self.playerView.videoGravity = .resizeAspectFill
// let skinStylingBuilder = JWPlayerSkinBuilder()
// // Call methods on the builder to create your desired style.
// skinStylingBuilder.backgroundColor(UIColor.blue)
// skinStylingBuilder.fontColor(UIColor.red)
//// self.interfaceBehavior = .hidden
// self.playerView.captionStyle = .none
// // skinStylingBuilder.buttonsColor(UIColor.purple)
//
// let skinStyling = try? skinStylingBuilder.build()
// self.styling = skinStyling
player.configurePlayer(with: config)
// self.playerView.allowsPictureInPicturePlayback = true
// self.player.seek(to: 15)
NotificationCenter.default.addObserver(self, selector: #selector(applicationDidBecomeActive), name: UIApplication.willEnterForegroundNotification, object: nil)
}
@objc func applicationDidBecomeActive() {
self.setDeviceOrientation(orientation: .landscapeRight)
}
// Handle device orientation change
override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
if (size.width > self.view.frame.size.width) {
print("Landscape")
} else {
DispatchQueue.main.async {
self.dismiss(animated: true)
// self.navigationController?.popViewController(animated: true)
}
}
// if (size.width != self.view.frame.size.width) {
// // Reload TableView to update cell's constraints.
// // Ensuring no dequeued cells have old constraints.
// DispatchQueue.main.async {
// }
// }
}
// Action for back button tap
@objc func backButtonTapped() {
// Perform actions when the back button is tapped, such as dismissing the current view controller
setDeviceOrientation(orientation: .portrait)
// or
// dismiss(animated: true, completion: nil)
}
override func viewWillAppear(_ animated: Bool) {
self.navigationController?.isNavigationBarHidden = true
}
override func viewWillDisappear(_ animated: Bool) {
// self.dismissFullScreen(animated: true)
player.stop()
}
override func jwplayer(_ player: JWPlayer, didPauseWithReason reason: JWPauseReason) {
super.jwplayer(player, didPauseWithReason: reason)
// Implement custom behavior
}
// MARK: - JWPlayerDelegate
// Player is ready
override func jwplayerIsReady(_ player: JWPlayer) {
super.jwplayerIsReady(player)
print("IsReady")
}
// Setup error
override func jwplayer(_ player: JWPlayer, failedWithSetupError code: UInt, message: String) {
super.jwplayer(player, failedWithSetupError: code, message: message)
}
// Error
override func jwplayer(_ player: JWPlayer, failedWithError code: UInt, message: String) {
super.jwplayer(player, failedWithError: code, message: message)
}
// Warning
override func jwplayer(_ player: JWPlayer, encounteredWarning code: UInt, message: String) {
super.jwplayer(player, encounteredWarning: code, message: message)
}
// Ad error
override func jwplayer(_ player: JWPlayer, encounteredAdError code: UInt, message: String) {
super.jwplayer(player, encounteredAdError: code, message: message)
}
// Ad warning
override func jwplayer(_ player: JWPlayer, encounteredAdWarning code: UInt, message: String) {
super.jwplayer(player, failedWithSetupError: code, message: message)
}
override func jwplayer(_ player: JWPlayer, isBufferingWithReason reason: JWBufferReason) {
player.play()
print("Reason ", reason)
}
}
// MARK: - Full Screen
extension PlayerVC{
func playerViewControllerWillGoFullScreen(_ controller: JWPlayerViewController) -> JWFullScreenViewController? {
// controller.shouldEnterFullScreen = false
controller.dismiss(animated: false) {
self.setDeviceOrientation(orientation: .portrait)
}
return nil
}
func playerViewControllerDidGoFullScreen(_ controller: JWPlayerViewController) {
return
}
func playerViewControllerWillDismissFullScreen(_ controller: JWPlayerViewController) {
controller.dismiss(animated: false) {
self.setDeviceOrientation(orientation: .portrait)
self.dismissTapped?()
}
}
func playerViewControllerDidDismissFullScreen(_ controller: JWPlayerViewController) {
self.dismissFullScreen(animated: true) {
self.navigationController?.popViewController(animated: true)
}
}
}
// MARK: - JWPlayerViewController Delegate Funcs
extension PlayerVC{
func playerViewController(_ controller: JWPlayerKit.JWPlayerViewController, controlBarVisibilityChanged isVisible: Bool, frame: CGRect) {
// print("CC visible",isVisible)
isVisible ? (backButton.isHidden = false) : (backButton.isHidden = true)
}
func playerViewController(_ controller: JWPlayerKit.JWPlayerViewController, sizeChangedFrom oldSize: CGSize, to newSize: CGSize) {
}
func playerViewController(_ controller: JWPlayerKit.JWPlayerViewController, screenTappedAt position: CGPoint) {
}
func playerViewController(_ controller: JWPlayerKit.JWPlayerViewController, relatedMenuOpenedWithItems items: [JWPlayerKit.JWPlayerItem], withMethod method: JWPlayerKit.JWRelatedInteraction) {
print("Item ",items)
}
// func playerViewController(_ controller: JWPlayerKit.JWPlayerViewController, relatedItemBeganPlaying item: JWPlayerKit.JWPlayerItem, atIndex index: Int, withMethod method: JWPlayerKit.JWRelatedMethod) {
//
// }
func playerViewController(_ controller: JWPlayerViewController, relatedMenuClosedWithMethod method: JWRelatedInteraction){
print("Close")
}
}
extension UIViewController {
func setDeviceOrientation(orientation: UIInterfaceOrientationMask) {
if #available(iOS 16.0, *) {
let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene
windowScene?.requestGeometryUpdate(.iOS(interfaceOrientations: orientation))
} else {
UIDevice.current.setValue(orientation.toUIInterfaceOrientation.rawValue, forKey: "orientation")
}
}
}
extension UIInterfaceOrientationMask {
var toUIInterfaceOrientation: UIInterfaceOrientation {
switch self {
case .portrait:
return UIInterfaceOrientation.portrait
case .portraitUpsideDown:
return UIInterfaceOrientation.portraitUpsideDown
case .landscapeRight:
return UIInterfaceOrientation.landscapeRight
case .landscapeLeft:
return UIInterfaceOrientation.landscapeLeft
default:
return UIInterfaceOrientation.unknown
}
}
}

View File

@@ -44,7 +44,6 @@ class ThemeOneVC: UIViewController {
super.viewDidLoad()
vm.vc = self
vm.initView()
}
// Define a function to customize tab bar item icon size

View File

@@ -31,6 +31,10 @@ class ThemeTwoVC: UIViewController {
}
}
override func viewDidLayoutSubviews() {
vm.setData()
}
@IBAction func sideBarBtnTapped(_ sender: UIButton) {
self.sideMenuController?.revealMenu()
}

View File

@@ -11,16 +11,25 @@ class HomeExploreCell: UICollectionViewCell {
@IBOutlet weak var cellBtn: UIImageView!
@IBOutlet weak var cellLabel: LocalisedElementsLabel!
@IBOutlet weak var mainView: UIView!
override func awakeFromNib() {
super.awakeFromNib()
self.addTapGesture {
self.addTapGesture { [weak self] in
guard let self else{return}
btnTap()
}
}
func btnTap(){
UIView.animate(withDuration: 0.1, animations: {
self.mainView.transform = CGAffineTransform(scaleX: 0.9, y: 0.9)
}) { _ in
UIView.animate(withDuration: 0.1) {
self.mainView.transform = .identity
}
}
}
func setData(data : Theme2Struct){

View File

@@ -61,6 +61,7 @@
<connections>
<outlet property="cellBtn" destination="SFy-o2-AXG" id="nEY-rV-xHM"/>
<outlet property="cellLabel" destination="arf-zP-3pw" id="oGY-wx-NJa"/>
<outlet property="mainView" destination="88P-F5-D0L" id="KrN-WN-yHJ"/>
</connections>
<point key="canvasLocation" x="199.23664122137404" y="22.183098591549296"/>
</collectionViewCell>

View File

@@ -6,19 +6,24 @@
//
import UIKit
import AVFoundation
import JWPlayerKit
class ThemeOneVM{
weak var vc : ThemeOneVC!
var cloudMovingRight = false // Flag to track the direction of movement
var isMovingRight = false // Flag to track the direction of movement
var liveStreamURL = "https://d3volyx7jx7oal.cloudfront.net/master.m3u8"
var avPlayer : AVPlayer!
var playerLayer: AVPlayerLayer!
func initView(){
AuthFunc.shareInstance.initTimePeriods()
startInitialTimer()
moveCloudView()
moveLiveTVView()
moveCloudView()
addTapGestureToMovingView()
handleTaps()
@@ -28,6 +33,62 @@ class ThemeOneVM{
NotificationCenter.default.addObserver(self, selector: #selector(self.reloadTheme), name: NSNotification.Name(rawValue: K.NotificationCenterReloads.reloadTheme), object: nil)
setData()
setupAvPlayer()
avPlayer.play()
avPlayer.isMuted = true
// do{
// let item = try JWPlayerItemBuilder()
// .file(URL(string:self.liveStreamURL)!)
// .title("Testing Title")
// .posterImage(URL(string: "https://img.freepik.com/free-photo/painting-mountain-lake-with-mountain-background_188544-9126.jpg")!)
// // .mediaTracks([thumbnailTrack])
// .build()
//
// // Create a config, and give it the item as a playlist.
// let config = try JWPlayerConfigurationBuilder()
// .playlist(items: [item])
// .autostart(true)
// .preload(.auto)
//// .repeatContent(true)
// .build()
// // Initialize the JWPlayer controller
// player.player.configurePlayer(with: config)
// player.interfaceBehavior = .hidden
// // Add the player's view to the container view
// player.view.translatesAutoresizingMaskIntoConstraints = false
// vc.liveTvPlayer.addSubview(player.view)
//
// // Add constraints to make the player fill the container view
// NSLayoutConstraint.activate([
// player.view.leadingAnchor.constraint(equalTo: vc.liveTvPlayer.leadingAnchor),
// player.view.trailingAnchor.constraint(equalTo: vc.liveTvPlayer.trailingAnchor),
// player.view.topAnchor.constraint(equalTo: vc.liveTvPlayer.topAnchor),
// player.view.bottomAnchor.constraint(equalTo: vc.liveTvPlayer.bottomAnchor)
// ])
//
// player.player.play()
// }catch{
//
// }
}
private func setupAvPlayer(){
/*
Av Player Setup
*/
let streamURL = URL(string: liveStreamURL)
// Create AVPlayer with the stream URL
avPlayer = AVPlayer(url: streamURL!)
// avPlayer.isMuted = true
// Create AVPlayerLayer
playerLayer = AVPlayerLayer(player: avPlayer)
playerLayer.videoGravity = .resizeAspectFill // You can set different videoGravity as per your need
playerLayer.frame = self.vc.liveTvPlayer.bounds
self.vc.liveTvPlayer.layer.addSublayer(playerLayer)
}
func setData(){
@@ -53,7 +114,7 @@ class ThemeOneVM{
}
if let avatar = data.avtar{
//https://wokaland.com/admin/storage/app/public/uploads/avtar/avatar2.png?d=1716889852
vc.avatarImage.imageURL("https://wokaland.com/admin/storage/app/public/uploads/avtar/" + avatar)
vc.avatarImage.imageURL("https://wokaland.com/admin/storage/app/public/uploads/avtar/avatar2.png?d=1716889852")
}
}
@@ -144,50 +205,65 @@ class ThemeOneVM{
// function which is triggered when handleTap is called
@objc func handleTap(_ sender: UITapGestureRecognizer) {
print("tapped")
// let vc = self.storyboard?.instantiateViewController(identifier: "ViewController") as! ViewController
//
// DispatchQueue.main.async {
// do {
// // Create a JWMediaTrack with the thumbnails .vtt file
// // let thumbnailTrack = try JWThumbnailTrackBuilder()
// // .file(URL(string:"https://content.jwplatform.com/videos/Agy4RIje-Ysj2G4DQ.mp4")!)
// // .build()
//
// // Create a JWPlayerItem
// let item = try JWPlayerItemBuilder()
// .file(URL(string:self.videoStreamURL)!)
// .title("Testing Title")
// .posterImage(URL(string: "https://img.freepik.com/free-photo/painting-mountain-lake-with-mountain-background_188544-9126.jpg")!)
// // .mediaTracks([thumbnailTrack])
// .build()
//
// // Create a config, and give it the item as a playlist.
// let config = try JWPlayerConfigurationBuilder()
// .playlist(items: [item])
// .autostart(true)
// .preload(.auto)
// .repeatContent(true)
// .build()
//
// vc.config = config
// }
// catch {
// // Handle Error
// }
// vc.dismissTapped = self.tapped
//
// vc.modalPresentationStyle = .overFullScreen
// self.present(vc, animated: false) {
// self.stopLiveStream()
// vc.transitionToFullScreen(animated: true) {
// print("FullScreen")
// }
//// vc.setDeviceOrientation(orientation: .landscapeRight)
// }
//// self.navigationController?.pushViewController(vc, animated: true)
// }
let vc = self.vc.storyboard?.instantiateViewController(identifier: "PlayerVC") as! PlayerVC
DispatchQueue.main.async {
do {
// Create a JWMediaTrack with the thumbnails .vtt file
// let thumbnailTrack = try JWThumbnailTrackBuilder()
// .file(URL(string:"https://content.jwplatform.com/videos/Agy4RIje-Ysj2G4DQ.mp4")!)
// .build()
// Create a JWPlayerItem
let item = try JWPlayerItemBuilder()
.file(URL(string: self.liveStreamURL)!)
.title("Testing Title")
.posterImage(URL(string: "https://img.freepik.com/free-photo/painting-mountain-lake-with-mountain-background_188544-9126.jpg")!)
// .mediaTracks([thumbnailTrack])
.build()
// Create a config, and give it the item as a playlist.
let config = try JWPlayerConfigurationBuilder()
.playlist(items: [item])
.autostart(true)
.preload(.auto)
.repeatContent(true)
.build()
vc.config = config
}
catch {
// Handle Error
}
vc.dismissTapped = self.tapped
vc.modalPresentationStyle = .overFullScreen
self.vc.present(vc, animated: false) {
self.stopLiveStream()
vc.transitionToFullScreen(animated: true) {
print("FullScreen")
}
// vc.setDeviceOrientation(orientation: .landscapeRight)
}
// self.navigationController?.pushViewController(vc, animated: true)
}
}
func tapped(){
Timer.scheduledTimer(withTimeInterval: 0.2, repeats: false) { _ in
self.startLiveStream()
}
print("Sadasd")
}
func startLiveStream(){
avPlayer.play()
}
func stopLiveStream(){
avPlayer.pause()
}
// MARK: - Handle Time Change
@objc func handleBackground(){

View File

@@ -26,7 +26,6 @@ class ThemeTwoVM{
func initView(){
setupCell()
setData()
NotificationCenter.default.addObserver(self, selector: #selector(self.reloadTheme), name: NSNotification.Name(rawValue: K.NotificationCenterReloads.reloadTheme), object: nil)
}
@@ -51,7 +50,7 @@ class ThemeTwoVM{
if let avatar = data.avtar{
//https://wokaland.com/admin/storage/app/public/uploads/avtar/avatar2.png?d=1716889852
vc.avatarImage.imageURL("https://wokaland.com/admin/storage/app/public/uploads/avtar/" + avatar)
vc.avatarImage.imageURL("https://i.pinimg.com/280x280_RS/da/0b/bd/da0bbdb22d191272f32fa2c7c7c8e5c2.jpg", color: .white)
}
}