Skip to content

iOSLabUNAM/protocols-exercises

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Protocol Exercises

First Challenge

The printTable(_:) function has a bug: It crashes if any of the data items are longer than the label of their column. Try changing the age of a person to 1,000 to see this happen. Fix the bug.

Note

Your solution will likely result in incorrect table formatting; that is fine for now. You will fix the formatting in the gold challenge, below.

Second Challenge

Create a new type, BookCollection, that conforms to TabularDataSource. Calling printTable(_:) on a book collection should show a table of books with columns for titles, authors, and average reviews.

Note

Unless all the books you use have very short titles and author names, you will need to have completed the previous challenge!

Third Challenge (optional)

After you fixed the crashing bug in the first challenge, the table rows and columns were likely misaligned. Fix your solution to correctly align the table rows and columns. Verify that your solution does not crash with values longer than their column labels.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages