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

View file

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

View file

@ -27,6 +27,8 @@ class ViewController: SwiftyCamViewController, SwiftyCamViewControllerDelegate {
cameraDelegate = self cameraDelegate = self
maximumVideoDuration = 10.0 maximumVideoDuration = 10.0
shouldUseDeviceOrientation = true shouldUseDeviceOrientation = true
allowAutoRotate = true
addButtons() 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 /// Sets wether the taken photo or video should be oriented according to the device orientation
public var shouldUseDeviceOrientation = false public var shouldUseDeviceOrientation = false
/// Sets whether or not View Controller supports auto rotation
public var allowAutoRotate = false
// MARK: Public Get-only Variable Declarations // MARK: Public Get-only Variable Declarations
@ -229,7 +233,7 @@ open class SwiftyCamViewController: UIViewController {
/// Disable view autorotation for forced portrait recorindg /// Disable view autorotation for forced portrait recorindg
override open var shouldAutorotate: Bool { override open var shouldAutorotate: Bool {
return false return allowAutoRotate
} }
// MARK: ViewDidLoad // MARK: ViewDidLoad