 //  Created by Romilson Nunes on 06/06/14.
 //  Copyright (c) 2014 Romilson Nunes. All rights reserved.
 //
-
 import UIKit
 public enum RNActivityIndicatorAlignment: Int {
     case left

            
            if (self.hideTextWhenLoading) {
                super.setTitle(nil, for: state)
                super.titleLabel?.text = nil
            } else {
                super.setTitle( self.title(for: state) , for: state)
                super.titleLabel?.text = self.title(for: state)
            }
            
        } else {
            self.activityIndicatorView.stopAnimating();
            super.setImage(self.image(for: state), for: state)
            super.imageView?.image = self.image(for: state)
            super.setTitle(self.title(for: state), for: state)
            super.titleLabel?.text = self.title(for: state)
        }
        
        self.setNeedsLayout()

        self.texts.setValue(super.title(for: .highlighted), forKey: "\(UIControlState.highlighted.rawValue)")
        self.texts.setValue(super.title(for: .disabled), forKey: "\(UIControlState.disabled.rawValue)")
        self.texts.setValue(super.title(for: .selected), forKey: "\(UIControlState.selected.rawValue)")
        
        /** Attributed Title for States */
        self.texts.setValue(super.attributedTitle(for: .normal), forKey: "\(UIControlState.normal.rawValue)")
        self.texts.setValue(super.attributedTitle(for: .highlighted), forKey: "\(UIControlState.highlighted.rawValue)")
        self.texts.setValue(super.attributedTitle(for: .disabled), forKey: "\(UIControlState.disabled.rawValue)")
        self.texts.setValue(super.attributedTitle(for: .selected), forKey: "\(UIControlState.selected.rawValue)")
        
        /** Images for States */
        self.imagens.setValue(super.image(for: .normal), forKey: "\(UIControlState.normal.rawValue)")
