ViewPager-Swift icon indicating copy to clipboard operation
ViewPager-Swift copied to clipboard

App Got Crash

Open arjunshukla22 opened this issue 4 years ago • 2 comments

i have used this library . My App Got crashed in

arjunshukla22 avatar Oct 19 '20 13:10 arjunshukla22

fileprivate func setupBasicTab(condition:SetupCondition, options:ViewPagerOptions, tab:ViewPagerTab) {

    switch condition {
        
    case .fitAllTabs:
        
        buildTitleLabel(withOptions: options, text: tab.title)
        titleLabel?.frame = CGRect(x: 0, y: 0, width: self.frame.size.width, height: self.frame.size.height)
        
    case .distributeNormally:
        
        buildTitleLabel(withOptions: options, text: tab.title)
        
        // Resetting TabView frame again with the new width
        let currentFrame = self.frame
        let labelWidth = titleLabel!.intrinsicContentSize.width + options.tabViewPaddingLeft + options.tabViewPaddingRight
        let newFrame = CGRect(x: currentFrame.origin.x, y: currentFrame.origin.y, width: labelWidth, height: currentFrame.height)
        self.frame = newFrame
        
        // Setting TitleLabel frame
        titleLabel?.frame = CGRect(x: 0, y: 0, width: labelWidth, height: currentFrame.height)
    }
    
    self.addSubview(titleLabel!)
}.                          

arjunshukla22 avatar Oct 19 '20 13:10 arjunshukla22

My live app crashed when I used the library, please resolve it .

arjunshukla22 avatar Oct 19 '20 13:10 arjunshukla22