Skip to content

Commit

Permalink
Release/3.1.0 (#283)
Browse files Browse the repository at this point in the history
  • Loading branch information
borut-t authored Jun 6, 2023
2 parents 3b332ce + 8ab5224 commit 2e743a9
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/SPM.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
swiftpm:
runs-on: macos-12
runs-on: macos-13
steps:
- uses: actions/checkout@v3
- uses: MeilCli/swiftpm-update-check-action@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/Tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
Tests:
runs-on: macos-12
runs-on: macos-13
steps:
- name: Cancel previous jobs
uses: styfle/[email protected]
Expand Down
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/Alamofire/Alamofire",
"state" : {
"revision" : "78424be314842833c04bc3bef5b72e85fff99204",
"version" : "5.6.4"
"revision" : "bc268c28fb170f494de9e9927c371b8342979ece",
"version" : "5.7.1"
}
}
],
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.7
// swift-tools-version:5.8
import PackageDescription

let package = Package(
Expand All @@ -13,7 +13,7 @@ let package = Package(
.library(name: "PovioKitUI", targets: ["PovioKitUI"])
],
dependencies: [
.package(url: "https://github.com/Alamofire/Alamofire", .upToNextMajor(from: "5.6.4"))
.package(url: "https://github.com/Alamofire/Alamofire", .upToNextMajor(from: "5.0.0"))
],
targets: [
.target(
Expand Down
14 changes: 14 additions & 0 deletions Sources/UI/Camera/Camera.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,20 @@ public extension Camera {
func toggleTorch() throws {
try setTorch(on: !(device?.isTorchActive ?? true))
}

func setZoom(_ zoomFactor: CGFloat,
animated: Bool = true,
rate: Float = 5) throws {
guard let device else { return }
let clampedZoomFactor = max(device.minAvailableVideoZoomFactor, min(zoomFactor, device.maxAvailableVideoZoomFactor))
try device.lockForConfiguration()
if animated {
device.ramp(toVideoZoomFactor: clampedZoomFactor, withRate: rate)
} else {
device.videoZoomFactor = clampedZoomFactor
}
device.unlockForConfiguration()
}
}

// MARK: - Private Methods
Expand Down

0 comments on commit 2e743a9

Please sign in to comment.