 
 import UIKit
 
-public class StaticLoadAction: LoadAction<[StaticTableItemProtocol]> {
+public class StaticLoadAction: LoadAction<StaticContent> {
     
-    public typealias StaticItemsResultType    = Result<[StaticTableItemProtocol], ErrorType>
-    public typealias StaticItemsResultClosure = (result: StaticItemsResultType) -> Void
-    public typealias StaticItemsResult        = (completion: StaticItemsResultClosure) -> Void
+    public typealias StaticContentResultType    = Result<StaticContent, ErrorType>
+    public typealias StaticContentResultClosure = (result: StaticContentResultType) -> Void
+    public typealias StaticContentResult        = (completion: StaticContentResultClosure) -> Void
     
-    /**
-     Quick initializer with all closures
-     
-     - parameter load: Closure to load from web, must call result closure when finished
-     - parameter delegates: Array containing objects that react to updated data
-     */
     public init(
-        staticItems: StaticItemsResult,
+        staticItems: StaticContentResult,
         delegates:   [LoadActionDelegate] = [],
         dummy:       (() -> ())? = nil)
     {

}


// Section Management
//public class StaticItemSection {
//    var header:  String?
//    var items: [StaticTableItem]!
//    func append(item: StaticTableItem) {
//        items.append(item)
//    }
//    init(header: String? = nil, items: [StaticTableItem]? = nil) {
//        self.header = header
//        self.items = items ?? [StaticTableItem]()
//    }
//}
//public func += (inout left: [StaticItemSection], right: StaticItemSection?) {
//    if let right = right { left.append(right) }
//}
//public func += (inout left: StaticItemSection, right: StaticTableItem?) {
//    if let right = right { left.append(right) }
//}



// Default cell
public protocol StaticTableItemProtocol {
    
}

public class StaticTableItem<C: UITableViewCell>: StaticTableItemProtocol {
    public var cellIdentifier: String
    public var customization: ((cell: C) -> Void)?
    public var onSelection:   ((cell: C) -> Void)?
    public var onAction:      ((cell: C) -> Void)?
    public init(cellIdentifier: String) {
        self.cellIdentifier = cellIdentifier
    }

    public override class func defaultIdentifier() -> String { return "ButtonStaticTableViewCell" }
    public override func setSelected(selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)
        contentItem.doOnAction(cell: self)
    }
}
public class SwitchStaticTableViewCell: TextStaticTableViewCell {
    public override class func defaultIdentifier() -> String { return "SwitchStaticTableViewCell" }
    @IBOutlet weak var switchView: UISwitch?
    public override var contentItem: StaticContentItemProtocol! {
        didSet {
            switchView?.setAction(controlEvents: .ValueChanged, action: { (sender) in
                self.contentItem.doOnAction(cell: self)
            })
        }
    }
}

//public class SACheckTableViewCell: SATitleTableViewCell {
//    //@IBOutlet weak var checkView: UIImageView?
//    public override var tableObject: SATableObject! {
