Exercises

Here are some exercises to apply what you’ve learned and to make the library more useful:

  1. If the text of a log entry doesn’t fit on one line, the text is truncated. Change the code in tableView(_:cellForRowAt:) to allow wrapping of longer log entries.

  2. To make the log look more like the debug output in Xcode, remove the cell separators.

  3. Add the time to the log entries.

  4. Make LogStore conform to the protocol Codable and write the log to a file when the app is closed.

  5. Sometimes it’s useful to have the log on your Mac for further investigation. Add the feature to send the log via email.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.21.76.0