Skip to content

Commit 9bdb627

Browse files
klaaspietervikmeup
authored andcommitted
Mark UIKit extensions as @objc (#42)
* Mark UIKit extensions as @objc * Create CHANGELOG.md
1 parent 5ca967e commit 9bdb627

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# [Unreleased](https://github.com/seedco/StackViewController/compare/0.4.0...HEAD)
2+
3+
- Fix runtime crashes (unrecognized selector) by adding `@objc` annotation to public UIKit extensions.

StackViewController/UIStackViewExtensions.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
import UIKit
1010

11-
extension UIStackView {
12-
public func removeAllArrangedSubviews() {
11+
public extension UIStackView {
12+
@objc public func removeAllArrangedSubviews() {
1313
arrangedSubviews.forEach {
1414
$0.removeFromSuperview()
1515
}

StackViewController/UIViewExtensions.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
import UIKit
1010

11-
extension UIView {
12-
public func activateSuperviewHuggingConstraints(insets: UIEdgeInsets = UIEdgeInsets.zero) -> [NSLayoutConstraint] {
11+
public extension UIView {
12+
@objc public func activateSuperviewHuggingConstraints(insets: UIEdgeInsets = UIEdgeInsets.zero) -> [NSLayoutConstraint] {
1313
translatesAutoresizingMaskIntoConstraints = false
1414
let views = ["view": self]
1515
let metrics = ["top": insets.top, "left": insets.left, "bottom": insets.bottom, "right": insets.right]

0 commit comments

Comments
 (0)