Skip to content

Commit

Permalink
Fix: issue #13 (#14)
Browse files Browse the repository at this point in the history
* Fix: issue #13

`UIDevice.current.orientation` gives "unknown" orientation

Change to use width and height to determine whether landscape or
portrait

* Refactor
  • Loading branch information
youjinp authored and paololeonardi committed Nov 20, 2019
1 parent 3c79e8a commit 6021f61
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Sources/WaterfallGrid/GridSyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ struct GridSyle {
#elseif os(watchOS)
return columnsInPortrait
#else
return UIDevice.current.orientation.isLandscape ? columnsInLandscape : columnsInPortrait
let screenSize = UIScreen.main.bounds.size
return screenSize.width > screenSize.height ? columnsInLandscape : columnsInPortrait
#endif
}
}
Expand Down

0 comments on commit 6021f61

Please sign in to comment.