Force Landscape when orientation is locked
I am building a video app. When a user rotates the device to landscape, the video takes over all of the screen and the UI changes.
Is there a way to ‘force’ landscape layout when the device is in portrait? For example, if the user has orientation lock we want to add a button to enter the landscape mode. The YouTube app has a button that does this.
- Popover position is not correctly after its orientation change in swift
- How can I add overlay text on a video, then re-encode it?
- How to choose next song in remoteControlledEvents
- Command /Applications/Xcode.app/Contents/Developer/usr/bin/ibtool failed with exit code 255
- Pass data Through segue not working in swift 3 any solution?
- Xcode IB: UIButton hidden but have still buttons space
Solutions Collect From Internet About “Force Landscape when orientation is locked”
Yes you can force it using this 2 lines of code, in your
let value = UIInterfaceOrientation.landscapeLeft.rawValue UIDevice.current.setValue(value, forKey: "orientation")
- get all ranges of a substring in a string in swift
- Navigation pop view when swipe right like Instagram iPhone app.How i achieve this?
- Firebase create user with email, password, display name and photo url
- How to record video in ProRes codec on iOS?
- Xcode 4.3-4.4 crashes with breakpoints using LLDB, breakpoints useless with GDB
- ionic app iOS 9 problems 10 $digest() iterations reached
- “No unexpired provisioning profiles found that contain any of the keychain's signing certificates” Horror
- Navigation bar overlapped by status bar
- How do I subclass UITextField and override drawPlaceholderInRect to change Placeholder color
- How to add texture (image) to SceneKit model so that it covers the model (mesh) uniformly?
- Can an enum contain another enum values in Swift?
- Live Streaming in Swift
- How to Remove a Previous ViewController
- Property 'managedObjectStore' not found on object of type 'RKObjectManager'
- xcode 5: code signing identity list not complete