-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #158 from 0xLeif/develop
v1.2
- Loading branch information
Showing
12 changed files
with
1,753 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,28 +104,34 @@ class ViewController: UIViewController { | |
|
||
**** | ||
|
||
# oneleif Project | ||
## oneleif project | ||
This means that the project is sponsored by the oneleif community, and the collaborators are team members from oneleif. | ||
|
||
![](https://github.com/oneleif/olDocs/blob/master/assets/images/oneleif_logos/full_logo/oneleif_whiteback.png) | ||
<a href="http://oneleif.com" rel="oneleif website">![](https://github.com/oneleif/olDocs/blob/master/assets/images/oneleif_logos/full_logo/oneleif_whiteback.png)</a> | ||
|
||
### Project Info | ||
|
||
This project is a oneleif active project. | ||
|
||
[![](https://img.shields.io/badge/oneleif-Twitter-blue.svg)](https://twitter.com/oneleifdev) | ||
|
||
[![](https://img.shields.io/badge/oneleif-YouTube-red.svg)](https://www.youtube.com/channel/UC3HN0jID38K0Vb_WChvgQmA) | ||
|
||
## What is oneleif? | ||
oneleif is a nonprofit community that supports tech minded individuals. We do this by offering a fun loving community that works on Open Sourced projects together. | ||
We love to give back through free resources and guidance. | ||
|
||
## How to join oneleif | ||
Click on the link below to join the Discord server. | ||
|
||
You will start with limited permissions, in a text channel that only moderators will see. | ||
[![](https://img.shields.io/badge/oneleif-Discord-7284be.svg)](https://discord.gg/tv9UdJK) | ||
|
||
To get full access: read the rules, make an introduction in #introductions, and add an appropriate username. | ||
-OR- | ||
|
||
When you're done with the above, shoot a message to the #start channel to let us know, and we will give you full access. | ||
[Check out our website](http://oneleif.com) | ||
|
||
[![](https://img.shields.io/badge/oneleif-Discord-7284be.svg)](https://discord.gg/tv9UdJK) | ||
|
||
### Questions? | ||
Feel free to email us at: [email protected] | ||
|
||
-OR- | ||
|
||
Ask questions in the discord |
49 changes: 49 additions & 0 deletions
49
Sources/SwiftUIKit/Extensions/NSLayoutConstraint+SwiftUIKit.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// | ||
// NSLayoutConstraint+SwiftUIKit.swift | ||
// SwiftUIKit | ||
// | ||
// Created by Zach Eriksen on 5/17/20. | ||
// | ||
|
||
import UIKit | ||
|
||
@available(iOS 10.0, *) | ||
public extension NSLayoutConstraint { | ||
|
||
/// Check if the `constraint` is connected to the `anchor` | ||
func isConnected<T>(toAnchor anchor: NSLayoutAnchor<T>) -> Bool { | ||
firstAnchor == anchor || secondAnchor == anchor | ||
} | ||
} | ||
|
||
@available(iOS 10.0, *) | ||
public extension UIView { | ||
|
||
/// The leading constraints held by the view | ||
var leadingConstraints: [NSLayoutConstraint] { | ||
constraints.filter { (constraint) -> Bool in | ||
constraint.isConnected(toAnchor: leadingAnchor) | ||
} | ||
} | ||
|
||
/// The trailing constraints held by the view | ||
var trailingConstraints: [NSLayoutConstraint] { | ||
constraints.filter { (constraint) -> Bool in | ||
constraint.isConnected(toAnchor: trailingAnchor) | ||
} | ||
} | ||
|
||
/// The top constraints held by the view | ||
var topConstraints: [NSLayoutConstraint] { | ||
constraints.filter { (constraint) -> Bool in | ||
constraint.isConnected(toAnchor: topAnchor) | ||
} | ||
} | ||
|
||
/// The bottom constraints held by the view | ||
var bottomConstraints: [NSLayoutConstraint] { | ||
constraints.filter { (constraint) -> Bool in | ||
constraint.isConnected(toAnchor: bottomAnchor) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.