Skip to content
No description, website, or topics provided.
Swift Metal Ruby
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


CI Status Platform Version Carthage compatible License


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

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.


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.


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 

// Resize

// 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


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




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

You can’t perform that action at this time.