Commit 4e478da8 by Orkhan Alikhanov

Open up access to auto layout related code to allow extending them

parent bf2a9ed6
......@@ -76,7 +76,7 @@ public extension UIView {
public struct Layout {
/// A weak reference to the constraintable.
weak var constraintable: Constraintable?
public weak var constraintable: Constraintable?
/// Parent view of the view.
var parent: UIView? {
......@@ -84,7 +84,7 @@ public struct Layout {
}
/// Returns the view that is being laied out.
private var view: UIView? {
public var view: UIView? {
var v = constraintable as? UIView
if #available(iOS 9.0, *), v == nil {
v = (constraintable as? UILayoutGuide)?.owningView
......
......@@ -39,17 +39,17 @@ extension LayoutAnchor: LayoutAnchorable { }
public struct LayoutAnchor {
/// A weak reference to the constraintable.
weak var constraintable: Constraintable?
public weak var constraintable: Constraintable?
/// An array of LayoutAttribute for the view.
let attributes: [LayoutAttribute]
public let attributes: [LayoutAttribute]
/**
An initializer taking constraintable and anchor attributes.
- Parameter view: A Constraintable.
- Parameter attributes: An array of LayoutAtrribute.
*/
init(constraintable: Constraintable?, attributes: [LayoutAttribute] = []) {
public init(constraintable: Constraintable?, attributes: [LayoutAttribute] = []) {
self.constraintable = constraintable
self.attributes = attributes
}
......
......@@ -31,7 +31,7 @@
import UIKit
/// A typealias for NSLayoutConstraint.Attribute
internal typealias LayoutAttribute = NSLayoutConstraint.Attribute
public typealias LayoutAttribute = NSLayoutConstraint.Attribute
internal extension Array where Element == LayoutAttribute {
/// A LayoutAttribute array containing top and left.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment