Skip to content

Commit c178104

Browse files
committed
release
1 parent 60c5e7f commit c178104

File tree

11 files changed

+663
-1348
lines changed

11 files changed

+663
-1348
lines changed

AppIcon.sketch

1.45 MB
Binary file not shown.

ReactiveHackerNews.xcodeproj/project.pbxproj

Lines changed: 574 additions & 1308 deletions
Large diffs are not rendered by default.

ReactiveHackerNews/Base.lproj/LaunchScreen.xib

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6214" systemVersion="14A314h" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6254" systemVersion="14D72i" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES">
33
<dependencies>
4-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6207"/>
5-
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
4+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6247"/>
65
</dependencies>
76
<objects>
87
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
@@ -11,27 +10,21 @@
1110
<rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
1211
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
1312
<subviews>
14-
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2015 Intelligent Gadget. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
15-
<rect key="frame" x="20" y="439" width="441" height="21"/>
16-
<fontDescription key="fontDescription" type="system" pointSize="17"/>
17-
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
18-
<nil key="highlightedColor"/>
19-
</label>
20-
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="ReactiveHackerNews" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
21-
<rect key="frame" x="20" y="140" width="441" height="43"/>
22-
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
23-
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
13+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="RHN" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="pkc-jv-LzA">
14+
<rect key="frame" x="175" y="210" width="131" height="60"/>
15+
<constraints>
16+
<constraint firstAttribute="height" constant="60" id="ohJ-1F-uyF"/>
17+
<constraint firstAttribute="width" constant="131" id="wgz-0G-D8r"/>
18+
</constraints>
19+
<fontDescription key="fontDescription" name="AvenirNext-Bold" family="Avenir Next" pointSize="54"/>
20+
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
2421
<nil key="highlightedColor"/>
2522
</label>
2623
</subviews>
27-
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
24+
<color key="backgroundColor" red="1" green="0.40000000000000002" blue="0.0039215686269999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
2825
<constraints>
29-
<constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC"/>
30-
<constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk"/>
31-
<constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l"/>
32-
<constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0"/>
33-
<constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9"/>
34-
<constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g"/>
26+
<constraint firstAttribute="centerX" secondItem="pkc-jv-LzA" secondAttribute="centerX" constant="-0.5" id="IrF-La-qp2"/>
27+
<constraint firstAttribute="centerY" secondItem="pkc-jv-LzA" secondAttribute="centerY" id="sSW-do-wh0"/>
3528
</constraints>
3629
<nil key="simulatedStatusBarMetrics"/>
3730
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>

ReactiveHackerNews/Base.lproj/Main.storyboard

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@
1717
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
1818
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
1919
<subviews>
20+
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Well done!" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ftA-Dw-yoK">
21+
<rect key="frame" x="260" y="275" width="80" height="50"/>
22+
<constraints>
23+
<constraint firstAttribute="height" constant="50" id="3Qb-HQ-rhP"/>
24+
<constraint firstAttribute="width" constant="80" id="3k0-87-n0y"/>
25+
</constraints>
26+
<fontDescription key="fontDescription" name="AvenirNext-Medium" family="Avenir Next" pointSize="22"/>
27+
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
28+
<nil key="highlightedColor"/>
29+
</label>
2030
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Pxs-2q-fNT">
2131
<rect key="frame" x="539" y="550" width="40" height="40"/>
2232
<constraints>
@@ -48,7 +58,9 @@
4858
<constraint firstItem="cf0-xi-gZq" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leadingMargin" constant="5" id="89J-fQ-wSr"/>
4959
<constraint firstItem="wfy-db-euE" firstAttribute="top" secondItem="Pxs-2q-fNT" secondAttribute="bottom" constant="10" id="ClZ-pk-clp"/>
5060
<constraint firstItem="wfy-db-euE" firstAttribute="top" secondItem="f4S-GZ-xim" secondAttribute="bottom" constant="100" id="LrO-Ao-8Ez"/>
61+
<constraint firstAttribute="centerY" secondItem="ftA-Dw-yoK" secondAttribute="centerY" id="MY0-Q7-OfW"/>
5162
<constraint firstItem="wfy-db-euE" firstAttribute="top" secondItem="cf0-xi-gZq" secondAttribute="bottom" constant="10" id="SKv-vl-dod"/>
63+
<constraint firstAttribute="centerX" secondItem="ftA-Dw-yoK" secondAttribute="centerX" id="aLo-c1-Rdb"/>
5264
<constraint firstItem="f4S-GZ-xim" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leadingMargin" constant="15" id="bwX-NW-RVy"/>
5365
<constraint firstAttribute="trailingMargin" secondItem="f4S-GZ-xim" secondAttribute="trailing" constant="15" id="grb-Ol-acG"/>
5466
<constraint firstAttribute="trailingMargin" secondItem="f4S-GZ-xim" secondAttribute="trailing" constant="30" id="keG-FK-kZk"/>
@@ -64,6 +76,7 @@
6476
</view>
6577
<connections>
6678
<outlet property="aboutButton" destination="cf0-xi-gZq" id="2bJ-fm-k5i"/>
79+
<outlet property="doneLabel" destination="ftA-Dw-yoK" id="PIv-Cb-0xW"/>
6780
<outlet property="refreshButton" destination="Pxs-2q-fNT" id="bxG-r5-Jpk"/>
6881
<outlet property="swipeableView" destination="f4S-GZ-xim" id="NNg-cF-iHQ"/>
6982
<segue destination="7sv-Ea-AUj" kind="presentation" identifier="about" id="hDv-lg-x2g"/>
@@ -84,13 +97,13 @@
8497
<sections>
8598
<tableViewSection id="azs-bn-9AS">
8699
<cells>
87-
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="400" id="z7H-V3-7hT">
100+
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="600" id="z7H-V3-7hT">
88101
<autoresizingMask key="autoresizingMask"/>
89102
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="z7H-V3-7hT" id="TOR-3e-SBt">
90103
<autoresizingMask key="autoresizingMask"/>
91104
<subviews>
92105
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Hi" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Pa5-fx-isC">
93-
<rect key="frame" x="18" y="65" width="564" height="85"/>
106+
<rect key="frame" x="18" y="48" width="564" height="85"/>
94107
<constraints>
95108
<constraint firstAttribute="height" constant="85" id="qUA-Te-1mu"/>
96109
</constraints>
@@ -99,17 +112,17 @@
99112
<nil key="highlightedColor"/>
100113
</label>
101114
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="10" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="j38-I7-dgl">
102-
<rect key="frame" x="18" y="150" width="564" height="180"/>
115+
<rect key="frame" x="18" y="133" width="564" height="240"/>
103116
<constraints>
104-
<constraint firstAttribute="height" constant="180" id="0FC-Tm-xhv"/>
117+
<constraint firstAttribute="height" constant="240" id="0FC-Tm-xhv"/>
105118
</constraints>
106-
<string key="text">This is a demo app I used to introduce Reactive Cocoa. Reactive Cocoa is a powerful iOS framework, that implements functional reactive programming for iOS. It is a large framework, that is why I am using this app for the introduction.</string>
119+
<string key="text">Thanks for using Reactive Hacker News (RHN)! This is a demo app I used for Reactive Cocoa practice. You can find the complete source code of this app at my github repo: https://github.com/syshen/ReactiveHackerNews . Feel free to contact me if you have more questions about Reactive Cocoa.</string>
107120
<fontDescription key="fontDescription" name="AvenirNext-Regular" family="Avenir Next" pointSize="17"/>
108121
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
109122
<nil key="highlightedColor"/>
110123
</label>
111124
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Follow me at @syshen" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="TGa-YK-emw">
112-
<rect key="frame" x="178" y="338" width="245" height="23.5"/>
125+
<rect key="frame" x="178" y="381" width="245" height="23.5"/>
113126
<constraints>
114127
<constraint firstAttribute="height" constant="23.5" id="1Wd-LZ-HqM"/>
115128
<constraint firstAttribute="width" constant="245" id="pet-gG-JHC"/>
@@ -125,7 +138,7 @@
125138
<constraint firstAttribute="trailingMargin" secondItem="Pa5-fx-isC" secondAttribute="trailing" constant="10" id="MHC-dJ-he5"/>
126139
<constraint firstItem="j38-I7-dgl" firstAttribute="top" secondItem="Pa5-fx-isC" secondAttribute="bottom" id="MVZ-qv-cwW"/>
127140
<constraint firstItem="Pa5-fx-isC" firstAttribute="leading" secondItem="TOR-3e-SBt" secondAttribute="leadingMargin" constant="10" id="Qcx-MH-jyB"/>
128-
<constraint firstItem="Pa5-fx-isC" firstAttribute="top" secondItem="TOR-3e-SBt" secondAttribute="topMargin" constant="57" id="dsF-8b-Zp4"/>
141+
<constraint firstItem="Pa5-fx-isC" firstAttribute="top" secondItem="TOR-3e-SBt" secondAttribute="topMargin" constant="40" id="dsF-8b-Zp4"/>
129142
<constraint firstItem="j38-I7-dgl" firstAttribute="leading" secondItem="Pa5-fx-isC" secondAttribute="leading" id="jZM-Nm-rhZ"/>
130143
<constraint firstItem="TGa-YK-emw" firstAttribute="leading" secondItem="TOR-3e-SBt" secondAttribute="leadingMargin" constant="170" id="me8-lb-dfR"/>
131144
<constraint firstAttribute="trailingMargin" secondItem="TGa-YK-emw" secondAttribute="trailing" constant="169" id="ox1-J7-dnt"/>
@@ -147,7 +160,7 @@
147160
<outlet property="delegate" destination="jwB-yA-OVn" id="Znt-aR-FZc"/>
148161
</connections>
149162
</tableView>
150-
<navigationItem key="navigationItem" title="About Reactive Hacker News" id="bT8-hf-RjB">
163+
<navigationItem key="navigationItem" title="About RHN" id="bT8-hf-RjB">
151164
<barButtonItem key="rightBarButtonItem" title="Done" id="w1c-Yg-Jgv">
152165
<color key="tintColor" red="1" green="0.40000000000000002" blue="0.0039215686269999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
153166
<connections>

ReactiveHackerNews/CardView.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
@interface CardView()
1111
@property (nonatomic, strong) StoryViewModel *viewModel;
1212
@property (nonatomic, weak) IBOutlet UIImageView *errorImage;
13+
@property (nonatomic, weak) IBOutlet UILabel *errorMessage;
1314
@end
1415
@implementation CardView
1516

@@ -26,6 +27,7 @@ - (void) awakeFromNib {
2627

2728
self.errorImage.layer.cornerRadius = 10.0f;
2829
self.errorImage.backgroundColor = [UIColor colorWithWhite:0.9 alpha:0.9];
30+
self.errorMessage.textColor = [UIColor colorWithWhite:0.9 alpha:0.9];
2931

3032
}
3133

@@ -64,8 +66,10 @@ - (void)bindViewModel:(StoryViewModel *)viewModel {
6466

6567
[[self.viewModel.loadContentCommand errors] subscribeNext:^(id x) {
6668
@strongify(self);
67-
if (x)
69+
if (x) {
6870
self.errorImage.hidden = NO;
71+
self.errorMessage.hidden = NO;
72+
}
6973
}];
7074

7175
[self.viewModel.loadStoryCommand execute:nil];

0 commit comments

Comments
 (0)