Minitour / AZTabBarController

A custom tab bar controller for iOS written in Swift 4.2
MIT License
348 stars 65 forks source link

Selector on top for iPhone X #59

Closed davidebettio closed 5 years ago

davidebettio commented 5 years ago

Is there a way to put selector on the top of the tabbar instead of the bottom?

In a old version of this lib I forked the repo and use this code in the file AZTabBarController.swift:

a property:

/// The position of the selection indicator.
open var selectionIndicatorOnBottom:Bool = true{
    didSet{
        updateInterfaceIfNeeded()
     }
}

and this code at the bottom of setupSelectionIndicatorConstraints()

if (selectionIndicatorOnBottom) {
    selectionIndicator.bottomAnchor.constraint(equalTo: buttonsStackView.bottomAnchor).isActive = true
} else {
    selectionIndicator.topAnchor.constraint(equalTo: buttonsStackView.topAnchor).isActive = true
}

and it worked, but in the latest version it doesn't work

Minitour commented 5 years ago

@davidebettio I need to look into it. I recommend however to instead of making it appear on top, have it as it, set it’s background color to clear and add a subview to it which looks in the way you want it to be. See issue #11.