-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
33 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#What this class is for? | ||
Ever need to move some UI blocks higher on iphone 4s? | ||
|
||
Ever need to hide some UI block on iphone 4s and show it on every other type of device? | ||
|
||
Ever tried to make a universal UI with some elements than should grow/shrink on some devices and Size Classes didn't help at all? | ||
|
||
If your answer is 'YES' - you may find this class helpful. `SZDeviceSpecificLayoutConstraint` allows you to specify additional `constant` values for a specific device. This allows you to make your autolayout more flexible. | ||
|
||
#Installation | ||
|
||
##Cocoapods | ||
This class is available via [CocoaPods](http://cocoapods.org/). Write this in your `Podfile`: | ||
|
||
```ruby | ||
pod 'SZDeviceSpecificLayoutConstraint' | ||
``` | ||
Then run `pod install` or `pod update` | ||
|
||
##Manual | ||
|
||
Simply clone this repo and copy `SZDeviceSpecificLayoutConstraint.h` and `SZDeviceSpecificLayoutConstraint.m` to your project. | ||
|
||
#How to use | ||
|
||
1. Select your constraint in IB, set it's class to `SZDeviceSpecificLayoutConstraint`: | ||
<img src="http://i.imgur.com/1zrxbSM.png" alt="class set screenshot" width="50%" height="50%"/> | ||
|
||
2. Set any specific constraint value in property inspector:<br> | ||
<img src="http://i.imgur.com/0HsNrs6.png" alt="constant set screenshot" width="50%" height="50%"/> | ||
|
||
3. Drink your coffie, you're **awesome**!<br> | ||
![awesome =)](http://who-is-awesome.com/who-is-awesome.jpg) |