 
     @IBInspectable public var constantText: String = "" {
         didSet {
-            // Update placeholder to get the new value of constantText
+            // Force update placeholder to get the new value of constantText
             if let holder = placeholder {
                 placeholder = holder + ""
             } else {
                 placeholder = ""
             }
-
         }
     }
 
-    // FIX: Do we need @IBInspectable? Or normal placeholder just works.
-    // FIX: Maybe didSet ve willSet kullanilabilir.
-    //        get {
-    //            return _placeholder
-    //        }
-    //        set {
-    //            if let newValue = newValue {
-    //                _placeholder = newValue
-    //                super.placeholder = _placeholder + constantText
-    //            }
-    //        }
-
+    // Investigate if we really need @IBInspectable. Maybe super.placeholder in the storyboard is enough.
     @IBInspectable public override var placeholder: String? {
         didSet {
             if let holder = placeholder {

    }

    func commonInit() {
//        NSNotificationCenter.defaultCenter().addObserver(self, selector: "textChanged:", name:
//            UITextFieldTextDidChangeNotification, object: self)

        addTarget(self, action: "textChanged:", forControlEvents: .EditingChanged)

    }

    func textChanged(sender: UITextField) {
//
//        // start state
        if count(text) == 1 {
            text = text + constantText
            let beginning = beginningOfDocument
            goToTextPosition(beginning)
        }
//            else if range.location == 0 && range.length == 1 {
//            textField.text = ""
//
//        }
        else {
            var reversedText = reverse(text)
            var i = 0
            for char in reverse(constantText) {
                if reversedText[advance(reversedText.startIndex, i)] != char {
                    reversedText.removeAtIndex(i)
                    text = String(reversedText)
                    let placeholderStartingTextPosition = positionFromPosition(endOfDocument, offset: -count(constantText))
                    goToTextPosition(placeholderStartingTextPosition)
                    break
                }
                i += 1
            }


        }
//        let constantStartIndex = count(text) - count(constantText)
        // Don't change constantPlaceholder
//        if range.location > constantStartIndex {
//            let placeholderStartingTextPosition = textField.positionFromPosition(textField.endOfDocument, offset: -count(constantPlaceholder))
//            goToTextPosition(placeholderStartingTextPosition)
//            return false
//        }



    }

    func goToTextPosition(textPosition: UITextPosition!) {
        selectedTextRange = textRangeFromPosition(textPosition, toPosition: textPosition)
    }


    
//    func textChanged(notification: NSNotification) {
//        NSNotificationCenter.defaultCenter().removeObserver(UITextViewTextDidChangeNotification)
//
//        text = "mert"
//
//
//
//        NSNotificationCenter.defaultCenter().addObserver(self, selector: "textChanged:", name: UITextViewTextDidChangeNotification, object: nil)
//
//    }
//
//    deinit {
//        NSNotificationCenter.defaultCenter().removeObserver(UITextViewTextDidChangeNotification)
//    }
}
        }
    }

    enum TypingState {
        case Start, Typed, TypedEmpty
    }

    var typingState = TypingState.Start

    var beginningOfConstantText: UITextPosition? {
        get {
            return positionFromPosition(endOfDocument, offset: -count(constantText))
        }
    }

    var prevText = ""

    public required init(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
