Table View with sticky cells
Allows to set several levels of stickied cells
import StickyCells
You have to use StickyCellsTableView
and inherit cell class from StickyCellWith<StickyView: UIView>
where StickyView
is actual view that will be displayed in table
class MyStickyCell: StickyCellWith<Label> {}
then, in dequeueReusableCell(withIdentifier identifier: String, for indexPath: IndexPath) -> UITableViewCell
method, call setLevel(_ level: Int?)
on sticky cells
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: reuseIdentifier, for: indexPath)
if let stickyCell = cell as? MyStickyCell {
stickyCell.stickyView.text = "I'm a sticky cell"
stickyCell.setLevel(0)
}
return cell
}
Look at example app source for details
target 'YOUR_TARGET' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
pod 'StickyCells'
end