 import UIKit
 
 class PlaylistTableViewController: UITableViewController, UIAlertViewDelegate {
+    let NEW_PLAYLIST_INDEX = -1
     enum Section: Int {
         case Playing     = 0
         case Reading     = 1

        if index >= 0 {
            playlists[index].title = newTitle
            PlaylistStore.save(playlists[index])
        } else {
            let playlist = Playlist(title: newTitle)
            playlists.append(playlist)
            PlaylistStore.save(playlist)

    }

    func updateNavbar() {
        let newPlaylistButton = UIBarButtonItem(image: UIImage(named: "add_stream"),
                                                style: UIBarButtonItemStyle.Plain,
                                               target: self,
                                               action: "newPlaylist")
        navigationItem.rightBarButtonItems = [newPlaylistButton]
    }

    func newPlaylist() {
        showTitleEditAlertViewAtIndex(NEW_PLAYLIST_INDEX)
    }

    func showPlayingPlaylist() {
