     }
 
     /// The text's margin right.
-    @IBInspectable public var marginRight: CGFloat {
+    @IBInspectable open var marginRight: CGFloat {
         get {
-            if defaultMode && self.clearButtonMode != .Never {
+            if defaultMode && self.clearButtonMode != .never {
                 return 24.0
             } else {
                 return textMarginRight

import UIKit

@IBDesignable
public class BetterTextField: UITextField {

    /// A buffer for the placeholder's text.
    private var placeholderText: String?

    /// Determines if the user manually changed the text margins.
    private var defaultMode = true

    /// The text's margin left manually set by the user.
    private var textMarginLeft: CGFloat = 7.0

    /// The text's margin right manually set by the user.
    private var textMarginRight: CGFloat = 7.0

    /// The text's margin left.
    @IBInspectable public var marginLeft: CGFloat {
        get {
            if defaultMode && self.clearButtonMode != .Never && self.textAlignment == .Center {
                return 24.0
            } else {
                return textMarginLeft

     * Removes the placeholder text when text field becomes first responder to avoid cursor jumping,
     * if text alignment is set to centered.
     */
    override open func becomeFirstResponder() -> Bool {
        let becameFirstResponder = super.becomeFirstResponder()

        if becameFirstResponder {
