0
1

|

    1

    1

    var isSegmentedHidden = false
    func scrollViewDidScroll(_ scrollView: UIScrollView) {
    
        if scrollView.contentOffset.y < 50.0 && isSegmentedHidden{ //Here 50.0 is the height of your segmented control plus vertical padding if any.
    
            isSegmentedHidden = false
    
            //Call your function here, once segmented control is visible
        }
    
        if scrollView.contentOffset.y >= 50.0 && isSegmentedHidden == false{ //Here 50.0 is the height of your segmented control plus vertical padding if any.
    
            isSegmentedHidden = true
    
            //Call your function here, once segmented control is invisible
        }
    
    }
    
    |
    • 1