 
 import UIKit
 
+protocol OLScrollingNavBarDelegate {
+    func navBarItemSelected()
+}
+
+private extension Selector {
+    static let navBarItemSelected = #selector(OLScrollingNavBar.navBarItemSelected)
+}
+
 class OLScrollingNavBar: UIScrollView {
+
+    struct Configuration {
+        var backgroundColor: UIColor = .red
+        var textColor: UIColor = .white
+        var horizontalInsets: UIEdgeInsets = UIEdgeInsetsMake(0, 20, 0, 20)
+    }
+
+    var scrollingNavBarDelegate: OLScrollingNavBarDelegate?
 
     var barItems: [String] = [] {
         didSet {

        }
    }

    func updateItems() {
        var xPos: CGFloat = 0

        for (index, item) in barItems.enumerated() {
            // Initialize and configure button.
            let button = UIButton(type: .custom)
            let color: CGFloat = (CGFloat(index) * CGFloat(20)) / 255.0
            button.setTitle(item, for: .normal)
            button.setTitleColor(.red, for: .normal)
            button.contentEdgeInsets = UIEdgeInsetsMake(0, 20, 0, 20)
            button.backgroundColor = UIColor(red: color, green: color, blue: color, alpha: 1.0)

            // Size and position button.
            button.sizeToFit()

        contentSize = CGSize(width: xPos, height: 44)
        backgroundColor = UIColor.green
    }
}
