corin8823 / Popover

Popover is a balloon library like Facebook app. It is written in pure swift.
MIT License
2.11k stars 327 forks source link

how to custumize a cell?? #31

Open shindonghyeok opened 8 years ago

shindonghyeok commented 8 years ago

i hope that i can custumize a cell something like adding subTitle textLabel... imageview .. moreover i want to change size of cell, as so on.... how can i do these things??

AdrianHaubrich commented 6 years ago

That's equal to customizing a normal tableViewCell. Refer to the examples to add the extensions to the ViewController.

In the "UITableViewDataSource Extension" you can add functions like: func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { return //your high as an int }

To and an imageView or label write something like this inside the tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell function: let imageView = UIImageView(frame: CGRect(x: 0, y: 0, width: 50, height: 50)) imageView.image = UIImage(named: yourImageNameAsAString) cell.addSubview(imageView)

I hope that helps everyone who struggles with customizing the tableViewCells inside the popover.