Last active
May 13, 2018 03:37
-
-
Save an-indya/3526d35ede995184ce0a9d84331d31b1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let books = ["The Great Gatsby by F. Scott Fitzgerald", | |
"The Prince by Niccolo Machiavelli", | |
"Slaughterhouse-Five by Kurt Vonnegut", | |
"1984 by George Orwell", | |
"The Republic by Plato", | |
"Brothers Karamazov by Fyodor Dostoevsky", | |
"The Catcher in the Rye by J.D. Salinger", | |
"The Wealth of Nations by Adam Smith", | |
"For Whom the Bell Tolls by Ernest Hemingway", | |
"The Grapes of Wrath by John Steinbeck", | |
"Brave New World by Aldous Huxley", | |
"How To Win Friends And Influence People by Dale Carnegie", | |
"The Rise of Theodore Roosevelt by Edmund Morris", | |
"Dharma Bums by Jack Kerouac", | |
"Catch-22 by Joseph Heller", | |
"Walden by Henry David Thoreau", | |
"Lord of the Flies by William Golding", | |
"The Master and Margarita by by Mikhail Bulgakov", | |
"Bluebeard by Kurt Vonnegut", | |
"Atlas Shrugged by Ayn Rand", | |
"The Metamorphosis by Franz Kafka", | |
"Another Roadside Attraction by Tom Robbins", | |
"White Noise by Don Delillo", | |
"Ulysses by James Joyce", | |
"The Young Man’s Guide by William Alcott", | |
"Blood Meridian, or the Evening Redness in the West by Cormac McCarthy", | |
"Seek: Reports from the Edges of America & Beyond by Denis Johnson", | |
"Crime And Punishment by Fyodor Dostoevsky", | |
"Steppenwolf by Herman Hesse", | |
"East of Eden by John Steinbeck", | |
"Essential Manners for Men by Peter Post",] | |
var bookObjects = [AnyObject]() | |
func populateBookModel () { | |
books.map { | |
(book: String) -> String in bookObjects.append(Books(bookName: book.componentsSeparatedByString(" by ")[0], author: book.componentsSeparatedByString(" by ")[1])) | |
return book | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment