Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Mostafa Taghipour authored and Mostafa Taghipour committed Sep 24, 2017
1 parent 04f53f5 commit 966d788
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 17 deletions.
33 changes: 25 additions & 8 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 mtpFontManager.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'mtpFontManager'
s.version = '1.0.0'
s.version = '1.0.1'
s.summary = 'A font Manager for iOS to simplify use of custom fonts (support dynamic types).'

# This description is used to generate tags and improve search results.
Expand Down
16 changes: 8 additions & 8 deletions mtpFontManager/Classes/FontManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -330,24 +330,24 @@ extension UIFont {

class fileprivate func overrideInitialize() {
if self == UIFont.self {
let systemFontMethod = class_getClassMethod(self, #selector(systemFont(ofSize:)))
let mySystemFontMethod = class_getClassMethod(self, #selector(mySystemFont(ofSize:)))
let systemFontMethod = class_getClassMethod(self, #selector(systemFont(ofSize:)))!
let mySystemFontMethod = class_getClassMethod(self, #selector(mySystemFont(ofSize:)))!
method_exchangeImplementations(systemFontMethod, mySystemFontMethod)

let boldSystemFontMethod = class_getClassMethod(self, #selector(boldSystemFont(ofSize:)))
let myBoldSystemFontMethod = class_getClassMethod(self, #selector(myBoldSystemFont(ofSize:)))
let boldSystemFontMethod = class_getClassMethod(self, #selector(boldSystemFont(ofSize:)))!
let myBoldSystemFontMethod = class_getClassMethod(self, #selector(myBoldSystemFont(ofSize:)))!
method_exchangeImplementations(boldSystemFontMethod, myBoldSystemFontMethod)

// let italicSystemFontMethod = class_getClassMethod(self, #selector(italicSystemFont(ofSize:)))
// let myItalicSystemFontMethod = class_getClassMethod(self, #selector(myItalicSystemFont(ofSize:)))
// method_exchangeImplementations(italicSystemFontMethod, myItalicSystemFontMethod)

let systemFontWeightMethod = class_getClassMethod(self, #selector(systemFont(ofSize:weight:)))
let mySystemFontWeightMethod = class_getClassMethod(self, #selector(mySystemFont(ofSize:weight:)))
let systemFontWeightMethod = class_getClassMethod(self, #selector(systemFont(ofSize:weight:)))!
let mySystemFontWeightMethod = class_getClassMethod(self, #selector(mySystemFont(ofSize:weight:)))!
method_exchangeImplementations(systemFontWeightMethod, mySystemFontWeightMethod)

let initCoderMethod = class_getInstanceMethod(self, #selector(UIFontDescriptor.init(coder:))) // Trick to get over the lack of UIFont.init(coder:))
let myInitCoderMethod = class_getInstanceMethod(self, #selector(UIFont.init(myCoder:)))
let initCoderMethod = class_getInstanceMethod(self, #selector(UIFontDescriptor.init(coder:)))! // Trick to get over the lack of UIFont.init(coder:))
let myInitCoderMethod = class_getInstanceMethod(self, #selector(UIFont.init(myCoder:)))!
method_exchangeImplementations(initCoderMethod, myInitCoderMethod)
}
}
Expand Down

0 comments on commit 966d788

Please sign in to comment.