|
|
@@ -30,36 +30,12 @@ NSString *const kFLEXMultilineTableViewCellIdentifier = @"kFLEXMultilineTableVie
|
|
|
|
|
|
+ (UIEdgeInsets)labelInsets
|
|
|
{
|
|
|
- UIEdgeInsets labelInsets = UIEdgeInsetsZero;
|
|
|
- labelInsets.top = 10.0;
|
|
|
- labelInsets.bottom = 10.0;
|
|
|
- if (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_6_1) {
|
|
|
- labelInsets.left = 15.0;
|
|
|
- labelInsets.right = 15.0;
|
|
|
- } else {
|
|
|
- labelInsets.left = 10.0;
|
|
|
- labelInsets.right = 10.0;
|
|
|
- }
|
|
|
- return labelInsets;
|
|
|
+ return UIEdgeInsetsMake(10.0, 15.0, 10.0, 15.0);
|
|
|
}
|
|
|
|
|
|
+ (CGFloat)preferredHeightWithAttributedText:(NSAttributedString *)attributedText inTableViewWidth:(CGFloat)tableViewWidth style:(UITableViewStyle)style showsAccessory:(BOOL)showsAccessory
|
|
|
{
|
|
|
- // Hardcoded margins from observation of cells in a grouped table on iOS 6.
|
|
|
- // There is no API to get the insets of the content view proir to layout.
|
|
|
- // Thankfully they removed the magic margins in iOS 7.
|
|
|
- // Differences are between the content view's width and the table view's width
|
|
|
- // Full screen iPhone - 20
|
|
|
- // Full screen iPad - 90
|
|
|
-
|
|
|
CGFloat labelWidth = tableViewWidth;
|
|
|
- if (NSFoundationVersionNumber <= NSFoundationVersionNumber_iOS_6_1 && style == UITableViewStyleGrouped) {
|
|
|
- if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
|
|
|
- labelWidth -= 40.0;
|
|
|
- } else {
|
|
|
- labelWidth -= 90.0;
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
// Content view inset due to accessory view observed on iOS 8.1 iPhone 6.
|
|
|
if (showsAccessory) {
|