Revert "Rotate call button icons when the phone is in landscape"
This reverts commit 54701df408.
This commit is contained in:
parent
d1a455b1a2
commit
2cc4502fbf
@ -3,7 +3,6 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import UIKit
|
||||
|
||||
class CallButton: UIButton {
|
||||
var iconName: String { didSet { updateAppearance() } }
|
||||
@ -99,17 +98,6 @@ class CallButton: UIButton {
|
||||
|
||||
updateAppearance()
|
||||
updateSizing()
|
||||
updateOrientation()
|
||||
|
||||
UIDevice.current.beginGeneratingDeviceOrientationNotifications()
|
||||
NotificationCenter.default.addObserver(self,
|
||||
selector: #selector(updateOrientation),
|
||||
name: UIDevice.orientationDidChangeNotification,
|
||||
object: nil)
|
||||
}
|
||||
|
||||
deinit {
|
||||
UIDevice.current.endGeneratingDeviceOrientationNotifications()
|
||||
}
|
||||
|
||||
private func updateAppearance() {
|
||||
@ -159,25 +147,6 @@ class CallButton: UIButton {
|
||||
}
|
||||
}
|
||||
|
||||
@objc
|
||||
private func updateOrientation() {
|
||||
let rotationAngle: CGFloat
|
||||
switch UIDevice.current.orientation {
|
||||
case .landscapeLeft:
|
||||
rotationAngle = .pi / 2
|
||||
case .landscapeRight:
|
||||
rotationAngle = -.pi / 2
|
||||
case .portrait, .portraitUpsideDown, .faceDown, .faceUp, .unknown:
|
||||
fallthrough
|
||||
@unknown default:
|
||||
rotationAngle = 0
|
||||
}
|
||||
|
||||
UIView.animate(withDuration: 0.3, delay: 0, options: .allowUserInteraction) {
|
||||
self.circleView.transform = CGAffineTransform(rotationAngle: rotationAngle)
|
||||
}
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user