Exact case: I have a tableViewController presented as a popover in my app.
The first cell in the popover has an iCarousel in it (liner to be precise). https://github.com/nicklockwood/iCarousel
Implemented all the datasource and delegate functions. They all get fired...
In iOS 11.2 all work as intended, but in iOS 11.3 the popover doesn't show up the iCarousel items. All the delegates still fire (fe. didSelect; didScroll). In the interface debugger mode I can see the items, but not on device.
Tried to reload the data after the initial setup / tried to remove all images from the item and leave it only with pink background / tried to force set alpha to 1 / tried to bringSubviewToFront / eliminated all background effects / modified the tableViewController to a table View and the cell to a view. Nothing works. The most annoying thing is that it shows in the interface debugger and I can't seem to get it working on the actual device.
Popover Presentation:
let storyboard = UIStoryboard(name: "SomeSTBName", bundle: nil)
let popControllerNav = storyboard.instantiateViewController(withIdentifier: "pTVCIdentifier")
let popController = popControllerNav as! PTVC
popController.dissmissDelegate = self
popController.t = t
popController.modalPresentationStyle = UIModalPresentationStyle.popover
popController.preferredContentSize = CGSize(width: 555, height: 120)
popController.presentedFrom = presentedFrom
popControllerNav.popoverPresentationController?.permittedArrowDirections = [.up, .down]
popControllerNav.popoverPresentationController?.backgroundColor = UIColor(red: 17.0/255.0, green: 17.0/255.0, blue: 71.0/255.0, alpha: 1.0)
popControllerNav.popoverPresentationController?.popoverLayoutMargins = UIEdgeInsets.init(top: 0, left: 100, bottom: 0, right: 0)
popControllerNav.popoverPresentationController?.delegate = self
popControllerNav.popoverPresentationController?.sourceView = mySender // button
popControllerNav.popoverPresentationController?.sourceRect = mySender.bounds
if(NViewController.instance?.pressedS != nil) {
popController.popoverPresentationController?.passthroughViews = [(NViewController.instance?.pressedS)!]
}
// present the popover
self.present(popControllerNav, animated: true, completion: nil)
Cell for row in TVC:
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
var returnCell = UITableViewCell()
if let upperCarousel = tableView.dequeueReusableCell(withIdentifier: "carouselPCell") as? CaruselPCell {
let playlists = CoreDataStack.fetchAllP() as? [UP]
upperCarousel.allP = p
upperCarousel.setup()
upperCarousel.delegate = self
returnCell = upperCarousel
}
return returnCell
}
iCarousel setup:
func setup(){
carusel = iCarousel(frame: CGRect(x: -415, y: 0, width: 950, height: 125))
carusel.scrollSpeed = 0.6
carusel.centerItemWhenSelected = false
carusel.isPagingEnabled = false
carusel.type = .linear
carusel.dataSource = self
carusel.delegate = self
carusel.bounces = false
carusel.reloadData()
carusel.clipsToBounds = true
self.contentView.addSubview(carusel)
}
CGRect(x: -415, y: 0, width: 950, height: 125) because I don't want the first item to be center, but aligned to the left - it doesn't generate the problem had tested