This commit is contained in:
Bilal
2024-10-22 08:47:54 +05:30
parent a78eda88a8
commit 5742a18d09
7 changed files with 21 additions and 17 deletions

View File

@@ -27,14 +27,16 @@ class AppUpdateVC: UIViewController {
if isForceUpdate{
skipBtn.isHidden = true
DispatchQueue.main.async { [self] in
DispatchQueue.main.async { [weak self] in
guard let self else{return}
updateBtn.applyGradient(colors: [color1, color2], startPoint: CGPoint(x: 0, y: 0), endPoint: CGPoint(x: 0.8, y: 0))
updateBtn.roundCorner()
}
}else{
skipBtn.isHidden = false
DispatchQueue.main.async { [self] in
DispatchQueue.main.async { [weak self] in
guard let self else{return}
updateBtn.applyGradient(colors: [color1, color2], startPoint: CGPoint(x: 0, y: 0), endPoint: CGPoint(x: 0.8, y: 0))
updateBtn.roundCorner()
skipBtn.applyGradient(colors: [color1, color2], startPoint: CGPoint(x: 0, y: 0), endPoint: CGPoint(x: 0.8, y: 0))

View File

@@ -517,7 +517,8 @@ private extension DropDown {
func setup() {
tableView.register(cellNib, forCellReuseIdentifier: DPDConstant.ReusableIdentifier.DropDownCell)
DispatchQueue.main.async {
DispatchQueue.main.async { [weak self] in
guard let self else{return}
//HACK: If not done in dispatch_async on main queue `setupUI` will have no effect
self.updateConstraintsIfNeeded()
self.setupUI()

View File

@@ -52,7 +52,8 @@ class JWKaraokePlayerVM{
func saveToFilesApp() {
guard let mixedAudioURL = mixedAudioURL else { return }
DispatchQueue.main.async {
DispatchQueue.main.async { [weak self] in
guard let self else{return}
let documentPicker = UIDocumentPickerViewController(url: mixedAudioURL, in: .exportToService)
documentPicker.delegate = self.vc
self.vc.present(documentPicker, animated: true, completion: nil)

View File

@@ -457,7 +457,8 @@ extension PlayerVC {
}
} else {
// Fallback code for earlier iOS versions
DispatchQueue.main.async {
DispatchQueue.main.async { [weak self] in
guard let self else{return}
self.dismiss(animated: true)
}
}

View File

@@ -119,7 +119,8 @@ class PlayerVM{
}
updateClicks()
DispatchQueue.main.async {
DispatchQueue.main.async { [weak self] in
guard let self else{return}
if #available(iOS 16.0, *) {
// Code for iOS 15.0 and above
appDelegate.deviceOrientation = .portrait

View File

@@ -660,8 +660,6 @@ class ThemeOneVM{
let details = period.details
// Update view's background color with a gradient or single color
// DispatchQueue.main.async { [weak self] in
// guard let self else{return}
if period.details.dayCycle == .night{
startStarGlowAnimation()
}else{
@@ -671,15 +669,14 @@ class ThemeOneVM{
!image.isHidden ? image.isHidden = true : nil
}
}
DispatchQueue.main.async {
self.vc.gradientView.applyGradient(colors: [details.color1, details.color2], startPoint: CGPoint(x: 0, y: 0), endPoint: CGPoint(x: 0, y: 0.8))
self.vc.nameLabel.textColor = details.textColor
self.vc.HelloLabel.textColor = details.textColor
self.vc.welcomeLabel.textColor = details.textColor
self.vc.homeGrass.image = UIImage(named: details.grass)
DispatchQueue.main.async { [weak self] in
guard let self else{return}
vc.gradientView.applyGradient(colors: [details.color1, details.color2], startPoint: CGPoint(x: 0, y: 0), endPoint: CGPoint(x: 0, y: 0.8))
vc.nameLabel.textColor = details.textColor
vc.HelloLabel.textColor = details.textColor
vc.welcomeLabel.textColor = details.textColor
vc.homeGrass.image = UIImage(named: details.grass)
}
// }
break
}
}
}

View File

@@ -192,7 +192,8 @@ extension WebSeriesVC : TableViewSRC {
cell.setData(data: data,selectedCategory: categoryID)
}
cell.btnTapped = { [self] (type) -> Void in
cell.btnTapped = { [weak self] (type) -> Void in
guard let self else{return}
HapticFeedbackGenerator.shared.simpleSelection()
updateFavLikes(type: type, index: indexPath.row)
}