qmathe / DropDownMenuKit

UIKit drop down menu, simple yet flexible and written in Swift
Other
303 stars 38 forks source link

Check for empty cells is missing from pod install version in DropDownMenu class #22

Closed hamtiko closed 5 years ago

hamtiko commented 6 years ago

Hello,

Thanks for nice lib. Yesterday I have faced following issue. In the GitHub version in master branch I have noticed that in DropDownMenu.swift file line 156 there is if statement for checking empty cell case before scrolling tableview:

    contentView.frame.size.height = menuView.frame.height

    // Reset scroll view content offset after rotation
    if menuView.visibleCells.isEmpty {
            return
        }
    menuView.scrollToRow(at: IndexPath(row: 0, section: 0), at: .top, animated: false)

But when I have pod install on my project I notice that this statement is missing from source code and it cause exception at runtime when DropDownMenu does not have any cell.

Could you please help me get last version via pod install?

My podfile is: pod 'DropDownMenuKit'

tigran-stdev commented 6 years ago

I have found the overcome to this issue. Using git url in podfile will force pod to use latest version from master branch:

pod 'DropDownMenuKit', :git => 'https://github.com/qmathe/DropDownMenuKit.git'

qmathe commented 5 years ago

Hi,

I made a new release 0.8.5 for Swift 4.1 that includes this fix. For Swift 4.2 support, you can use master as suggested by @tigran-stdev. I'm going to make a new release soon based on master.