Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pircate/swiftymasonry
将 Masonry Swift 化,适用于 Objective-C 混编 Swift 项目。
https://github.com/pircate/swiftymasonry
autolayout masonry swifty
Last synced: 26 days ago
JSON representation
将 Masonry Swift 化,适用于 Objective-C 混编 Swift 项目。
- Host: GitHub
- URL: https://github.com/pircate/swiftymasonry
- Owner: Pircate
- License: mit
- Created: 2018-08-29T14:44:06.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-14T03:53:50.000Z (almost 6 years ago)
- Last Synced: 2024-10-30T10:51:29.501Z (about 2 months ago)
- Topics: autolayout, masonry, swifty
- Language: Swift
- Homepage:
- Size: 94.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SwiftyMasonry
[![CI Status](https://img.shields.io/travis/Pircate/SwiftyMasonry.svg?style=flat)](https://travis-ci.org/Pircate/SwiftyMasonry)
[![Version](https://img.shields.io/cocoapods/v/SwiftyMasonry.svg?style=flat)](https://cocoapods.org/pods/SwiftyMasonry)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![License](https://img.shields.io/cocoapods/l/SwiftyMasonry.svg?style=flat)](https://cocoapods.org/pods/SwiftyMasonry)
[![Platform](https://img.shields.io/cocoapods/p/SwiftyMasonry.svg?style=flat)](https://cocoapods.org/pods/SwiftyMasonry)## Example
To run the example project, clone the repo, and run `pod install` from the Example directory first.
## Requirements
* iOS 9.0
* Swift 4.2## Installation
SwiftyMasonry is available through [CocoaPods](https://cocoapods.org) or [Carthage](https://github.com/Carthage/Carthage). To install
it, simply add the following line to your Podfile or Cartfile:### CocoaPods
```ruby
pod 'SwiftyMasonry'
```### Carthage
```ruby
github "Pircate/SwiftyMasonry"
```## Usage
```swift
view.mas.makeConstraints {
$0.top.equalTo(mas.topLayoutGuide)
$0.left.right.equalTo(superView)
$0.bottom.equalTo(superView).inset(49)
}view.mas.makeConstraints {
$0.edges.equalTo(superView).insets(UIEdgeInsets(top: 10, left: 20, bottom: 30, right: 40))
}view.mas.makeConstraints {
$0.center.equalTo(superView)
$0.size.mas.equalTo(CGSize(width: 100, height: 100)) // mas.equalTo代替mas_equalTo
}view.mas.makeConstraints {
$0.top.equalTo(otherView.mas.bottom).offset(20)
$0.left.equalTo(superView).inset(15)
}
```## Author
Pircate, [email protected]
## License
SwiftyMasonry is available under the MIT license. See the LICENSE file for more info.