-
Notifications
You must be signed in to change notification settings - Fork 2
Multi orientation support #185
Multi orientation support #185
Conversation
…eVideoOrientation extension
…pertyOrientation extension
… for it's popover
| self.init(rawValue: AVCaptureVideoOrientation.portraitUpsideDown.rawValue) | ||
| default: | ||
| self.init(rawValue: AVCaptureVideoOrientation.portrait.rawValue) | ||
| case .portrait: self = .portrait |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Cases inside a switch should always be on a newline |
| default: | ||
| self.init(rawValue: AVCaptureVideoOrientation.portrait.rawValue) | ||
| case .portrait: self = .portrait | ||
| case .portraitUpsideDown: self = .portraitUpsideDown |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Cases inside a switch should always be on a newline |
| self.init(rawValue: AVCaptureVideoOrientation.portrait.rawValue) | ||
| case .portrait: self = .portrait | ||
| case .portraitUpsideDown: self = .portraitUpsideDown | ||
| case .landscapeLeft: self = .landscapeLeft |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Cases inside a switch should always be on a newline |
| case .portrait: self = .portrait | ||
| case .portraitUpsideDown: self = .portraitUpsideDown | ||
| case .landscapeLeft: self = .landscapeLeft | ||
| case .landscapeRight: self = .landscapeRight |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Cases inside a switch should always be on a newline |
| case .portraitUpsideDown: self = .portraitUpsideDown | ||
| case .landscapeLeft: self = .landscapeLeft | ||
| case .landscapeRight: self = .landscapeRight | ||
| case .faceUp: self = .portrait |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Cases inside a switch should always be on a newline |
| case .landscapeLeft: self = .landscapeLeft | ||
| case .landscapeRight: self = .landscapeRight | ||
| case .faceUp: self = .portrait | ||
| case .faceDown: self = .portraitUpsideDown |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Cases inside a switch should always be on a newline |
| case .landscapeRight: self = .landscapeRight | ||
| case .faceUp: self = .portrait | ||
| case .faceDown: self = .portraitUpsideDown | ||
| default: self = .portrait |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Cases inside a switch should always be on a newline |
| /// Maps UIInterfaceOrientation to AVCaptureVideoOrientation | ||
| init?(interfaceOrientation: UIInterfaceOrientation) { | ||
| switch interfaceOrientation { | ||
| case .portrait: self = .portrait |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Cases inside a switch should always be on a newline |
| init?(interfaceOrientation: UIInterfaceOrientation) { | ||
| switch interfaceOrientation { | ||
| case .portrait: self = .portrait | ||
| case .portraitUpsideDown: self = .portraitUpsideDown |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Cases inside a switch should always be on a newline |
| switch interfaceOrientation { | ||
| case .portrait: self = .portrait | ||
| case .portraitUpsideDown: self = .portraitUpsideDown | ||
| case .landscapeLeft: self = .landscapeLeft |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Cases inside a switch should always be on a newline |
| case .portrait: self = .portrait | ||
| case .portraitUpsideDown: self = .portraitUpsideDown | ||
| case .landscapeLeft: self = .landscapeLeft | ||
| case .landscapeRight: self = .landscapeRight |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Cases inside a switch should always be on a newline |
| case .portraitUpsideDown: self = .portraitUpsideDown | ||
| case .landscapeLeft: self = .landscapeLeft | ||
| case .landscapeRight: self = .landscapeRight | ||
| default: return nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Cases inside a switch should always be on a newline |
|
|
||
| init(deviceOrientation: UIDeviceOrientation) { | ||
| switch deviceOrientation { | ||
| case .portrait: self = .up |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Cases inside a switch should always be on a newline |
| init(deviceOrientation: UIDeviceOrientation) { | ||
| switch deviceOrientation { | ||
| case .portrait: self = .up | ||
| case .portraitUpsideDown: self = .down |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Cases inside a switch should always be on a newline |
| switch deviceOrientation { | ||
| case .portrait: self = .up | ||
| case .portraitUpsideDown: self = .down | ||
| case .landscapeLeft: self = .left |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Cases inside a switch should always be on a newline |
| case .portrait: self = .up | ||
| case .portraitUpsideDown: self = .down | ||
| case .landscapeLeft: self = .left | ||
| case .landscapeRight: self = .right |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Cases inside a switch should always be on a newline |
| case .portraitUpsideDown: self = .down | ||
| case .landscapeLeft: self = .left | ||
| case .landscapeRight: self = .right | ||
| case .unknown: self = .up |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Cases inside a switch should always be on a newline |
| case .landscapeLeft: self = .left | ||
| case .landscapeRight: self = .right | ||
| case .unknown: self = .up | ||
| case .faceUp: self = .up |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Cases inside a switch should always be on a newline |
| case .landscapeRight: self = .right | ||
| case .unknown: self = .up | ||
| case .faceUp: self = .up | ||
| case .faceDown: self = .up |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Cases inside a switch should always be on a newline |
|
|
||
| init(interfaceOrientation: UIInterfaceOrientation) { | ||
| switch interfaceOrientation { | ||
| case .portrait: self = .up |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Cases inside a switch should always be on a newline |
| init(interfaceOrientation: UIInterfaceOrientation) { | ||
| switch interfaceOrientation { | ||
| case .portrait: self = .up | ||
| case .portraitUpsideDown: self = .up |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Cases inside a switch should always be on a newline |
| switch interfaceOrientation { | ||
| case .portrait: self = .up | ||
| case .portraitUpsideDown: self = .up | ||
| case .landscapeLeft: self = .left |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Cases inside a switch should always be on a newline |
| case .portrait: self = .up | ||
| case .portraitUpsideDown: self = .up | ||
| case .landscapeLeft: self = .left | ||
| case .landscapeRight: self = .right |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Cases inside a switch should always be on a newline |
| case .portraitUpsideDown: self = .up | ||
| case .landscapeLeft: self = .left | ||
| case .landscapeRight: self = .right | ||
| case .unknown: self = .up |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Cases inside a switch should always be on a newline |
|
|
||
| override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { | ||
| super.viewWillTransition(to: size, with: coordinator) | ||
| coordinator.animate(alongsideTransition: { [weak self] (context) in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Unused parameter “context” in a closure should be replaced with _. |
Current coverage for WeScan is
|
| Files changed | - | - |
|---|---|---|
| CGImagePropertyOrientation.swift | 0.00% |
💀 |
| UIInterfaceOrientation+Utils.swift | 0.00% |
💀 |
| ScannerViewController.swift | 0.00% |
💀 |
| CaptureSessionManager.swift | 0.00% |
💀 |
| AVCaptureVideoOrientation+Utils.swift | 55.00% |
|
| Quadrilateral.swift | 89.04% |
✅ |
Current coverage for WeScanSampleProject is 45.83%
| Files changed | - | - |
|---|---|---|
| UIInterfaceOrientation+Utils.swift | 0.00% |
💀 |
| HomeViewController.swift | 49.61% |
🚫 |
Powered by xcov
Generated by 🚫 Danger
|
That's a lot of emails I received, hope you'll use my work in any way since I won't have time to modify it. |
|
Has anyone found a fix to allow this in landscape only, not portrait? |
This PR brings support to iPad and camera rotation (See #76 )