import UIKit

extension VCreateSearch
{
    //MARK: private
    
    private func animate(listTop:CGFloat)
    {
        viewBase.layoutTop.constant = listTop
        
        UIView.animate(withDuration:kAnimationDuration)
        { [weak self] in
            
            self?.layoutIfNeeded()
        }
    }
    
    //MARK: internal
    
    func animateShow()
    {
        animate(listTop:0)
    }
    
    func animateHide()
    {
        animate(listTop:-viewBase.kHeight)
    }
}

import UIKit

extension VCreateSearch
{
    //MARK: internal
    
    func animateShow()
    {
        viewBase.layoutTop.constant = 0
        
        UIView.animate(
            withDuration:kAnimationDuration,
        animations:
        { [weak self] in
            
            self?.layoutIfNeeded()
        })
        { [weak self] (done:Bool) in
            
            self?.viewBase.viewBar.searchBar.becomeFirstResponder()
        }
    }
    
    func animateHide()
    {
        viewBase.layoutTop.constant = -viewBase.kHeight
        
        UIView.animate(withDuration:kAnimationDuration)
        { [weak self] in
            
            self?.layoutIfNeeded()
        }
    }
}

Make search bar first responder on appear
Make search bar first responder on appear
