diff --git a/LeadKit.podspec b/LeadKit.podspec index 98ea2c5f..9462fd5b 100644 --- a/LeadKit.podspec +++ b/LeadKit.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "LeadKit" - s.version = "0.4.8" + s.version = "0.4.9" s.summary = "iOS framework with a bunch of tools for rapid development" s.homepage = "https://github.com/TouchInstinct/LeadKit" s.license = "Apache License, Version 2.0" diff --git a/LeadKit/LeadKit/Classes/Views/XibView.swift b/LeadKit/LeadKit/Classes/Views/XibView.swift index 05a1fa7e..b94db6fe 100644 --- a/LeadKit/LeadKit/Classes/Views/XibView.swift +++ b/LeadKit/LeadKit/Classes/Views/XibView.swift @@ -27,7 +27,7 @@ open class XibView: UIView { /// Nib name used to instantiate inner view open var innerViewNibName: String { - return className(of: type(of: self)) + return className(of: self) } public convenience init() { diff --git a/LeadKit/LeadKit/Extensions/UIViewController/UIViewController+XibName.swift b/LeadKit/LeadKit/Extensions/UIViewController/UIViewController+XibName.swift index 91b65bac..4a41f581 100644 --- a/LeadKit/LeadKit/Extensions/UIViewController/UIViewController+XibName.swift +++ b/LeadKit/LeadKit/Extensions/UIViewController/UIViewController+XibName.swift @@ -30,7 +30,7 @@ extension UIViewController { - returns: type name string */ open class var xibName: String { - return className(of: self) + return typeName(of: self) } } diff --git a/LeadKit/LeadKit/Functions/Any+TypeName.swift b/LeadKit/LeadKit/Functions/Any+TypeName.swift index addad2a9..e117bd83 100644 --- a/LeadKit/LeadKit/Functions/Any+TypeName.swift +++ b/LeadKit/LeadKit/Functions/Any+TypeName.swift @@ -22,10 +22,10 @@ import Foundation -/// Function which returns string representation of type without ".Type" suffix +/// Function which returns string representation of object type /// -/// - Parameter type: a type -/// - Returns: string representation of type without ".Type" suffix +/// - Parameter type: an object type +/// - Returns: string representation of object type public func className(of type: T) -> String { let clsName = String(describing: type(of: type)) @@ -35,3 +35,11 @@ public func className(of type: T) -> String { return clsName } } + +/// Function which returns string representation of class type +/// +/// - Parameter type: an class type +/// - Returns: string representation of class type +public func typeName(of type: T.Type) -> String { + return String(describing: type) +}