- iPhone ProMax, Pro
- iOS 13.2+
- Xcode 11.3+
Purple button logic Horizontal support
Version 0.6 ~ Equipped with screenshot function. You can shoot images with the left button, even during video recording, when not recording.
Gray button screenshot
White Button is a record button
Blue Button switches camera
Yellow Button is lighting.
You can shoot in-camera and out-camera at the same time. Both screen ratios can be adjusted. While using, use about 260MB~ of memory with iPhonePro. Memory usage is about 80MB with the stop method.
class SceneDelegate
func windowScene(_ windowScene: UIWindowScene, didUpdate previousCoordinateSpace: UICoordinateSpace, interfaceOrientation previousInterfaceOrientation: UIInterfaceOrientation, traitCollection previousTraitCollection: UITraitCollection) {
model.orientation = windowScene.interfaceOrientation
contentView.bView.orientation(model: model)
}
struct ContentView
@EnvironmentObject var model: OrientationModel
final class OrientationModel
@Published var orientation: UIInterfaceOrientation = .unknown
// Generation
import BothSidesCamera
@ObservedObject private var observer = KeyboardResponder()
// Start and stop recording
previewView?.cameraStart(completion: saveBtn)
// This is call
func saveBtn() { print("movie save") }
// All stop
previewView.cameraStop()
// Resize
previewView.preViewSizeSet()
// Switch camera Please check the in-camera as the camera type is different.
previewView.changeDviceType(backDeviceType: .builtInUltraWideCamera, frontDeviceType:.builtInUltraWideCamera)
// Method to match the preview screen and playback screen
previewView.deviceAspect(rect: bView.backCameraVideoPreviewView.frame)
pinchGesture →Scale
2 continuous taps →Preview screen switching
Trace the preview screen →Move preview screen
BothSidesCamera is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'BothSidesCamera'
Officially supported: Carthage 0.34 and up.
Add this to Cartfile
github "daisukenagata/BothSidesCamera"
Terminal command
$ carthage update --platform iOS
daisukenagata, dbank0208@gmail.com
BothSidesCamera is available under the MIT license. See the LICENSE file for more info.