Skip to content

Commit 0616260

Browse files
committed
xcode8 - xib
1 parent 5ab13ca commit 0616260

File tree

7 files changed

+72
-69
lines changed

7 files changed

+72
-69
lines changed

Coding_iOS/Controllers/AddReviewerViewController.xib

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9532" systemVersion="14F1605" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11201" systemVersion="16A323" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
33
<dependencies>
44
<deployment identifier="iOS"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
6-
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11161"/>
6+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
77
</dependencies>
88
<objects>
99
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
@@ -14,22 +14,23 @@
1414
<viewControllerLayoutGuide type="bottom" id="Oi4-ri-mQ8"/>
1515
</layoutGuides>
1616
<view key="view" contentMode="scaleToFill" id="oa6-Kk-BiU">
17-
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
17+
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
1818
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
1919
<subviews>
20-
<tableView clipsSubviews="YES" contentMode="scaleToFill" ambiguous="YES" misplaced="YES" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="pqQ-5g-Tfd">
21-
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
22-
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
20+
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="pqQ-5g-Tfd">
21+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
2322
<connections>
2423
<outlet property="dataSource" destination="MpB-NS-FiR" id="HCw-SA-EqP"/>
2524
<outlet property="delegate" destination="MpB-NS-FiR" id="hFN-yo-Dhh"/>
2625
</connections>
2726
</tableView>
2827
</subviews>
29-
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
28+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
3029
<constraints>
31-
<constraint firstAttribute="trailingMargin" secondItem="pqQ-5g-Tfd" secondAttribute="trailing" constant="-20" id="SSq-4I-uSQ"/>
32-
<constraint firstItem="pqQ-5g-Tfd" firstAttribute="leading" secondItem="oa6-Kk-BiU" secondAttribute="leadingMargin" constant="-20" id="SSq-H4-BmD"/>
30+
<constraint firstItem="pqQ-5g-Tfd" firstAttribute="leading" secondItem="oa6-Kk-BiU" secondAttribute="leading" id="ftH-P5-z5t"/>
31+
<constraint firstItem="pqQ-5g-Tfd" firstAttribute="top" secondItem="oa6-Kk-BiU" secondAttribute="top" id="o00-Rd-ybZ"/>
32+
<constraint firstItem="Oi4-ri-mQ8" firstAttribute="top" secondItem="pqQ-5g-Tfd" secondAttribute="bottom" id="oh3-pl-NNR"/>
33+
<constraint firstAttribute="trailing" secondItem="pqQ-5g-Tfd" secondAttribute="trailing" id="qCE-gc-W9h"/>
3334
</constraints>
3435
</view>
3536
<connections>

Coding_iOS/Controllers/MeDisplayViewController.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,11 @@ - (void)requestTopicsMore:(BOOL)loadMore{
125125
[weakSelf.view endLoading];
126126
[weakSelf.myTableView.infiniteScrollingView stopAnimating];
127127
if (data) {
128-
[weakSelf.dataList addObjectsFromArray:data[@"list"]];
128+
if (weakSelf.willLoadMore) {
129+
[weakSelf.dataList addObjectsFromArray:data[@"list"]];
130+
}else{
131+
weakSelf.dataList = data[@"list"]? [data[@"list"] mutableCopy]: @[].mutableCopy;
132+
}
129133
[weakSelf.myTableView reloadData];
130134
weakSelf.myTableView.showsInfiniteScrolling = hasMoreData;
131135
}

Coding_iOS/Controllers/ReviewCell.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
@interface ReviewCell : UITableViewCell
1616

17-
@property (strong, nonatomic) IBOutlet UIImageView *headIcon;
17+
@property (strong, nonatomic) IBOutlet UIImageView *userIcon;
1818
@property (strong, nonatomic) IBOutlet UIImageView *reviewIcon;
1919
@property (strong, nonatomic) IBOutlet UILabel *userName;
2020
@property (strong, nonatomic) IBOutlet UILabel *userState;

Coding_iOS/Controllers/ReviewCell.m

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,16 @@
1010

1111
@implementation ReviewCell
1212

13-
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
14-
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
15-
if (self) {
16-
// Initialization code
17-
self.selectionStyle = UITableViewCellSelectionStyleNone;
18-
self.userState.textAlignment = NSTextAlignmentLeft;
19-
}
20-
return self;
21-
}
22-
23-
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
24-
[super setSelected:selected animated:animated];
13+
- (void)awakeFromNib{
14+
[super awakeFromNib];
15+
self.userIcon.frame = CGRectMake(12, 5, 33, 33);
2516
}
2617

2718
- (void)initCellWithReviewer:(User*)reviewer
2819
likeValue:(NSNumber*)likeValue;{
2920
self.user = reviewer;
30-
[self.headIcon sd_setImageWithURL:[reviewer.avatar urlImageWithCodePathResizeToView:self.headIcon] placeholderImage:kPlaceholderMonkeyRoundView(self.headIcon)];
31-
[self.headIcon doCircleFrame];
21+
[self.userIcon sd_setImageWithURL:[reviewer.avatar urlImageWithCodePathResizeToView:self.userIcon] placeholderImage:kPlaceholderMonkeyRoundView(self.userIcon)];
22+
[self.userIcon doCircleFrame];
3223
self.userName.text = reviewer.name;
3324
if([likeValue isEqual:@100]) {
3425
self.userState.text = @"+1";
@@ -46,8 +37,8 @@ - (void)initCellWithReviewer:(User*)reviewer
4637
- (void)initCellWithVolunteerReviewers:(User*)reviewer
4738
likeValue:(NSNumber*)likeValue;{
4839
self.user = reviewer;
49-
[self.headIcon sd_setImageWithURL:[reviewer.avatar urlImageWithCodePathResizeToView:self.headIcon] placeholderImage:kPlaceholderMonkeyRoundView(self.headIcon)];
50-
[self.headIcon doCircleFrame];
40+
[self.userIcon sd_setImageWithURL:[reviewer.avatar urlImageWithCodePathResizeToView:self.userIcon] placeholderImage:kPlaceholderMonkeyRoundView(self.userIcon)];
41+
[self.userIcon doCircleFrame];
5142
[self.reviewIcon setHidden:YES];
5243
self.userName.text = reviewer.name;
5344
if([likeValue isEqual:@100]) {
@@ -59,12 +50,11 @@ - (void)initCellWithVolunteerReviewers:(User*)reviewer
5950

6051
- (void)initCellWithUsers:(User*)user{
6152
self.user = user;
62-
[self.headIcon sd_setImageWithURL:[user.avatar urlImageWithCodePathResizeToView:self.headIcon] placeholderImage:kPlaceholderMonkeyRoundView(self.headIcon)];
63-
[self.headIcon doCircleFrame];
53+
[self.userIcon sd_setImageWithURL:[user.avatar urlImageWithCodePathResizeToView:self.userIcon] placeholderImage:kPlaceholderMonkeyRoundView(self.userIcon)];
54+
[self.userIcon doCircleFrame];
6455
[self.reviewIcon setHidden:YES];
6556
self.userName.text = user.name;
6657
self.userState.hidden = YES;
67-
6858
}
6959

7060
+ (CGFloat)cellHeight{

Coding_iOS/Controllers/ReviewCell.xib

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,72 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9532" systemVersion="14F1605" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11201" systemVersion="16A323" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
33
<dependencies>
44
<deployment identifier="iOS"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11161"/>
66
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
7+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
78
</dependencies>
89
<objects>
910
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
1011
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
11-
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="ReviewCell" id="KGk-i7-Jjw" userLabel="ReviewCell" customClass="ReviewCell">
12+
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="ReviewCell" rowHeight="44" id="KGk-i7-Jjw" userLabel="ReviewCell" customClass="ReviewCell">
1213
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
13-
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
14+
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
1415
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
15-
<rect key="frame" x="0.0" y="0.0" width="320" height="43.5"/>
16+
<frame key="frameInset" width="320" height="43"/>
1617
<autoresizingMask key="autoresizingMask"/>
1718
<subviews>
18-
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="MergeChanges.png" translatesAutoresizingMaskIntoConstraints="NO" id="igY-Zl-c4C">
19-
<rect key="frame" x="12" y="5" width="33" height="33"/>
19+
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="igY-Zl-c4C">
20+
<constraints>
21+
<constraint firstAttribute="height" constant="33" id="UXu-mc-Ohs"/>
22+
<constraint firstAttribute="width" constant="33" id="cLo-N7-NzE"/>
23+
</constraints>
2024
<userDefinedRuntimeAttributes>
2125
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
2226
<integer key="value" value="22"/>
2327
</userDefinedRuntimeAttribute>
2428
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
2529
</userDefinedRuntimeAttributes>
2630
</imageView>
27-
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="PointLikeHead.png" translatesAutoresizingMaskIntoConstraints="NO" id="rew-xr-t1t">
28-
<rect key="frame" x="25" y="20" width="18" height="18"/>
31+
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="PointLikeHead.png" translatesAutoresizingMaskIntoConstraints="NO" id="rew-xr-t1t">
32+
<constraints>
33+
<constraint firstAttribute="width" constant="18" id="8J9-GQ-y8H"/>
34+
<constraint firstAttribute="height" constant="18" id="uPs-35-p6u"/>
35+
</constraints>
2936
<edgeInsets key="layoutMargins" top="8" left="90" bottom="8" right="8"/>
3037
</imageView>
31-
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" misplaced="YES" text="mangoli" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="lcy-xu-sS9">
32-
<rect key="frame" x="57" y="13" width="69" height="18"/>
38+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="mangoli" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="lcy-xu-sS9">
3339
<fontDescription key="fontDescription" type="system" pointSize="17"/>
34-
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
40+
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
3541
<nil key="highlightedColor"/>
3642
</label>
37-
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="+1" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="UiT-S0-rwy">
38-
<rect key="frame" x="258" y="13" width="50" height="18"/>
43+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="+1" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="UiT-S0-rwy">
3944
<fontDescription key="fontDescription" type="system" pointSize="17"/>
40-
<color key="textColor" red="0.0" green="1" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
45+
<color key="textColor" red="0.0" green="1" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
4146
<nil key="highlightedColor"/>
4247
</label>
4348
</subviews>
4449
<constraints>
45-
<constraint firstAttribute="bottomMargin" secondItem="UiT-S0-rwy" secondAttribute="bottom" constant="4.5" id="9MU-ta-w51"/>
46-
<constraint firstItem="lcy-xu-sS9" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="topMargin" constant="5" id="Tcg-vW-pxN"/>
47-
<constraint firstItem="UiT-S0-rwy" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="topMargin" constant="5" id="cPl-Pi-WoO"/>
48-
<constraint firstAttribute="trailingMargin" secondItem="UiT-S0-rwy" secondAttribute="trailing" constant="4" id="m05-OI-egB"/>
49-
<constraint firstAttribute="bottomMargin" secondItem="lcy-xu-sS9" secondAttribute="bottom" constant="4.5" id="pUi-cI-gm8"/>
50+
<constraint firstItem="UiT-S0-rwy" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="L5B-4I-hNc"/>
51+
<constraint firstItem="lcy-xu-sS9" firstAttribute="leading" secondItem="igY-Zl-c4C" secondAttribute="trailing" constant="12" id="Mqs-xc-eZR"/>
52+
<constraint firstItem="lcy-xu-sS9" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="N72-34-Nw3"/>
53+
<constraint firstAttribute="trailingMargin" secondItem="UiT-S0-rwy" secondAttribute="trailing" constant="4" id="NH8-Jx-gsj"/>
54+
<constraint firstItem="igY-Zl-c4C" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="12" id="XKt-T8-SBP"/>
55+
<constraint firstItem="igY-Zl-c4C" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="Z4S-0w-Jlx"/>
56+
<constraint firstItem="rew-xr-t1t" firstAttribute="trailing" secondItem="igY-Zl-c4C" secondAttribute="trailing" id="xxS-7b-19e"/>
57+
<constraint firstItem="rew-xr-t1t" firstAttribute="bottom" secondItem="igY-Zl-c4C" secondAttribute="bottom" id="yP3-nU-q6q"/>
5058
</constraints>
5159
</tableViewCellContentView>
5260
<connections>
53-
<outlet property="headIcon" destination="igY-Zl-c4C" id="QUc-jB-Qgx"/>
5461
<outlet property="reviewIcon" destination="rew-xr-t1t" id="7Na-QY-nml"/>
62+
<outlet property="userIcon" destination="igY-Zl-c4C" id="PZp-hf-Lwi"/>
5563
<outlet property="userName" destination="lcy-xu-sS9" id="kBV-LP-Vqw"/>
5664
<outlet property="userState" destination="UiT-S0-rwy" id="shg-nM-IkN"/>
5765
</connections>
5866
<point key="canvasLocation" x="238" y="360"/>
5967
</tableViewCell>
6068
</objects>
6169
<resources>
62-
<image name="MergeChanges.png" width="28" height="28"/>
6370
<image name="PointLikeHead.png" width="18" height="18"/>
6471
</resources>
6572
</document>

0 commit comments

Comments
 (0)