 			{
 				switch option
 				{
-					case let .OuterMergine				( value ): _outerMergine = value
-					case let .InnerMergine				( value ): _innerMergine = value
-					case let .AutoGlowHeight			( value ): _autoGlowHeight = value
-					case let .BackgroundColor			( value ): backgroundColor = value
-					case let .Font						( value ): _font = value
-					case let .TagBackgroundColor		( value ): _tagBackgroundColor = value
-					case let .TagTextColor				( value ): _tagTextColor = value
-					case let .TagPrefix					( value ): _tagPrefix = value
+					case let .OuterMergine				( value ): _outerMergine			 = value
+					case let .InnerMergine				( value ): _innerMergine			 = value
+					case let .AutoGlowHeight			( value ): _autoGlowHeight			 = value
+					case let .BackgroundColor			( value ): backgroundColor			 = value
+					case let .Font						( value ): _font					 = value
+					case let .TagBackgroundColor		( value ): _tagBackgroundColor		 = value
+					case let .TagSelectedColor			( value ): _tagSelectedColor		 = value
+					case let .TagTextColor				( value ): _tagTextColor			 = value
+					case let .TagPrefix					( value ): _tagPrefix				 = value
+					case let .TagMaxCharactors			( value ): _tagMaxCharactors		 = value
 					case let .AddButtonBackgroundColor	( value ): _addButtonBackgroundColor = value
-					case let .AddButtonTextColor		( value ): _ddButtonTextColor = value
-					case let .EnableEdit				( value ): enableEdit = value
-				}
-			}
-		}
-
-		_scrollView							= UIScrollView( frame: frame )
-		_scrollView.pagingEnabled			= false
-		_scrollView.frame					= CGRectMake( 0, 0, frame.width, frame.height )
-		_scrollView.contentSize				= CGSizeMake( frame.width, frame.height )
-		_scrollView.layer.position			= CGPoint( x: frame.width / 2, y: frame.height / 2 )
+					case let .AddButtonTextColor		( value ): _addButtonTextColor		 = value
+					case let .EnableEdit				( value ): enableEdit				 = value
+					case let .MaxTagCount				( value ): _maxTagCount				 = value
+				}
+			}
+		}
+
+		_scrollView								= UIScrollView( frame: frame )
+		_scrollView.isPagingEnabled				= false
+		_scrollView.frame						= CGRect( x: 0, y: 0, width: frame.width, height: frame.height )
+		_scrollView.contentSize					= CGSize( width: frame.width, height: frame.height )
+		_scrollView.layer.position				= CGPoint( x: frame.width / 2, y: frame.height / 2 )
 		_scrollView.showsVerticalScrollIndicator = false
+		_scrollView.isUserInteractionEnabled	= true
 		self.addSubview( _scrollView )
 
-		_addButton							= UIButton( frame: CGRectMake( 0, 0, 30, 30 ) )
-		_addButton.layer.anchorPoint		= CGPoint( x: 0.0, y: 0.5 )
-		_addButton.layer.position			= CGPoint( x: _outerMergine, y: _outerMergine + _addButton.frame.height / 2 )
-		_addButton.hidden					= !_enableEdit
-		_addButton.titleLabel?.font			= _font
-		_addButton.layer.masksToBounds		= true
-		_addButton.userInteractionEnabled	= true
-		_addButton.layer.cornerRadius		= _addButton.frame.height / 2
-		_addButton.layer.borderColor		= _ddButtonTextColor.CGColor
-		_addButton.layer.borderWidth		= 1.5
-		_addButton.backgroundColor			= _addButtonBackgroundColor
-		_addButton.setTitle( "+", forState: UIControlState.Normal )
-		_addButton.setTitleColor( _ddButtonTextColor, forState: UIControlState.Normal )
-		_addButton.setTitle( "+", forState: UIControlState.Highlighted )
-		_addButton.setTitleColor( _ddButtonTextColor, forState: UIControlState.Highlighted )
-		_addButton.addTarget( self, action: #selector( onTapAddButton ), forControlEvents: .TouchUpInside )
+		_addButton								= UIButton( frame: CGRect( x: 0, y: 0, width: 30, height: 30 ) )
+		_addButton.layer.anchorPoint			= CGPoint( x: 0.0, y: 0.5 )
+		_addButton.layer.position				= CGPoint( x: _outerMergine, y: _outerMergine + _addButton.frame.height / 2 )
+		_addButton.isHidden						= !_enableEdit
+		_addButton.titleLabel?.font				= _font
+		_addButton.layer.masksToBounds			= true
+		_addButton.isUserInteractionEnabled		= true
+		_addButton.layer.cornerRadius			= _addButton.frame.height / 2
+		_addButton.layer.borderColor			= _addButtonTextColor.cgColor
+		_addButton.layer.borderWidth			= 1.5
+		_addButton.backgroundColor				= _addButtonBackgroundColor
+		_addButton.setTitle( "+", for: UIControlState.normal )
+		_addButton.setTitleColor( _addButtonTextColor, for: UIControlState.normal )
+		_addButton.setTitle( "+", for: UIControlState.highlighted )
+		_addButton.setTitleColor( _addButtonTextColor, for: UIControlState.highlighted )
+		_addButton.setBackgroundImage( UIImage.createImageFromColor( color: UIColor.white ), for: .highlighted )
+		_addButton.addTarget( self, action: #selector( onTapAddButton ), for: .touchUpInside )
 		self.addSubview( _addButton )
+
+		_tagCharCountLabel						= UILabel( frame: CGRect( x: 0, y: 0, width: 51, height: 20 ) )
+		_tagCharCountLabel.layer.anchorPoint	= CGPoint( x: 1.0, y: 0.5 )
+		_tagCharCountLabel.font					= Utility.getSystemFont( size: 10 )
+		_tagCharCountLabel.textColor			= _addButtonTextColor
+		_tagCharCountLabel.textAlignment		= NSTextAlignment.center
+		_tagCharCountLabel.layer.zPosition		= 5000
+		_tagCharCountLabel.backgroundColor		= UIColor.white
+		_tagCharCountLabel.layer.masksToBounds	= true
+		_tagCharCountLabel.layer.cornerRadius	= 20 / 2
+		_tagCharCountLabel.layer.borderColor	= _addButtonTextColor.cgColor
+		_tagCharCountLabel.layer.borderWidth	= 1.5
+		_tagCharCountLabel.isHidden				= true
+		self.addSubview( _tagCharCountLabel )
 	}
 
 	// --------------------------------------------------------------------------------------------

				tagFieldMaxY = _addButton.frame.maxY
			}
		}
		_scrollView.contentSize = CGSizeMake( frame.width, tagFieldMaxY + _outerMergine )
		if _autoGlowHeight == true
		{
			frame = CGRectMake( _basePosition.x, _basePosition.y, _baseSize.width, max( _baseSize.height, _scrollView.contentSize.height ) )
			_scrollView.frame = CGRectMake( 0, 0, frame.width, frame.height )
		}
	}

	// --------------------------------------------------------------------------------------------

	case AutoGlowHeight				( Bool )
	case Font						( UIFont )
	case TagBackgroundColor			( UIColor )
	case TagSelectedColor			( UIColor )
	case TagTextColor				( UIColor )
	case TagPrefix					( String )
	case TagMaxCharactors			( Int )
	case AddButtonBackgroundColor	( UIColor )
	case AddButtonTextColor			( UIColor )
	case EnableEdit					( Bool )
	case MaxTagCount				( Int )
}

// ------------------------------------------------------------------------------------------------
@objc public protocol TagViewDelegate
{
	@objc optional func onChangedLayoutTag( sender: UIView )
	@objc optional func onDidEndEditingTag( sender: UIView )
	@objc optional func onTapTag( name: String, userData: Any? )
}

// ------------------------------------------------------------------------------------------------
class TagView: UIView, UITextFieldDelegate
{
	var _scrollView					: UIScrollView!
	var _tagIndex					: Int				  = 0
	var _touchTagIndex				: Int				  = -1
	var _tagFields					: [Int: UITextField]! = [:]
	var _userDatum					: [Int: Any]!		  = [:]
	var _tagFieldMaxX				: CGFloat			  = 0.0
	var _tagFieldMinY				: CGFloat			  = 0.0
	var _basePosition				: CGPoint!
	var _baseSize					: CGSize!
	var _addButton					: UIButton!
	var _outerMergine				: CGFloat			  = 5.0
	var _innerMergine				: CGFloat			  = 2.5
	var _autoGlowHeight				: Bool				  = true
	var _font						: UIFont!
	var _tagBackgroundColor			: UIColor			  = UIColor.white
	var _tagSelectedColor			: UIColor			  = UIColor.white
	var _tagTextColor				: UIColor			  = UIColor.black
	var _tagPrefix					: String			  = "#"
	var _tagMaxCharactors			: Int				  = 30
	var _tagCharCountLabel			: UILabel!
	var _addButtonBackgroundColor	: UIColor			  = UIColor.white
	var _addButtonTextColor			: UIColor			  = UIColor.black
	var _enableEdit					: Bool				  = true
	var _maxTagCount				: Int				  = 1000
	var _tagCount					: Int				  = 0
	var _targetTextField			: UITextField!
	weak var delegate				: TagViewDelegate?

	// --------------------------------------------------------------------------------------------
