Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cruisediary/DeviceLayout
📱AutoLayout can be set differently for each device
https://github.com/cruisediary/DeviceLayout
autolayout device devicelayout ios resolution swift ui
Last synced: about 1 month ago
JSON representation
📱AutoLayout can be set differently for each device
- Host: GitHub
- URL: https://github.com/cruisediary/DeviceLayout
- Owner: cruisediary
- License: mit
- Created: 2016-12-15T06:43:03.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2020-04-19T10:50:28.000Z (over 4 years ago)
- Last Synced: 2024-10-15T17:49:07.093Z (about 2 months ago)
- Topics: autolayout, device, devicelayout, ios, resolution, swift, ui
- Language: Swift
- Homepage:
- Size: 1.01 MB
- Stars: 166
- Watchers: 8
- Forks: 16
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- fucking-awesome-swift - DeviceLayout - AutoLayout can be set differently for each device. (Libs / Layout)
- awesome-swift - DeviceLayout - AutoLayout can be set differently for each device. (Libs / Layout)
- awesome-swift - DeviceLayout - AutoLayout can be set differently for each device ` 📝 a year ago` (Layout [🔝](#readme))
- awesome-swift - DeviceLayout - AutoLayout can be set differently for each device. (Libs / Layout)
README
# DeviceLayout
![logo](README/logo.png)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/cruisediary/DeviceLayout)
![Swift](https://img.shields.io/badge/Swift-5.0-orange.svg)
[![CI Status](http://img.shields.io/travis/cruisediary/DeviceLayout.svg?style=flat)](https://travis-ci.org/cruisediary/DeviceLayout)
[![Version](https://img.shields.io/cocoapods/v/DeviceLayout.svg?style=flat)](http://cocoapods.org/pods/DeviceLayout)
[![License](https://img.shields.io/cocoapods/l/DeviceLayout.svg?style=flat)](http://cocoapods.org/pods/DeviceLayout)
[![Platform](https://img.shields.io/cocoapods/p/DeviceLayout.svg?style=flat)](http://cocoapods.org/pods/DeviceLayout)**DeviceLayout** is a Swift framework that lets you set *Auto Layout* constraints's differently for each device
Using only `IBInspector` of Xcode to set up your constant per device size differently without any CODE :)
`@IBInspectable` make a migic with outh any CODE
Only 3 seconds you can set design guide and make designer happy 🚀
```swift
public enum Size: Int, Comparable {
case unknownSize = 0
/// iPhone 4, 4s, iPod Touch 4th gen.
case screen3_5Inch
/// iPhone 5, 5s, 5c, SE, iPod Touch 5-6th gen.
case screen4Inch
/// iPhone 6, 6s, 7, 8
case screen4_7Inch
/// iPhone 6+, 6s+, 7+, 8+
case screen5_5Inch
/// iPhone X, Xs
case screen5_8Inch
/// iPhone Xr
case screen6_1Inch
/// iPhone Xs Max
case screen6_5Inch
/// iPad Mini
case screen7_9Inch
/// iPad
case screen9_7Inch
/// iPad Pro (10.5-inch)
case screen10_5Inch
/// iPad Pro (11-inch)
case screen11Inch
/// iPad Pro (12.9-inch)
case screen12_9Inch
}
```## Example
#### First inherit your constraint to `DeviceLayoutConstraint`
![logo](README/screenshot1.png)
Second Set your own constant per device size and adjust your UI design guide
comparing `PSD`, `Sketch` or `Zeplin` UI Guide
Make designer be happy :)
![logo](README/screenshot2.png)
## Requirements
- iOS 8.0+
- Swift 3+, 4+, 5+## Installation
## 📲 Installation
DeviceLayout is available through [Cocoapods](http://cocoapods.org) or [Carthage](https://github.com/Carthage/Carthage)```ruby
pod "DeviceLayout"
```### Carthage
```
github "cruisediary/DeviceLayout" ~> 0.5.0
```## Dependencies
* [Device](https://github.com/Ekhoo/Device) - Light weight tool for detecting the current device and screen size written in swift.## 👨‍💻 Author
cruz, [email protected]
## 🛡 License
DeviceLayout is available under the MIT license. See the LICENSE file for more info.