Post

Replies

Boosts

Views

Activity

Comment on How to save and load text & images in DocumentsDirectory
Long story short: I end up using NSTextAttachment to saveImages on the phone. To keep track the image (cursor) location in textView, I actually saved the cursor location in table as well (var imageLocation: [String] so that I can load it back to the same location in textView. Yes, I kept the image size small, but looks pretty good on the phone. It works well for me, but Not Perfect.
Topic: Programming Languages SubTopic: Swift Tags:
Sep ’22
Comment on TableView editingStyle
Q: on moveRowAt, I can move element within section: let movedTrade = sections[fromIndexPath.section].sectionTrades.remove(at: fromIndexPath.row)         sections[to.section].sectionTrades.insert(movedTrade, at: to.row) How do I move in self.trades?
Topic: Programming Languages SubTopic: Swift Tags:
May ’22
Comment on TableView editingStyle
I'm running into an interesting problem: After Add working by calling grouping.., but tableView will bring all deleted element back (as well as newly added), I can delete again, but every time I add a new item, all deleted are back, and moved items are back to original position as well. I can't figure it our....
Topic: Programming Languages SubTopic: Swift Tags:
May ’22
Comment on TableView editingStyle
One final issue: Now I have problem to insert a new row. I use AlertController to get the new trade info, it may or may not be the (section) symbol already exist. I use self.tableView.append(newTrade) it does not thing at all, but when check trades.count confirms it did added to trades. Thank you!
Topic: Programming Languages SubTopic: Swift Tags:
May ’22