From b264b497220cc934c9d4342d528b26703520c9e0 Mon Sep 17 00:00:00 2001 From: Conrad Calmez Date: Wed, 23 Oct 2019 14:04:07 +0200 Subject: [PATCH 1/3] allow dynamic dispatch to the actual class rather than the class immediately conforming to the NibOwnerLoadable protocol --- Sources/View/NibOwnerLoadable.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/View/NibOwnerLoadable.swift b/Sources/View/NibOwnerLoadable.swift index cd94b41..7798a07 100644 --- a/Sources/View/NibOwnerLoadable.swift +++ b/Sources/View/NibOwnerLoadable.swift @@ -39,7 +39,7 @@ public extension NibOwnerLoadable where Self: UIView { */ func loadNibContent() { let layoutAttributes: [NSLayoutConstraint.Attribute] = [.top, .leading, .bottom, .trailing] - for case let view as UIView in Self.nib.instantiate(withOwner: self, options: nil) { + for case let view as UIView in type(of: self).nib.instantiate(withOwner: self, options: nil) { view.translatesAutoresizingMaskIntoConstraints = false self.addSubview(view) NSLayoutConstraint.activate(layoutAttributes.map { attribute in From 280a5c33ebd301c8b35595e0676166a21c030967 Mon Sep 17 00:00:00 2001 From: Conrad Calmez Date: Wed, 23 Oct 2019 14:20:13 +0200 Subject: [PATCH 2/3] added dynamic dispatch nib lookup change to CHANGELOG --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 321f893..a8f95a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # CHANGELOG +## Unreleased + +* Dynamic dispatch of nib name lookup + [@calmez](https://github.com/calmez) + [#96](https://github.com/AliSoftware/Reusable/pull/96) + ## 4.1.0 * Support for Swift 5.0 From 2468c000a0a03d22c396cff51bf6990700048189 Mon Sep 17 00:00:00 2001 From: Conrad Calmez Date: Wed, 23 Oct 2019 14:59:01 +0200 Subject: [PATCH 3/3] fixing whitespaces for markdown to render correctly --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a8f95a1..93d05dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,19 +2,19 @@ ## Unreleased -* Dynamic dispatch of nib name lookup +* Fix nib name lookup when using subclassing. [@calmez](https://github.com/calmez) [#96](https://github.com/AliSoftware/Reusable/pull/96) ## 4.1.0 -* Support for Swift 5.0 +* Support for Swift 5.0 [@florentmorin](https://github.com/florentmorin) [#80](https://github.com/AliSoftware/Reusable/pull/80) ## 4.0.5 -* Fix for only allowing the use of app extension API. +* Fix for only allowing the use of app extension API. [@igorkulman](https://github.com/igorkulman) [#73](https://github.com/AliSoftware/Reusable/pull/73)