Skip to content

Commit d4cd0b9

Browse files
committed
Fix iOS7 constraint warnings
1 parent ab28cd9 commit d4cd0b9

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

Demo/Demo.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@
301301
buildSettings = {
302302
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
303303
INFOPLIST_FILE = Demo/Info.plist;
304-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
304+
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
305305
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
306306
PRODUCT_NAME = "$(TARGET_NAME)";
307307
};
@@ -312,7 +312,7 @@
312312
buildSettings = {
313313
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
314314
INFOPLIST_FILE = Demo/Info.plist;
315-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
315+
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
316316
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
317317
PRODUCT_NAME = "$(TARGET_NAME)";
318318
};

Demo/Demo/FDFeedCell.m

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,21 @@ @interface FDFeedCell ()
2020

2121
@implementation FDFeedCell
2222

23+
- (void)awakeFromNib
24+
{
25+
[super awakeFromNib];
26+
27+
// Fix the bug in iOS7 - initial constraints warning
28+
self.contentView.bounds = [UIScreen mainScreen].bounds;
29+
}
30+
2331
- (void)setEntity:(FDFeedEntity *)entity
2432
{
2533
_entity = entity;
2634

2735
self.titleLabel.text = entity.title;
2836
self.contentLabel.text = entity.content;
29-
self.contentImageView.image = [UIImage imageNamed:entity.imageName];
37+
self.contentImageView.image = entity.imageName.length > 0 ? [UIImage imageNamed:entity.imageName] : nil;
3038
self.usernameLabel.text = entity.username;
3139
self.timeLabel.text = entity.time;
3240
}

0 commit comments

Comments
 (0)