Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
Material
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitriy Stepanets
Material
Commits
4e478da8
Commit
4e478da8
authored
Apr 03, 2019
by
Orkhan Alikhanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Open up access to auto layout related code to allow extending them
parent
bf2a9ed6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
Sources/iOS/Layout/Layout.swift
+2
-2
Sources/iOS/Layout/LayoutAnchor.swift
+3
-3
Sources/iOS/Layout/LayoutAttribute.swift
+1
-1
No files found.
Sources/iOS/Layout/Layout.swift
View file @
4e478da8
...
@@ -76,7 +76,7 @@ public extension UIView {
...
@@ -76,7 +76,7 @@ public extension UIView {
public
struct
Layout
{
public
struct
Layout
{
/// A weak reference to the constraintable.
/// A weak reference to the constraintable.
weak
var
constraintable
:
Constraintable
?
public
weak
var
constraintable
:
Constraintable
?
/// Parent view of the view.
/// Parent view of the view.
var
parent
:
UIView
?
{
var
parent
:
UIView
?
{
...
@@ -84,7 +84,7 @@ public struct Layout {
...
@@ -84,7 +84,7 @@ public struct Layout {
}
}
/// Returns the view that is being laied out.
/// Returns the view that is being laied out.
p
rivate
var
view
:
UIView
?
{
p
ublic
var
view
:
UIView
?
{
var
v
=
constraintable
as?
UIView
var
v
=
constraintable
as?
UIView
if
#available(iOS 9.0, *)
,
v
==
nil
{
if
#available(iOS 9.0, *)
,
v
==
nil
{
v
=
(
constraintable
as?
UILayoutGuide
)?
.
owningView
v
=
(
constraintable
as?
UILayoutGuide
)?
.
owningView
...
...
Sources/iOS/Layout/LayoutAnchor.swift
View file @
4e478da8
...
@@ -39,17 +39,17 @@ extension LayoutAnchor: LayoutAnchorable { }
...
@@ -39,17 +39,17 @@ extension LayoutAnchor: LayoutAnchorable { }
public
struct
LayoutAnchor
{
public
struct
LayoutAnchor
{
/// A weak reference to the constraintable.
/// A weak reference to the constraintable.
weak
var
constraintable
:
Constraintable
?
public
weak
var
constraintable
:
Constraintable
?
/// An array of LayoutAttribute for the view.
/// An array of LayoutAttribute for the view.
let
attributes
:
[
LayoutAttribute
]
public
let
attributes
:
[
LayoutAttribute
]
/**
/**
An initializer taking constraintable and anchor attributes.
An initializer taking constraintable and anchor attributes.
- Parameter view: A Constraintable.
- Parameter view: A Constraintable.
- Parameter attributes: An array of LayoutAtrribute.
- Parameter attributes: An array of LayoutAtrribute.
*/
*/
init
(
constraintable
:
Constraintable
?,
attributes
:
[
LayoutAttribute
]
=
[])
{
public
init
(
constraintable
:
Constraintable
?,
attributes
:
[
LayoutAttribute
]
=
[])
{
self
.
constraintable
=
constraintable
self
.
constraintable
=
constraintable
self
.
attributes
=
attributes
self
.
attributes
=
attributes
}
}
...
...
Sources/iOS/Layout/LayoutAttribute.swift
View file @
4e478da8
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
import
UIKit
import
UIKit
/// A typealias for NSLayoutConstraint.Attribute
/// A typealias for NSLayoutConstraint.Attribute
internal
typealias
LayoutAttribute
=
NSLayoutConstraint
.
Attribute
public
typealias
LayoutAttribute
=
NSLayoutConstraint
.
Attribute
internal
extension
Array
where
Element
==
LayoutAttribute
{
internal
extension
Array
where
Element
==
LayoutAttribute
{
/// A LayoutAttribute array containing top and left.
/// A LayoutAttribute array containing top and left.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment