I am having a problem with implementing the swipeMenuView into my project. When first loading the NotificationsViewController it shows the cell I want fine, however, when I start scrolling/tapping or doing anything the whole table resets and removes the cell along with changing the cell height to default. I have a feeling it is the way I am implementing the swipeMenuView.
Here is what it looks like when first loading:
and after touching or scrolling the view:
The way I implement:
`import SwipeMenuViewController
class NotificationsViewController: UIViewController {
@IBOutlet weak var swipeMenuView: SwipeMenuView! {
didSet {
swipeMenuView.delegate = self
swipeMenuView.dataSource = self
var options: SwipeMenuViewOptions = .init()
options.tabView.style = .segmented
options.tabView.additionView.backgroundColor = UIColor.black
options.tabView.itemView.textColor = UIColor.darkGray
options.tabView.itemView.selectedTextColor = UIColor.black
swipeMenuView.reloadData(options: options)
}
}
var tabTitles: [String] = ["All", "Friend Requests", "Items"]
var requests = [User]()
override func viewDidLoad() {
super.viewDidLoad()
self.observeRequests()
}
func observeRequests() { //This just gets the friends requests of that user, there are no problems here
currentUser.addRequestObserver { (user) in
if self.requests.filter({ $0.uid == user.uid }).first != nil {
print("found the request in the array")
} else {
self.requests.insert(user, at: 0)
self.swipeMenuView.reloadData()
}
}
}
}`
I am having a problem with implementing the swipeMenuView into my project. When first loading the
NotificationsViewController
it shows the cell I want fine, however, when I start scrolling/tapping or doing anything the whole table resets and removes the cell along with changing the cell height to default. I have a feeling it is the way I am implementing the swipeMenuView.Here is what it looks like when first loading:
and after touching or scrolling the view:
The way I implement:
The delegate and data source
Inside of
NotificationsContentTable()