Lnpopupcontroller: UITabBar layout issues on iOS 12.1

Created on 30 Oct 2018  Â·  11Comments  Â·  Source: LeoNatan/LNPopupController

Description

I have UITabBar layout issues with iOS 12.1. This did not happen on iOS 12.0.1. Please take a look at the following little screen recording for demonstration:

IMG_1466.TRIM.mov.zip

screen shot 2018-10-30 at 21 39 43

I could not reproduce this running the included popup controller example project on my iOS 12.1 device.

I use version 2.5.25.

Steps to Reproduce

This is how I present the popup bar:

    static func play(channel: Channel) {
        guard let tabBar = UIApplication.topViewController()?.tabBarController else { return }
        let playerViewController = UIStoryboard(name: "Player", bundle: nil).instantiateViewController(withIdentifier: "playerView") as! PlayerViewController
        playerViewController.channel = channel
        playerViewController.popupItem.accessibilityHint = NSLocalizedString("Double Tap to Expand the Mini Player", comment: "")
        tabBar.popupContentView.popupCloseButton.accessibilityLabel = NSLocalizedString("Dismiss Now Playing Screen", comment: "")

        tabBar.presentPopupBar(withContentViewController: playerViewController, openPopup: true, animated: true) {
            let longPressRecognizer = UILongPressGestureRecognizer(target: playerViewController, action: #selector(PlayerViewController.longPress(gestureRecognizer:)))
            longPressRecognizer.delegate = playerViewController
            tabBar.popupBar.addGestureRecognizer(longPressRecognizer)
            tabBar.popupBar.inheritsVisualStyleFromDockingView = false
        }
    }

I tried replacing the playerViewController loaded from storyboard with just UIViewController(), because I suspected something inside the playerViewController to mess things up. Does not solve the issue though.

I tried removing the longPressGestureRecognizer, no luck. I am running out of ideas where to look next.

Any ideas what could cause this issue?

Device, OS and Xcode Versions

iPhone 8, iOS 12.1, Xcode 10.1

not a bug

Most helpful comment

@LeoNatan That was indeed our issue, too. Thank you!

All 11 comments

Ohh, I see you are using the latest version. I will have to look. I solved it in the past.

You solved this already? Maybe it is an issue with my setup and the Carthage Version update did not work correctly? This could explain why it works in the example app?

I will investigate further tomorrow.

Yes, hopefully, this is it. I had exactly this problem, and I resolved it. I changed a fundamental part of how layout of the popup content controller was performed. I don't see any issue in your code that should trigger this. Let's keep the issue open, but let me know if it's just an issue of not using the latest version.

This is constantly reproducible on iOS 12.1 with LNPopUpController 2.5.25.

@dylancopeland If you run the example project, does the issue reproduce for you?

I can confirm your fix aac0256f does solve the problem. I ran the example project before the fix on my device and could reproduce the issue. Current release 2.2.25 does fix the issue in the example project running on 12.1.

Now I am trying to find out why this fix was not applied in my code after running carthage update. I will follow up on this here soon.

I just realised LNPopupController was not actually updated to the latest version by Carthage.

➜  podlive-ios-app git:(develop) ✗ carthage update
*** Fetching LNPopupController
*** Checking out LNPopupController at "2.5.25"
*** xcodebuild output can be found in /var/folders/8r/nl9r6g3s2j36ljrhdnky9ng40000gn/T/carthage-xcodebuild.pJuQLe.log
*** Building scheme "LNPopupController" in LNPopupController.xcodeproj
Could not find any available simulators for iOS

The last line did not really look like an error to me. It does lead to a failed build though: https://github.com/Carthage/Carthage/issues/2602

Fortunately it is fixed in the latest Carthage release. After updating Carthage I could update successfully to 2.2.25:

➜  podlive-ios-app git:(develop) carthage update --platform iOS
*** Fetching LNPopupController
*** Checking out LNPopupController at "2.5.25"
*** xcodebuild output can be found in /var/folders/8r/nl9r6g3s2j36ljrhdnky9ng40000gn/T/carthage-xcodebuild.XL3YwJ.log
*** Building scheme "LNPopupController" in LNPopupController.xcodeproj

Does not look that different, but actually builds the framework!

Tadaa! Works now perfectly on iOS 12.1. Issue fixed.

@LeoNatan Thank you for quick response and sorry for taking your time with this issue you already resolved. Your work is awesome! 😊

Glad to hear it! Thanks for the kind words! Happy coding!

@dylancopeland Please try the solution above and let me know if you still see issues.

@LeoNatan That was indeed our issue, too. Thank you!

Was this page helpful?
0 / 5 - 0 ratings