 	
 }
 
-class STBTableViewIndex: UIControl {
-	
-	weak var delegate: STBTableViewIndexDelegate!
+public class STBTableViewIndex: UIControl {
+	
+	public weak var delegate: STBTableViewIndexDelegate!
 	private var panGestureRecognizer: UIPanGestureRecognizer!
 	private var tapGestureRecognizer: UITapGestureRecognizer!
 	
-	var currentIndex = 0
-	var currentTitle: String { return titles[currentIndex] }
-	
-	var view = UIView(frame: CGRectZero)
-	
-	var titles: Array<String> {
-	didSet {
-		createLabels()
-	}
-	}
-	
-	var autoHides = true
-	var visible: Bool {
-	didSet {
-		UIView.animateWithDuration(0.2, animations: { [unowned self] in
-			self.view.alpha = self.visible ? 1.0 : 0.0
-		})
-	}
-	}
-	
-	var labels = Array<UILabel>()
+	public var currentIndex = 0
+	public var currentTitle: String { return titles[currentIndex] }
+	
+	public var view = UIView(frame: CGRectZero)
+	
+	public var titles: Array<String> {
+		didSet {
+			createLabels()
+		}
+	}
+	
+	public var autoHides = true
+	public var visible: Bool {
+		didSet {
+			UIView.animateWithDuration(0.2, animations: { [unowned self] in
+				self.view.alpha = self.visible ? 1.0 : 0.0
+			})
+		}
+	}
+	
+	public var labels = Array<UILabel>()
 	
 	private var width: CGFloat { return 16.0 }
 	private var horizontalPadding: CGFloat { return 5.0 }

import Foundation
import UIKit

let STBTableViewIndexLayoutDidChange = UIDeviceOrientationDidChangeNotification

protocol STBTableViewIndexDelegate: NSObjectProtocol {
	
	func tableViewIndexChanged(index: Int, title: String)
	

		}
	}
	
	public func hideIndex() {
		visible = false
	}
	
	public func showIndex() {
		visible = true
	}
	
	public func flashIndex() {
		view.alpha = 1.0
		NSTimer.scheduledTimerWithTimeInterval(1.0, target: self, selector: "hideIndex", userInfo: nil, repeats: false)
	}
	
	public override func touchesBegan(touches: NSSet, withEvent event: UIEvent) {
		let touch = touches.anyObject() as UITouch
		let location = touch.locationInView(self)
		setNewIndex(point: location)
