This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| final class DeviceOrientationInfo: ObservableObject { | |
| enum Orientation { | |
| case portrait | |
| case landscape | |
| } | |
| @Published var orientation: Orientation | |
| private var listener: AnyCancellable? | |
| init() { | |
| orientation = UIDevice.current.orientation.isLandscape ? .landscape : .portrait | |
| listener = NotificationCenter.default.publisher(for: UIDevice.orientationDidChangeNotification) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // Stepper.swift | |
| // Stepperindicator | |
| // | |
| // Created by Damiaan on 13/01/2019. | |
| // Copyright © 2019 Devian. All rights reserved. | |
| // | |
| import UIKit |