| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef IOS_CHROME_BROWSER_UI_UIVIEW_SIZE_CLASS_SUPPORT_H_ | 5 #ifndef IOS_CHROME_BROWSER_UI_UIVIEW_SIZECLASSSUPPORT_H_ |
| 6 #define IOS_CHROME_BROWSER_UI_UIVIEW_SIZE_CLASS_SUPPORT_H_ | 6 #define IOS_CHROME_BROWSER_UI_UIVIEW_SIZECLASSSUPPORT_H_ |
| 7 | 7 |
| 8 #import <UIKit/UIKit.h> | 8 #import <UIKit/UIKit.h> |
| 9 | 9 |
| 10 // An enum type to describe size classes. | 10 // An enum type to describe size classes. |
| 11 typedef NS_ENUM(NSInteger, SizeClassIdiom) { | 11 typedef NS_ENUM(NSInteger, SizeClassIdiom) { |
| 12 COMPACT = 0, | 12 COMPACT = 0, |
| 13 REGULAR, | 13 REGULAR, |
| 14 UNSPECIFIED, | 14 UNSPECIFIED, |
| 15 SIZE_CLASS_COUNT = UNSPECIFIED, | 15 SIZE_CLASS_COUNT = UNSPECIFIED, |
| 16 }; | 16 }; |
| 17 | 17 |
| 18 // UIView category that exposes SizeClassIdiom getters. | 18 // UIView category that exposes SizeClassIdiom getters. |
| 19 @interface UIView (SizeClassSupport) | 19 @interface UIView (SizeClassSupport) |
| 20 | 20 |
| 21 // Convenience getters for the view's width and height SizeClassIdioms. If the | 21 // Convenience getters for the view's width and height SizeClassIdioms. If the |
| 22 // view's size class is unspecified, these functions return the size class idiom | 22 // view's size class is unspecified, these functions return the size class idiom |
| 23 // of the application's key window. | 23 // of the application's key window. |
| 24 @property(nonatomic, readonly) SizeClassIdiom cr_widthSizeClass; | 24 @property(nonatomic, readonly) SizeClassIdiom cr_widthSizeClass; |
| 25 @property(nonatomic, readonly) SizeClassIdiom cr_heightSizeClass; | 25 @property(nonatomic, readonly) SizeClassIdiom cr_heightSizeClass; |
| 26 | 26 |
| 27 @end | 27 @end |
| 28 | 28 |
| 29 #endif // IOS_CHROME_BROWSER_UI_UIVIEW_SIZE_CLASS_SUPPORT_H_ | 29 #endif // IOS_CHROME_BROWSER_UI_UIVIEW_SIZECLASSSUPPORT_H_ |
| OLD | NEW |