Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fixes #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Usage
----

[`SizeClasser`](https://github.com/cemolcay/SizeClasser/blob/master/SizeClasser/SizeClasser.swift) is an `OptionSet` type struct.
You can initilize it with your viewController's `traitCollection` property to identify your current device specific orientation and split view status.
You can initialize it with your viewController's `traitCollection` property to identify your current device specific orientation and split view status.

``` swift
let sizeClasser = SizeClasser(traitCollection: traitCollection)
Expand Down Expand Up @@ -69,11 +69,11 @@ if trait.contains([.iPadLandscape, .iPadSplitOneThird]) {
}
```

Also you can use `SizeClasser.isiPadPro` to detect 12.9" iPad Pro if you want to layout your views more specificly.
Also you can use `SizeClasser.isiPadPro` to detect 12.9" iPad Pro if you want to layout your views more specifically.

#### Note on `traitCollectionDidChange:previousTraitCollection` function:
This function only get called if `traitCollection` changes.
If you are on iPad, either portrait or landscape mode, it won't change 1/3 split view to 2/3 split view transitions.
iOS calculates them both `compact width regular height` mode.
So, I recommend to use `viewDidLayoutSubviews:` function to detect split view changes specificly.
So, I recommend to use `viewDidLayoutSubviews:` function to detect split view changes specifically.
![alt tag](https://github.com/cemolcay/SizeClasser/blob/master/split.png?raw=true)