Skip to content

Commit

Permalink
Added tab icons; improved table view cells
Browse files Browse the repository at this point in the history
  • Loading branch information
OmelDM committed Apr 2, 2015
1 parent 72a30c7 commit 254a494
Show file tree
Hide file tree
Showing 16 changed files with 108 additions and 58 deletions.
Binary file not shown.
14 changes: 12 additions & 2 deletions CSNCensorNetUaProject/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,18 @@ @interface AppDelegate ()
@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
- (BOOL)application:(UIApplication *)anApplication didFinishLaunchingWithOptions:(NSDictionary *)aLaunchOptions
{
UIImage *theBackground = [UIImage imageNamed:@"TabBarBackground"];
[[UITabBar appearance] setBackgroundImage:theBackground];

[[UINavigationBar appearance] setBackgroundImage:theBackground forBarMetrics:UIBarMetricsDefault];

[[UINavigationBar appearance] setTitleTextAttributes:
@{NSForegroundColorAttributeName:
[UIColor colorWithRed:245.0/255.0 green:245.0/255.0 blue:245.0/255.0 alpha:1.0],
NSFontAttributeName:[UIFont fontWithName:@"HelveticaNeue-CondensedBlack" size:21.0]}];

return YES;
}

Expand Down
44 changes: 21 additions & 23 deletions CSNCensorNetUaProject/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -33,39 +33,37 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<prototypes>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="NewsCell" id="Zcm-At-wQ5" customClass="CSNNewsTableViewCell">
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="NewsCell" rowHeight="61" id="Zcm-At-wQ5" customClass="CSNNewsTableViewCell">
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Zcm-At-wQ5" id="GFl-EB-pgp">
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Title" lineBreakMode="wordWrap" numberOfLines="4" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qgO-SF-xyo">
<rect key="frame" x="96" y="10" width="463" height="16"/>
<fontDescription key="fontDescription" name="Verdana" family="Verdana" pointSize="13"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="751" verticalHuggingPriority="751" horizontalCompressionResistancePriority="751" verticalCompressionResistancePriority="751" text="HH:MM" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Cv7-Tl-hUL">
<rect key="frame" x="10" y="10" width="580" height="13"/>
<fontDescription key="fontDescription" name="HelveticaNeue" family="Helvetica Neue" pointSize="11"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" verticalHuggingPriority="251" text="HH:mm" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="WAW-zM-gp0">
<rect key="frame" x="8" y="8" width="80" height="14"/>
<constraints>
<constraint firstAttribute="width" priority="750" constant="80" id="sBl-kq-Yno"/>
</constraints>
<fontDescription key="fontDescription" name="Verdana" family="Verdana" pointSize="11"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="750" verticalHuggingPriority="750" text="Title" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="LJO-Xz-WU7">
<rect key="frame" x="10" y="23" width="580" height="27"/>
<fontDescription key="fontDescription" name="HelveticaNeue" family="Helvetica Neue" pointSize="16"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="qgO-SF-xyo" firstAttribute="leading" secondItem="WAW-zM-gp0" secondAttribute="trailing" constant="8" id="1s9-As-Lqs"/>
<constraint firstItem="WAW-zM-gp0" firstAttribute="leading" secondItem="GFl-EB-pgp" secondAttribute="leadingMargin" id="82J-NV-c0L"/>
<constraint firstItem="qgO-SF-xyo" firstAttribute="trailing" secondItem="GFl-EB-pgp" secondAttribute="trailingMargin" id="Zj8-Ig-jBp"/>
<constraint firstItem="qgO-SF-xyo" firstAttribute="top" secondItem="GFl-EB-pgp" secondAttribute="topMargin" constant="2" id="bpK-iP-lxc"/>
<constraint firstItem="WAW-zM-gp0" firstAttribute="top" secondItem="GFl-EB-pgp" secondAttribute="topMargin" id="cjf-7F-Xte"/>
<constraint firstItem="qgO-SF-xyo" firstAttribute="leading" secondItem="WAW-zM-gp0" secondAttribute="trailing" constant="8" id="wfu-2L-HMk"/>
<constraint firstAttribute="trailing" secondItem="LJO-Xz-WU7" secondAttribute="trailing" constant="10" id="0z3-U4-Ril"/>
<constraint firstItem="Cv7-Tl-hUL" firstAttribute="top" secondItem="GFl-EB-pgp" secondAttribute="top" constant="10" id="9zj-Yx-4xu"/>
<constraint firstItem="LJO-Xz-WU7" firstAttribute="top" secondItem="Cv7-Tl-hUL" secondAttribute="bottom" id="Goo-hM-Znh"/>
<constraint firstItem="LJO-Xz-WU7" firstAttribute="leading" secondItem="GFl-EB-pgp" secondAttribute="leading" constant="10" id="Gtu-tm-DlO"/>
<constraint firstAttribute="trailing" secondItem="Cv7-Tl-hUL" secondAttribute="trailing" constant="10" id="Lr4-1J-WfO"/>
<constraint firstItem="Cv7-Tl-hUL" firstAttribute="leading" secondItem="GFl-EB-pgp" secondAttribute="leading" constant="10" id="NoX-bv-X91"/>
<constraint firstAttribute="bottom" secondItem="LJO-Xz-WU7" secondAttribute="bottom" constant="10" id="llp-KV-6Tj"/>
</constraints>
</tableViewCellContentView>
<connections>
<outlet property="dateLabel" destination="WAW-zM-gp0" id="QDN-SO-psT"/>
<outlet property="titleView" destination="qgO-SF-xyo" id="1FS-XE-qXI"/>
<outlet property="dateLabel" destination="Cv7-Tl-hUL" id="ylP-Br-z4S"/>
<outlet property="titleLabel" destination="LJO-Xz-WU7" id="9vZ-b3-GZc"/>
<segue destination="ufK-Mu-pMg" kind="show" identifier="NewsDetailsSegue" id="jHk-Xh-IUG"/>
</connections>
</tableViewCell>
Expand Down Expand Up @@ -141,7 +139,7 @@
<scene sceneID="snL-qC-rrF">
<objects>
<navigationController id="lGu-vQ-Rs4" userLabel="Articles" sceneMemberID="viewController">
<tabBarItem key="tabBarItem" title="Articles" image="first" id="CPh-dF-3ED"/>
<tabBarItem key="tabBarItem" title="Articles" image="ArticlesIcon" id="CPh-dF-3ED"/>
<navigationBar key="navigationBar" contentMode="scaleToFill" id="5wH-U2-8r4">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
Expand Down Expand Up @@ -225,7 +223,7 @@
<scene sceneID="ICb-ZR-jod">
<objects>
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="KkW-Aw-cl8" sceneMemberID="viewController">
<tabBarItem key="tabBarItem" title="News" image="second" id="yfU-vp-fkh"/>
<tabBarItem key="tabBarItem" title="News" image="NewsIcon" id="yfU-vp-fkh"/>
<toolbarItems/>
<navigationBar key="navigationBar" contentMode="scaleToFill" id="rA2-66-oux">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
Expand All @@ -242,7 +240,7 @@
</scene>
</scenes>
<resources>
<image name="first" width="30" height="30"/>
<image name="second" width="30" height="30"/>
<image name="ArticlesIcon" width="28" height="28"/>
<image name="NewsIcon" width="28" height="28"/>
</resources>
</document>
15 changes: 9 additions & 6 deletions CSNCensorNetUaProject/CSNNewsTableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,17 @@ - (void)viewDidLoad
{
[super viewDidLoad];

self.tableView.rowHeight = UITableViewAutomaticDimension;
self.tableView.estimatedRowHeight = 61.0;

self.title = @"News";

// NSData *theXML = [NSData dataWithContentsOfURL:[NSURL
// URLWithString:@"http://en.censor.net.ua/includes/news_full_en.xml"]];

#warning test solution
NSData *theXML = [NSData dataWithContentsOfURL:[NSURL
fileURLWithPath:@"/Users/omel/Documents/Projects/censor_net_rss.xml"]];
URLWithString:@"http://en.censor.net.ua/includes/news_full_en.xml"]];

//#warning test solution
// NSData *theXML = [NSData dataWithContentsOfURL:[NSURL
// fileURLWithPath:@"/Users/omel/Documents/Projects/censor_net_rss.xml"]];

CSNXMLParserOperation *theOperation = [[CSNXMLParserOperation alloc]
initWithData:theXML complitionHandler:^(NSArray *anItems, NSError *anError)
Expand Down Expand Up @@ -95,7 +98,7 @@ - (UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(
CSNNews *theNews = self.news[anIndexPath.row];
theCell.dateLabel.text = [NSDateFormatter localizedStringFromDate:theNews.pubDate
dateStyle:NSDateFormatterNoStyle timeStyle:NSDateFormatterShortStyle];
theCell.titleView.text = theNews.title;
theCell.titleLabel.text = theNews.title;

return theCell;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "sample-1012-sticky-note@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "sample-881-globe@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "Screen Shot 2015-04-02 at 20.37.45.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 0 additions & 12 deletions CSNCensorNetUaProject/Images.xcassets/first.imageset/Contents.json

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.
2 changes: 1 addition & 1 deletion CSNCensorNetUaProject/Sources/CSNNewsTableViewCell.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
////////////////////////////////////////////////////////////////////////////////
@interface CSNNewsTableViewCell : UITableViewCell

@property (nonatomic, weak) IBOutlet UILabel *titleView;
@property (nonatomic, weak) IBOutlet UILabel *titleLabel;
@property (nonatomic, weak) IBOutlet UILabel *dateLabel;

@end
4 changes: 2 additions & 2 deletions CSNCensorNetUaProject/Sources/CSNXMLParserOperation.m
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ - (void)parser:(NSXMLParser *)aParser didStartElement:(NSString *)anElementName
if (nil != theURL)
{
self.currentNews[kEnclosureName] = theURL;
self.currentNews[kImagePathName] = [[CSNDownloader sharedDownloader]
addFileToDownloaderAtURL:[NSURL URLWithString:theURL]];
self.currentNews[kImagePathName] = [[[CSNDownloader sharedDownloader]
addFileToDownloaderAtURL:[NSURL URLWithString:theURL]] copy];
}
}

Expand Down

0 comments on commit 254a494

Please sign in to comment.