Skip to content

Commit

Permalink
Merge branch 'release/1.0.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
loregr committed Oct 11, 2017
2 parents 1a2e19e + 0efd08c commit 4bce3a3
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 26 deletions.
8 changes: 5 additions & 3 deletions Example/LGButton.xcodeproj/project.pbxproj
Expand Up @@ -155,7 +155,7 @@
TargetAttributes = {
607FACCF1AFB9204008FA782 = {
CreatedOnToolsVersion = 6.3.1;
LastSwiftMigration = 0820;
LastSwiftMigration = 0900;
};
};
};
Expand Down Expand Up @@ -359,7 +359,8 @@
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
Expand All @@ -374,7 +375,8 @@
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
};
name = Release;
};
Expand Down
Binary file not shown.
40 changes: 21 additions & 19 deletions Example/Pods/Pods.xcodeproj/project.pbxproj

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion LGButton.podspec
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'LGButton'
s.version = '1.0.3'
s.version = '1.0.4'
s.summary = 'A fully customisable subclass of the native UIControl which allows you to create beautiful buttons without writing any line of code.'
s.homepage = 'https://cocoapods.org/pods/LGButton'
s.license = { :type => 'MIT', :file => 'LICENSE.md' }
Expand Down
2 changes: 1 addition & 1 deletion LGButton/Classes/SwiftIconFont/FontLoader.swift
Expand Up @@ -30,7 +30,7 @@ class FontLoader: NSObject {
let font = CGFont.init(provider!)

var error: Unmanaged<CFError>?
if !CTFontManagerRegisterGraphicsFont(font, &error) {
if !CTFontManagerRegisterGraphicsFont(font!, &error) {
let errorDescription: CFString = CFErrorCopyDescription(error!.takeUnretainedValue())
let nsError = error!.takeUnretainedValue() as AnyObject as! NSError
NSException(name: NSExceptionName.internalInconsistencyException, reason: errorDescription as String, userInfo: [NSUnderlyingErrorKey: nsError]).raise()
Expand Down
4 changes: 2 additions & 2 deletions LGButton/Classes/SwiftIconFont/SwiftIconFont.swift
Expand Up @@ -65,7 +65,7 @@ public extension UIImage
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.alignment = NSTextAlignment.center

drawText!.draw(in: CGRect(x:0, y:0, width:imageSize.width, height:imageSize.height), withAttributes: [NSFontAttributeName : UIFont.icon(from: font, ofSize: size), NSParagraphStyleAttributeName: paragraphStyle, NSForegroundColorAttributeName: iconColor])
drawText!.draw(in: CGRect(x:0, y:0, width:imageSize.width, height:imageSize.height), withAttributes: [NSAttributedStringKey.font : UIFont.icon(from: font, ofSize: size), NSAttributedStringKey.paragraphStyle: paragraphStyle, NSAttributedStringKey.foregroundColor: iconColor])

let image = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
Expand Down Expand Up @@ -204,7 +204,7 @@ func getAttributedString(_ text: NSString, ofSize size: CGFloat) -> NSMutableAtt
if let _ = fontArr[fontCode] {
attributedString.replaceCharacters(in: substringRange, with: String.getIcon(from: fontType, code: fontCode)!)
let newRange = NSRange(location: substringRange.location, length: 1)
attributedString.addAttribute(NSFontAttributeName, value: UIFont.icon(from: fontType, ofSize: size), range: newRange)
attributedString.addAttribute(NSAttributedStringKey.font, value: UIFont.icon(from: fontType, ofSize: size), range: newRange)
}
}

Expand Down

0 comments on commit 4bce3a3

Please sign in to comment.