diff --git a/RTLabel.podspec b/RTLabel.podspec new file mode 100644 index 0000000..bef39be --- /dev/null +++ b/RTLabel.podspec @@ -0,0 +1,13 @@ +Pod::Spec.new do |s| + s.name = "RTLabel" + s.version = "1.0" + s.summary = "Rich text formatting based on HTML-like markups for iOS." + s.homepage = "https://github.com/honcheng/RTLabel" + s.license = { :type => 'MIT', :file => 'LICENSE' } + s.author = { "Muh Hon Cheng" => "honcheng@gmail.com" } + s.source = { :git => "https://github.com/honcheng/RTLabel.git", :tag => "1.0" } + s.platform = :ios + s.source_files = 'RTLabelProject/Classes/RTLabel.{h,m}' + s.framework = 'CoreText' + s.requires_arc = true +end diff --git a/RTLabelProject/Classes/RTLabel.m b/RTLabelProject/Classes/RTLabel.m index 9f4f078..c5b17ce 100755 --- a/RTLabelProject/Classes/RTLabel.m +++ b/RTLabelProject/Classes/RTLabel.m @@ -147,6 +147,20 @@ - (id)initWithFrame:(CGRect)_frame { return self; } +-(void)awakeFromNib { + [self setBackgroundColor:[UIColor clearColor]]; + _font = [UIFont systemFontOfSize:15]; + _textColor = [UIColor blackColor]; + _text = @""; + _textAlignment = RTTextAlignmentLeft; + _lineBreakMode = RTTextLineBreakModeWordWrapping; + _lineSpacing = 3; + _currentSelectedButtonComponentIndex = -1; + _paragraphReplacement = @"\n"; + + [self setMultipleTouchEnabled:YES]; +} + - (void)setTextAlignment:(RTTextAlignment)textAlignment { _textAlignment = textAlignment;