BothSidesCamera 1.2.2

BothSidesCamera 1.2.2

Maintained by daisukenagata.



  • By
  • daisukenagata

BothSidesCamera

CI Status Platform Version Carthage compatible License

Requirements

  • iPhoneX, Xs, XR, XsMax, Pro
  • iOS 13.2+
  • Xcode 11.3

Version 1.1.1 ~ Supported all screen positions.

Version 0.8.9 ~ The preview screen and playback screen are perfectly matched

Version 0.8 ~ Preview screen with the same ratio and recording function

Purple button logic  Horizontal support

Version 0.7 ~ Preview screen with the same ratio and recording function

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.

Function

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.

code

Horizontal rotation movement

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)

How to

pinchGesture →Scale

2 continuous taps →Preview screen switching 

Trace the preview screen →Move preview screen

Installation

BothSidesCamera is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'BothSidesCamera'

Charthage

Officially supported: Carthage 0.34 and up.

Add this to Cartfile

github "daisukenagata/BothSidesCamera"

Terminal command

$ carthage update --platform iOS

Author

daisukenagata, [email protected]

License

BothSidesCamera is available under the MIT license. See the LICENSE file for more info.