Skip to content

Commit

Permalink
add @available annotations to iOS8-specific entries in LayoutProxy, s…
Browse files Browse the repository at this point in the history
…o this will compile in iOS7
  • Loading branch information
tbavaro committed Aug 4, 2015
1 parent 5e42e13 commit 9a51ab6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Cartography/LayoutProxy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,15 @@ public struct LayoutProxy {

#if os(iOS)
/// The first baseline of the view. iOS exclusive.
@available(iOS, introduced=8.0)
public var firstBaseline: Edge {
return Edge(context, view, .FirstBaseline)
}

/// All edges of the view with their respective margins. This property
/// affects `topMargin`, `bottomMargin`, `leadingMargin` and
/// `trailingMargin`.
@available(iOS, introduced=8.0)
public var edgesWithinMargins: Edges {
return Edges(context, [
Edge(context, view, .TopMargin),
Expand All @@ -111,47 +113,56 @@ public struct LayoutProxy {
}

/// The left margin of the view. iOS exclusive.
@available(iOS, introduced=8.0)
public var leftMargin: Edge {
return Edge(context, view, .LeftMargin)
}

/// The right margin of the view. iOS exclusive.
@available(iOS, introduced=8.0)
public var rightMargin: Edge {
return Edge(context, view, .RightMargin)
}

/// The top margin of the view. iOS exclusive.
@available(iOS, introduced=8.0)
public var topMargin: Edge {
return Edge(context, view, .TopMargin)
}

/// The bottom margin of the view. iOS exclusive.
@available(iOS, introduced=8.0)
public var bottomMargin: Edge {
return Edge(context, view, .BottomMargin)
}

/// The leading margin of the view. iOS exclusive.
@available(iOS, introduced=8.0)
public var leadingMargin: Edge {
return Edge(context, view, .LeadingMargin)
}

/// The trailing margin of the view. iOS exclusive.
@available(iOS, introduced=8.0)
public var trailingMargin: Edge {
return Edge(context, view, .TrailingMargin)
}

/// The horizontal center within the margins of the view. iOS exclusive.
@available(iOS, introduced=8.0)
public var centerXWithinMargins: Edge {
return Edge(context, view, .CenterXWithinMargins)
}

/// The vertical center within the margins of the view. iOS exclusive.
@available(iOS, introduced=8.0)
public var centerYWithinMargins: Edge {
return Edge(context, view, .CenterYWithinMargins)
}

/// The center point within the margins of the view. This property affects
/// `centerXWithinMargins` and `centerYWithinMargins`. iOS exclusive.
@available(iOS, introduced=8.0)
public var centerWithinMargins: Point {
return Point(context, [
Edge(context, view, .CenterXWithinMargins),
Expand Down

0 comments on commit 9a51ab6

Please sign in to comment.