LFTimePicker
LFTimePicker copied to clipboard
iPad issue
Hello, i am actually using this awesome library in my project. I am almost done with it, but on the iPad, i experiencing an issue, which i dont know how to solve... Seems like the scrolling, does not work properly. On the iPhone, it works like i do expect while on iPad, i cannot scroll to the last rows of the picker. Do you have any solution for this? Thanks in advance
Hi @siideffect thanks for reporting this bug. Can you attach a screenshot or more details for us?
Hi @vsouza , thanks for your reply. Unfortunately i cannot post a ss because i decided to dive into library code and i found a workaround for this issue. The error is relative to tableview frames. You should be able to reproduce the issue running the project on iPad, i hope so. By the way, the (not elegant for sure, but working) workaround, was to detect if we are on an ipad or on an iphone, and change the frame according to that. Here the func setupTables, which i edited on the first part (rest has not been changed):
`
fileprivate func setupTables() {
let frame1 : CGRect
let frame2 : CGRect
if view.isIpad{
let s:CGFloat = view.bounds.height/2
frame1 = CGRect(x: 30, y: 0+s/2, width: 100, height: self.view.bounds.height-s)
frame2 = CGRect(x: self.view.frame.width - 100, y: 0+s/2, width: 100, height: self.view.bounds.height-s)
}else{
frame1 = CGRect(x: 30, y: 0, width: 100, height: self.view.bounds.height)
frame2 = CGRect(x: self.view.frame.width - 100, y: 0, width: 100, height: self.view.bounds.height)
}
leftTimeTable = UITableView(frame: frame1, style: .plain)
rightTimeTable = UITableView(frame: frame2, style: .plain)
..........
} `