Post

Replies

Boosts

Views

Activity

Reply to Disable Scribble in UITextView
Adding a UIScribbleInteraction on a UITextView and returning false for scribbleInteraction(_:shouldBeginAt:) seems to be the official way to do this. To prevent the input widget from showing up you can set UITextView.inputView. If you do not want any view to show up you can specify an empty UIView via setting textView.inputView = UIView().
Topic: App & System Services SubTopic: General Tags:
Oct ’21
Reply to tableView.indexPathForRow(at: to:) returning an index that is off by one.
indexPathForRow uses a CGPoint to determine the corresponding cell indexPath. You are using sender.convert(CGPoint.zero, to: self.tableView) where sender is your button, which corresponds to the top left point of your button in tableView coordinates. Are you sure this point is in the apporpriate cell you want it to be? Also: The CGPoint you use for indexPathForRow needs to be in the contentView of the appropriate cell, so for example a point with negative x value won't work.
Topic: UI Frameworks SubTopic: UIKit Tags:
Oct ’22
Reply to tableView.indexPathForRow(at: to:) returning an index that is off by one.
As there has been no activity on this thread I post my original comment as a reply as I am pretty sure this is the solution to the problem of the thread starter: indexPathForRow uses a CGPoint to determine the corresponding cell indexPath. The point you are using sender.convert(CGPoint.zero, to: self.tableView) where sender is your button, which corresponds to the top left point of your button in tableView coordinates. This point probably is not in the cell you want it to be. So make sure your button has the appropriate frame or transform the point you use to be in the appropriate cell after transformation (maybe you want to project it onto the cell's contentView frame). Also: The CGPoint you use for indexPathForRow needs to be in the contentView of the appropriate cell, so for example a point with negative x value won't work. Again, projecting the point onto the appropriate cell's contentView frame should help in that case.
Topic: UI Frameworks SubTopic: UIKit Tags:
Oct ’22
Reply to Disable Scribble in UITextView
Adding a UIScribbleInteraction on a UITextView and returning false for scribbleInteraction(_:shouldBeginAt:) seems to be the official way to do this. To prevent the input widget from showing up you can set UITextView.inputView. If you do not want any view to show up you can specify an empty UIView via setting textView.inputView = UIView().
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to How can I add a "Create Document" option to UIDocumentPickerViewController?
I would like to know the same thing. In general I could not find much about customization options of UIDocumentPickerViewController.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Feb ’22
Reply to tableView.indexPathForRow(at: to:) returning an index that is off by one.
indexPathForRow uses a CGPoint to determine the corresponding cell indexPath. You are using sender.convert(CGPoint.zero, to: self.tableView) where sender is your button, which corresponds to the top left point of your button in tableView coordinates. Are you sure this point is in the apporpriate cell you want it to be? Also: The CGPoint you use for indexPathForRow needs to be in the contentView of the appropriate cell, so for example a point with negative x value won't work.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Oct ’22
Reply to GPU is too weak on Macbook Pro M1 for gaming
I am pretty sure it has to do with Warcraft 3 not being optimized at all for running on M1.
Topic: App & System Services SubTopic: Hardware Tags:
Replies
Boosts
Views
Activity
Oct ’22
Reply to tableView.indexPathForRow(at: to:) returning an index that is off by one.
As there has been no activity on this thread I post my original comment as a reply as I am pretty sure this is the solution to the problem of the thread starter: indexPathForRow uses a CGPoint to determine the corresponding cell indexPath. The point you are using sender.convert(CGPoint.zero, to: self.tableView) where sender is your button, which corresponds to the top left point of your button in tableView coordinates. This point probably is not in the cell you want it to be. So make sure your button has the appropriate frame or transform the point you use to be in the appropriate cell after transformation (maybe you want to project it onto the cell's contentView frame). Also: The CGPoint you use for indexPathForRow needs to be in the contentView of the appropriate cell, so for example a point with negative x value won't work. Again, projecting the point onto the appropriate cell's contentView frame should help in that case.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Oct ’22