tableviewcell

Show ViewController from XIB-file-Button - Swift

五迷三道 提交于 2019-12-03 08:23:30
is there a way how to segue from a xib-file (custom TableViewCell) to another ViewController in the Main.storyboard. There's no possibility to drag a segue, like within the main storyboard. In the cell I've got a button, from where I want to change the view. How can I solve it? Thanks! You can always instantiate a view controller from your Storyboard and present it on button tapped: let storyboard = UIStoryboard(name: "Main", bundle: nil) let vc = storyboard.instantiateViewControllerWithIdentifier("ViewControllerID") as UIViewController self.presentViewController(vc, animated: true, completion

Checkmark on static cells uitableview

白昼怎懂夜的黑 提交于 2019-12-03 06:57:50
I'm using a UITableView, with 3 sections ( Static Cells ) Currency Language Social They have different number of rows: Currency has 3 rows ( USD, EUR, JPY ) Language has 2 rows ( EN, JP ) Social has 3 rows ( Twitter, FB, Line ) Right now, I have by default set a checkmark at the first row of every section. However, I would like to allow the user to set their default settings and change the checkmark accordingly based on what they have set. My question is then how do I set the checkmark for 3 different sections each with varying number of rows? Do I need to set an cell identifier for each

Swift - Fading cells in UITableView

不打扰是莪最后的温柔 提交于 2019-12-03 03:28:48
I'm having troubles with my UITableView in swift on Xcode 6 : I would like my UITableView cells to fade in / out when appearing / disappearing. I looked a lot on the web for fade animations but I didn't find what I wanted because it's based on duration animations. I Think what I need is sort of mask based on alpha ? I'm not sur and I don't even know have to create one... I have a UIViewController containing a tableView and some blank space (for now) upside and downside of the UITableView. Thank's for your help !! Best, Anatole animateWithDuration seems appropriate, since the fade in/out has a

No index path for table cell being reused

风格不统一 提交于 2019-12-02 22:53:46
This started to happen out of the blue. Any ideas: Code: CUSTOMCLASSNAME (I have replaced the actual class name as it contains the name of the client.) Initialising my tableView: [self.tableView registerClass:[CUSTOMCLASSNAME class] forCellReuseIdentifier:[self reuseIdentifier]]; In cell for row: Hi, the title is being printed in the console. This is my cellForRow: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { AVTCheckListTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:[self reuseIdentifier] forIndexPath:indexPath];

Reusing cell doesn't work well - TableView

放肆的年华 提交于 2019-12-02 15:57:51
问题 I have a problem about my cell's button. In my tableView each row is composed by: an image, some labels and a button. The button has a checkmark image. When it is clicked, the button's image changes. The problem is that also another button's image changes without reason. This mistake happens because my cell is reused. I have tried to use prepareForReuse method in TableViewCell but nothing happens. I've also tried with selectedRowAt but I didn't have any results. Please help me. Image 1: Image

Reusing cell doesn't work well - TableView

大城市里の小女人 提交于 2019-12-02 08:17:53
I have a problem about my cell's button. In my tableView each row is composed by: an image, some labels and a button. The button has a checkmark image. When it is clicked, the button's image changes. The problem is that also another button's image changes without reason. This mistake happens because my cell is reused. I have tried to use prepareForReuse method in TableViewCell but nothing happens. I've also tried with selectedRowAt but I didn't have any results. Please help me. Image 1: Image 2: This is my func in my custom Cell: override func prepareForReuse() { if checkStr == "uncheck"{ self

UITableView Delete Row

青春壹個敷衍的年華 提交于 2019-12-02 04:36:15
问题 I am making a table view and I want to make a function where you can delete a row by swiping right and tapping the delete button. Me and my teacher have tried for about half an hour to fix this problem but nothing seems to work. import UIKit class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource { var StoredValues = Values() override func viewDidLoad() { super.viewDidLoad() } override func didReceiveMemoryWarning() {// super.didReceiveMemoryWarning() } func

UITableView Delete Row

自古美人都是妖i 提交于 2019-12-02 02:44:55
I am making a table view and I want to make a function where you can delete a row by swiping right and tapping the delete button. Me and my teacher have tried for about half an hour to fix this problem but nothing seems to work. import UIKit class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource { var StoredValues = Values() override func viewDidLoad() { super.viewDidLoad() } override func didReceiveMemoryWarning() {// super.didReceiveMemoryWarning() } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { return

Transform a horizontal table row into a vertical one

时间秒杀一切 提交于 2019-12-02 02:16:22
问题 I am using CodeIgniter 2.1.0 and MySQL. I want to display a horizontal data row as a vertical one. When I fetch a single row from the database and echo it, it looks like ---------------------------------------- id | name | address | email | ---------------------------------------- 1 | Foo | Bar | foo@bar.com | ---------------------------------------- I have used CodeIgniters table library to generate the above table. instead of this, I want it show like this: ------ id : 1 name: foo address :

ios 8 swift - how to add footer for tableview using separate datasource

别等时光非礼了梦想. 提交于 2019-12-01 22:06:34
问题 For 2 days I'm trying to solve this. I just want to add a footer (custom cell) to my tableview. I have a view with some stuff on it (labels, buttons) and I've added a tableview. To have a clean controller, for the datasource I'm using a separate file: class MyDataSource: NSObject, UITableViewDataSource, UITableViewDelegate { ... } In my controller I have : class MyViewController: UIViewController { @IBOutlet weak var myButton: UIButton! var myDatasource: MyDataSource! @IBOutlet weak var