rechsteiner / Parchment

A paging view with a highly customizable menu ✨
MIT License
3.35k stars 417 forks source link

Getting Fatal error while using storyboard more than 2 . Unable to reload 3rd storyboard table view #686

Closed Faizulkarim closed 1 year ago

Faizulkarim commented 1 year ago
       let storyboard = UIStoryboard(name: "OrderListStoryBoard", bundle: nil)
    allOrder = storyboard.instantiateViewController(withIdentifier: "allOrder") as? AllOrderViewController
    orderPlaced = storyboard.instantiateViewController(withIdentifier: "orderPlaced") as? OrderPlacedViewController       
    orderConfirmed = storyboard.instantiateViewController(withIdentifier: "orderConfirmed") as? OrderConfirmedViewController
pagingViewController = PagingViewController(viewControllers: [
        allOrder!
        orderPlaced!
        orderConfirmed!
    ])
func addData(data: MyOrdersResponseData?) {
    self.allOrder?.displayModel.myOrderData = data
    self.allOrder?.tableView.reloadData()

    if let content = self.display model.myOrderData?.content {

        let filteredArray = content.filter { $0.orderStatus == "placed" }
        self.orderPlaced?.displayModel.orderPlacedData = filteredArray
        self.orderPlaced?.tableView.reloadData()

         let confrimedData = content.filter { $0.orderStatus == "confirmed" }
        self.orderConfirmed?.displayModel.orderConfirmedData = confirmed data
        self.orderConfirmed?.tableView.reloadData() **// Getting error here (Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value)** 
 }

}

Note: if I change the position of orderConfirmed 2 to 1 then getting an error on self.orderPlaced?.tableView.reloadData(). So basically 3rd viewcontroller table view reloading gives an error.

rechsteiner commented 1 year ago

Hi @Faizulkarim! This doesn't sound like an issue with Parchment to me, but rather an issue with your table view configuration. If you think it's actually a Parchment issue, it would be nice if you could try to narrow down the bug, ideally providing a minimal set of steps to reproduce. Thanks!