VLCEditToolbar.swift 1.05 KB
Newer Older
Soomin Lee's avatar
Soomin Lee committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
/*****************************************************************************
 * VLCEditToolbar.swift
 *
 * Copyright © 2018 VLC authors and VideoLAN
 * Copyright © 2018 Videolabs
 *
 * Authors: Soomin Lee <bubu@mikan.io>
 *
 * Refer to the COPYING file of the official project for license.
 *****************************************************************************/

protocol VLCEditToolbarDelegate: class {
    func delete()
    func createPlaylist()
    func rename()
}

// Decided to use a UIView instead of UIToolbar because we have more freedom
// FIXME: Basic structure without UI
class VLCEditToolbar: UIView {
    weak var delegate: VLCEditToolbarDelegate?

    @objc func createFolder() {
        delegate?.createPlaylist()
    }

    @objc func deleteSelection() {
        delegate?.delete()
    }

    @objc func renameSelection() {
        delegate?.rename()
    }

    override init(frame: CGRect) {
        super.init(frame: frame)
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}