Fix. Remove duplications
This commit is contained in:
parent
00b7d11b37
commit
04a558b70f
|
|
@ -27,12 +27,7 @@ open class XibView: UIView {
|
|||
|
||||
/// Nib name used to instantiate inner view
|
||||
open var innerViewNibName: String {
|
||||
let clsName = String(describing: type(of: self))
|
||||
if let typeRange = clsName.range(of: ".Type") {
|
||||
return clsName.substring(to: typeRange.lowerBound)
|
||||
} else {
|
||||
return clsName
|
||||
}
|
||||
return className(of: self)
|
||||
}
|
||||
|
||||
public convenience init() {
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ extension UIViewController {
|
|||
- returns: type name string
|
||||
*/
|
||||
open class var xibName: String {
|
||||
return className(of: self)
|
||||
return typeName(of: self)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,3 +35,7 @@ public func className<T>(of type: T) -> String {
|
|||
return clsName
|
||||
}
|
||||
}
|
||||
|
||||
public func typeName<T>(of type: T.Type) -> String {
|
||||
return String(describing: type)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue