/ZoomSwitcherKit

ZoomSwitcher for different iPhones

Primary LanguageSwift

codebeat badge

ZoomSwitcherKit

ZoomSwitcher for different iPhone back-camera types (single, dual, triple)

Installation:

  • SPM: .package(url: "https://github.com/eonist/ZoomSwitcherKit.git", .branch("master"))

Examples:

let backCamType: BackCameraType = .backCameraType
let size = ZoomSwitcher.getSize(backCamType: backCamType)
let zoomSwitcher: ZoomSwitcher = .init(frame: .init(origin: .zero, size: size), backCameraType: backCamType) zoomSwitcher.anchorAndSize(to: self, size: size)
zoomSwitcher.buttons[backCamType.defaultLenseIndex].toggle = true
addSubview(zoomSwitcher)
zoomSwitcher.onSwitch = { focalType in
   Swift.print("Switched to focalType:  \(focalType)")
}

Todo

  • add spm and github actions