samedi 11 août 2018

Swift: Checkbox insertion button in UITextView of a UITableViewCell

Introduction

Context:

I am working on one of my first own apps, a sort of note-taking app.

The basic framework is simple: I have a UITableView with cells in them with a few design elements and a large UITextView which the user can write their notes into.

Issue:

  • I would like to implement the checkbox feature, similarly to what Apple has in their app "Notes". I want it to be a "part" of the text, so its erasable by hitting the erase on the keyboard.

  • I have checked many posts on creating checkboxes, but none to actually implement them as a text in a UITextView.

My try:

Basically I have tried by creating a UIButton with different images for .normal and .selected state. But I don't know how to make it a part of the UITextViews text, which leads me to believe there is a better approach, but I cant figure out how.

Question:

How do I either implement a checkbox (from a UIButton with .normal and .selected state images) as a part of my TextView, OR create some kind of extension for the keyboard to have a checkbox key?

  • How would you suggest that I approach this?

Thanks for reading my post.




Aucun commentaire:

Enregistrer un commentaire