Skip to content

Commit

Permalink
Mark UIKit extensions as @objc (#42)
Browse files Browse the repository at this point in the history
* Mark UIKit extensions as @objc

* Create CHANGELOG.md
  • Loading branch information
klaaspieter authored and vikmeup committed Nov 21, 2017
1 parent 5ca967e commit 9bdb627
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# [Unreleased](https://github.com/seedco/StackViewController/compare/0.4.0...HEAD)

- Fix runtime crashes (unrecognized selector) by adding `@objc` annotation to public UIKit extensions.
4 changes: 2 additions & 2 deletions StackViewController/UIStackViewExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

import UIKit

extension UIStackView {
public func removeAllArrangedSubviews() {
public extension UIStackView {
@objc public func removeAllArrangedSubviews() {
arrangedSubviews.forEach {
$0.removeFromSuperview()
}
Expand Down
4 changes: 2 additions & 2 deletions StackViewController/UIViewExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

import UIKit

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

0 comments on commit 9bdb627

Please sign in to comment.