Added support for autorotate

This commit is contained in:
Andrew Walz 2017-05-29 20:53:26 -06:00
parent b90a09d590
commit fa9e75fe46
4 changed files with 15 additions and 6 deletions

View file

@ -184,7 +184,7 @@
};
1675A9711E00A68300B80903 = {
CreatedOnToolsVersion = 8.1;
DevelopmentTeam = 427VB57543;
DevelopmentTeam = DGV5BLXSF9;
ProvisioningStyle = Automatic;
};
};
@ -421,11 +421,11 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = 427VB57543;
DEVELOPMENT_TEAM = DGV5BLXSF9;
INFOPLIST_FILE = DemoSwiftyCam/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.Cappsule.DemoSwiftyCam;
PRODUCT_BUNDLE_IDENTIFIER = com.Cappsule.DemoSwiftyCam1010;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
@ -435,11 +435,11 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = 427VB57543;
DEVELOPMENT_TEAM = DGV5BLXSF9;
INFOPLIST_FILE = DemoSwiftyCam/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.Cappsule.DemoSwiftyCam;
PRODUCT_BUNDLE_IDENTIFIER = com.Cappsule.DemoSwiftyCam1010;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
@ -455,6 +455,7 @@
05D2A9BB1E80BE9700B479E9 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
1675A96D1E00A68300B80903 /* Build configuration list for PBXProject "DemoSwiftyCam" */ = {
isa = XCConfigurationList;

View file

@ -35,6 +35,8 @@
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>

View file

@ -27,6 +27,8 @@ class ViewController: SwiftyCamViewController, SwiftyCamViewControllerDelegate {
cameraDelegate = self
maximumVideoDuration = 10.0
shouldUseDeviceOrientation = true
allowAutoRotate = true
addButtons()
}

View file

@ -146,6 +146,10 @@ open class SwiftyCamViewController: UIViewController {
/// Sets wether the taken photo or video should be oriented according to the device orientation
public var shouldUseDeviceOrientation = false
/// Sets whether or not View Controller supports auto rotation
public var allowAutoRotate = false
// MARK: Public Get-only Variable Declarations
@ -229,7 +233,7 @@ open class SwiftyCamViewController: UIViewController {
/// Disable view autorotation for forced portrait recorindg
override open var shouldAutorotate: Bool {
return false
return allowAutoRotate
}
// MARK: ViewDidLoad