Skip to content

Commit

Permalink
feat(swiftlint-warnings): fix SwiftLint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
rolandkakonyi committed Oct 17, 2023
1 parent 7a5895b commit 25fdf63
Showing 1 changed file with 24 additions and 23 deletions.
47 changes: 24 additions & 23 deletions ios/RNPlayerViewManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -116,29 +116,30 @@ public class RNPlayerViewManager: RCTViewManager {
}
}

@objc func setScalingMode(_ viewId: NSNumber, scalingMode: String) {
bridge.uiManager.addUIBlock { [weak self] _, views in
guard
let self,
let view = views?[viewId] as? RNPlayerView
else {
return
}
guard let playerView = view.playerView else {
return
}
switch scalingMode {
case "Zoom":
playerView.scalingMode = .zoom
case "Stretch":
playerView.scalingMode = .stretch
case "Fit":
playerView.scalingMode = .fit
default:
break
}
}
}
@objc
func setScalingMode(_ viewId: NSNumber, scalingMode: String) {
bridge.uiManager.addUIBlock { [weak self] _, views in
guard
let self,
let view = views?[viewId] as? RNPlayerView
else {
return
}
guard let playerView = view.playerView else {
return
}
switch scalingMode {
case "Zoom":
playerView.scalingMode = .zoom
case "Stretch":
playerView.scalingMode = .stretch
case "Fit":
playerView.scalingMode = .fit
default:
break
}
}
}

/// Fetches the initialized `PlayerModule` instance on RN's bridge object.
private func getPlayerModule() -> PlayerModule? {
Expand Down

0 comments on commit 25fdf63

Please sign in to comment.