Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MazenKilani/054404fa7eacd9c420fa3a732ec63e4b to your computer and use it in GitHub Desktop.
Save MazenKilani/054404fa7eacd9c420fa3a732ec63e4b to your computer and use it in GitHub Desktop.
BooksByPublicationYearTableViewController
class BooksByPublicationYearTableViewController: UITableViewController {
var queryBooks: [Book] = []
var queryTitle = "Pub Year"
// Section Headers; we need 3 arrays
var sectionHeaderTitles = [String]() // string array of section headers (Pub Years)
var sectionBooks = [Book]() // array of one section
var sectionBooksArrays = [[Book]]() // array of arrays, each array is one section books
let dateFormatter = DateFormatter() // Needed to extract the Year from Publication Date
var priorBook = Book()
var priorBookSection: String = ""
var firstTimeInLoop = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment