-1

I developed a game and I have a text list. I want to display this text list on tableview cells line by line.

I can display one line on tableview cells. And when the app is on background, I want to display the next line on this text list with local notification. When scheduled local notification is clicked or displayed, and when the app is in the foreground, I want to see that lines. How can I do this?

Edit: I expand my question. I have a text list like this:

Line1: Body: "Hi, I am here" , FireDate: 2 seconds Line2: Body: "Where are you" , FireDate: 5 seconds I want to show only "body" content if App is on foreground. And after "firedate" i want to Show the next line on tableview. If App is on background, i want to Show and schedule these lines by local notifications with these firedates. If user opens App, i want to Show these lines in tableview cells.

I know that this question is about local notifications and tableviews. Not for one. Because i dont know where i should start and go. With local notifications or tableviews? I mean that shoul i write the code for tableview and then schedule local notifications? Or together?

  • This question is too broad. This site is for asking specific questions, not "how do I build an app that does X, Y, then Z". Start by finding a tutorial on UITableView and then if you get stuck and have a specific question that your searches don't seem to solve, then post that question here. – Smartcat Aug 13 '17 at 03:49
  • Thank you. But i know that how this site works. I did say that i can use tableview too. My question is about local notification with a text list. – user3352895 Aug 13 '17 at 10:48
  • I expand my question. – user3352895 Aug 17 '17 at 18:32

1 Answers1

0

Learn and set up your local notification system first. Create your model class(es), send out a local notification, then handle capturing what the user did in the local notification and update your model classes as a result. Focus on that and get it fully working. Add some very simple temporary UI to your app so you can see the results, or simply print messages to console is fine. Dealing with how to reflect your model into a view such as a tableView is completely orthogonal and thus separately solvable. It shouldn't affect your local notification design at all.

Smartcat
  • 2,834
  • 1
  • 13
  • 25
  • Ok i understand. So i start to learn a database solution. I choose Realm. Because i have to write and read some data on disk. For contiuning App from the last text line. But i did not understand that what you mean exactly. Can you show me an example? – user3352895 Aug 18 '17 at 12:34
  • Here are some local notification tutorials: [Local Notifications Tutorial](https://www.ioscreator.com/tutorials/local-notification-tutorial-ios10) and also [Local Notifications with the User Notifications Framework](https://cocoacasts.com/local-notifications-with-the-user-notifications-framework/) – Smartcat Aug 19 '17 at 04:44
  • Thank you, but i know that how local notifications work. I mean that model classes. – user3352895 Aug 21 '17 at 11:29
  • Your question didn't even refer to model classes. So what have you designed so far? – Smartcat Aug 22 '17 at 02:46
  • Can you show me an example code that how can i code this? I read https://www.raywenderlich.com/160651/design-patterns-ios-using-swift-part-12 And i learn something. I also know these. – user3352895 Aug 29 '17 at 19:57