huri000 / SwiftEntryKit

SwiftEntryKit is a presentation library for iOS. It can be used to easily display overlays within your iOS apps.
MIT License
6.6k stars 604 forks source link

popview show wrong orientation when app force landscape #353

Open CoderMaurice opened 3 years ago

CoderMaurice commented 3 years ago

One problem with forcing landscape is that the status bar disappears, I think it is the reason of orientation problem

The weird thing is, if I connect the USB cable, everything works fine, when I disconnect USB calble and restart App, the problem shows

Can you add Specified direction in supportedInterfaceOrientations

public enum SupportedInterfaceOrientation {

                /** Uses standard supported interface orientation (target specification in general settings) */
                case standard

                /** Supports all orinetations */
                case all

                case specified(orientation: UIInterfaceOrientationMask)
            }
    override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
        guard let lastAttributes = lastAttributes else {
            return super.supportedInterfaceOrientations
        }
        switch lastAttributes.positionConstraints.rotation.supportedInterfaceOrientations {
        case .specified(let orientation):
            return orientation
        case .standard:
            return super.supportedInterfaceOrientations
        case .all:
            return .all
        }
    }
MarkSpit commented 1 year ago

I created a PR for this: https://github.com/huri000/SwiftEntryKit/pull/375