Post

Replies

Boosts

Views

Activity

Reply to How to properly "Delete a row from a tableView" using trailingSwipeActionsConfiguration
Found my solution! override func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationsForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? { let deleteAction = UIContextualAction(style: .destructive, title: "Delete") { (action, sourceView, completionHandler) in if let appDelegate = (UIApplication.shared.delegate as? AppDelegate) { let context = appDelegate.persistentContainer.viewContext let inspectionsToDelete = self.fetchResultController.object(at: indexPath) context.delete(inspectionsToDelete) appDelegate.saveContext() } completionHandler(true) }
Mar ’22
Reply to Firing a Timer & Resigning the keyboard after a number of characters have been entered(19)
Hi Claude, yes I use the software keyboard, I originally had "if let characterCount = textField.text?.count" but changed it thinking that was an issue. I did add the "print", to my surprise it counted 27 'Count" With your changes above it now works flawless I appreciate your help on this Thank you!
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Mar ’24
Reply to How to properly "Delete a row from a tableView" using trailingSwipeActionsConfiguration
Found my solution! override func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationsForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? { let deleteAction = UIContextualAction(style: .destructive, title: "Delete") { (action, sourceView, completionHandler) in if let appDelegate = (UIApplication.shared.delegate as? AppDelegate) { let context = appDelegate.persistentContainer.viewContext let inspectionsToDelete = self.fetchResultController.object(at: indexPath) context.delete(inspectionsToDelete) appDelegate.saveContext() } completionHandler(true) }
Replies
Boosts
Views
Activity
Mar ’22
Reply to How to properly "Delete a row from a tableView" using trailingSwipeActionsConfiguration
Thanks for any help getting me in the right direction. Drew
Replies
Boosts
Views
Activity
Mar ’22
Reply to UITableViewRowAction Deprecated
Starting a new post]
Replies
Boosts
Views
Activity
Mar ’22
Reply to Using NSSortDescriptor(key: "date", ascending: true
Forgot to mention, I am using datePickerStyle = .wheels
Replies
Boosts
Views
Activity
Feb ’22