Commit 4895c174ce41071ef6584c6d626e977267866c54
1 parent
cd46bb24e6
Exists in
master
and in
1 other branch
Add UI history screen
Showing 14 changed files with 991 additions and 6 deletions Side-by-side Diff
- LifeLog/LifeLog.xcodeproj/project.pbxproj
- LifeLog/LifeLog/AppDelegate.m
- LifeLog/LifeLog/CollectionView.h
- LifeLog/LifeLog/CollectionView.m
- LifeLog/LifeLog/CollectionView.xib
- LifeLog/LifeLog/HistoryListTableViewCell.h
- LifeLog/LifeLog/HistoryListTableViewCell.m
- LifeLog/LifeLog/HistoryListTableViewCell.xib
- LifeLog/LifeLog/HistoryViewController.h
- LifeLog/LifeLog/HistoryViewController.m
- LifeLog/LifeLog/HistoryViewController.xib
- LifeLog/LifeLog/LabelCollectionViewCell.h
- LifeLog/LifeLog/LabelCollectionViewCell.m
- LifeLog/LifeLog/LabelCollectionViewCell.xib
LifeLog/LifeLog.xcodeproj/project.pbxproj
| ... | ... | @@ -44,6 +44,12 @@ |
| 44 | 44 | 9CBDA0FA1F2ECE2C0055DED1 /* BaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9CBDA0F91F2ECE2C0055DED1 /* BaseViewController.m */; }; |
| 45 | 45 | 9CBDA0FF1F2F03810055DED1 /* RegisterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9CBDA0FD1F2F03810055DED1 /* RegisterViewController.m */; }; |
| 46 | 46 | 9CBDA1001F2F03810055DED1 /* RegisterViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9CBDA0FE1F2F03810055DED1 /* RegisterViewController.xib */; }; |
| 47 | + E99E13AB1F336F3600C78787 /* CollectionView.m in Sources */ = {isa = PBXBuildFile; fileRef = E99E13AA1F336F3600C78787 /* CollectionView.m */; }; | |
| 48 | + E99E13AD1F336F4500C78787 /* CollectionView.xib in Resources */ = {isa = PBXBuildFile; fileRef = E99E13AC1F336F4500C78787 /* CollectionView.xib */; }; | |
| 49 | + E99E13B11F33720600C78787 /* LabelCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E99E13AF1F33720600C78787 /* LabelCollectionViewCell.m */; }; | |
| 50 | + E99E13B21F33720600C78787 /* LabelCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E99E13B01F33720600C78787 /* LabelCollectionViewCell.xib */; }; | |
| 51 | + E9F73DCC1F338A0F004A3A6F /* HistoryListTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E9F73DCA1F338A0F004A3A6F /* HistoryListTableViewCell.m */; }; | |
| 52 | + E9F73DCD1F338A0F004A3A6F /* HistoryListTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E9F73DCB1F338A0F004A3A6F /* HistoryListTableViewCell.xib */; }; | |
| 47 | 53 | /* End PBXBuildFile section */ |
| 48 | 54 | |
| 49 | 55 | /* Begin PBXContainerItemProxy section */ |
| ... | ... | @@ -131,6 +137,15 @@ |
| 131 | 137 | 9CBDA0FC1F2F03810055DED1 /* RegisterViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterViewController.h; sourceTree = "<group>"; }; |
| 132 | 138 | 9CBDA0FD1F2F03810055DED1 /* RegisterViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RegisterViewController.m; sourceTree = "<group>"; }; |
| 133 | 139 | 9CBDA0FE1F2F03810055DED1 /* RegisterViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = RegisterViewController.xib; sourceTree = "<group>"; }; |
| 140 | + E99E13A91F336F3600C78787 /* CollectionView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CollectionView.h; sourceTree = "<group>"; }; | |
| 141 | + E99E13AA1F336F3600C78787 /* CollectionView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CollectionView.m; sourceTree = "<group>"; }; | |
| 142 | + E99E13AC1F336F4500C78787 /* CollectionView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CollectionView.xib; sourceTree = "<group>"; }; | |
| 143 | + E99E13AE1F33720600C78787 /* LabelCollectionViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LabelCollectionViewCell.h; sourceTree = "<group>"; }; | |
| 144 | + E99E13AF1F33720600C78787 /* LabelCollectionViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LabelCollectionViewCell.m; sourceTree = "<group>"; }; | |
| 145 | + E99E13B01F33720600C78787 /* LabelCollectionViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = LabelCollectionViewCell.xib; sourceTree = "<group>"; }; | |
| 146 | + E9F73DC91F338A0F004A3A6F /* HistoryListTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HistoryListTableViewCell.h; sourceTree = "<group>"; }; | |
| 147 | + E9F73DCA1F338A0F004A3A6F /* HistoryListTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HistoryListTableViewCell.m; sourceTree = "<group>"; }; | |
| 148 | + E9F73DCB1F338A0F004A3A6F /* HistoryListTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = HistoryListTableViewCell.xib; sourceTree = "<group>"; }; | |
| 134 | 149 | /* End PBXFileReference section */ |
| 135 | 150 | |
| 136 | 151 | /* Begin PBXFrameworksBuildPhase section */ |
| ... | ... | @@ -241,6 +256,7 @@ |
| 241 | 256 | 6E18CED51F2E3C0E0029891F /* ServerAPI */, |
| 242 | 257 | 6EDC8BEB1F2C2F3300765ACC /* Common */, |
| 243 | 258 | 6ECC406D1F2A5FA500AAEB97 /* Library */, |
| 259 | + E99E13A71F336F0C00C78787 /* CustomView */, | |
| 244 | 260 | 6E84E3A81F27A8A9001EB88E /* ViewControllers */, |
| 245 | 261 | 6E84E3A71F27A887001EB88E /* AppDelegate */, |
| 246 | 262 | 6E84E3801F27A701001EB88E /* Assets.xcassets */, |
| ... | ... | @@ -319,6 +335,9 @@ |
| 319 | 335 | 6E84E3B21F27A98B001EB88E /* HistoryViewController.h */, |
| 320 | 336 | 6E84E3B31F27A98B001EB88E /* HistoryViewController.m */, |
| 321 | 337 | 6E84E3B41F27A98B001EB88E /* HistoryViewController.xib */, |
| 338 | + E9F73DC91F338A0F004A3A6F /* HistoryListTableViewCell.h */, | |
| 339 | + E9F73DCA1F338A0F004A3A6F /* HistoryListTableViewCell.m */, | |
| 340 | + E9F73DCB1F338A0F004A3A6F /* HistoryListTableViewCell.xib */, | |
| 322 | 341 | ); |
| 323 | 342 | name = History; |
| 324 | 343 | sourceTree = "<group>"; |
| ... | ... | @@ -432,6 +451,27 @@ |
| 432 | 451 | name = Pods; |
| 433 | 452 | sourceTree = "<group>"; |
| 434 | 453 | }; |
| 454 | + E99E13A71F336F0C00C78787 /* CustomView */ = { | |
| 455 | + isa = PBXGroup; | |
| 456 | + children = ( | |
| 457 | + E99E13A81F336F1700C78787 /* CollectionView */, | |
| 458 | + ); | |
| 459 | + name = CustomView; | |
| 460 | + sourceTree = "<group>"; | |
| 461 | + }; | |
| 462 | + E99E13A81F336F1700C78787 /* CollectionView */ = { | |
| 463 | + isa = PBXGroup; | |
| 464 | + children = ( | |
| 465 | + E99E13AE1F33720600C78787 /* LabelCollectionViewCell.h */, | |
| 466 | + E99E13AF1F33720600C78787 /* LabelCollectionViewCell.m */, | |
| 467 | + E99E13B01F33720600C78787 /* LabelCollectionViewCell.xib */, | |
| 468 | + E99E13A91F336F3600C78787 /* CollectionView.h */, | |
| 469 | + E99E13AA1F336F3600C78787 /* CollectionView.m */, | |
| 470 | + E99E13AC1F336F4500C78787 /* CollectionView.xib */, | |
| 471 | + ); | |
| 472 | + name = CollectionView; | |
| 473 | + sourceTree = "<group>"; | |
| 474 | + }; | |
| 435 | 475 | /* End PBXGroup section */ |
| 436 | 476 | |
| 437 | 477 | /* Begin PBXNativeTarget section */ |
| ... | ... | @@ -544,6 +584,7 @@ |
| 544 | 584 | files = ( |
| 545 | 585 | 9CBDA1001F2F03810055DED1 /* RegisterViewController.xib in Resources */, |
| 546 | 586 | 6E18CED41F2E39DB0029891F /* LoginViewController.xib in Resources */, |
| 587 | + E99E13AD1F336F4500C78787 /* CollectionView.xib in Resources */, | |
| 547 | 588 | 6E84E3BB1F27A9A0001EB88E /* RankingViewController.xib in Resources */, |
| 548 | 589 | 9CA8AEEB1F31BB4600C5FC74 /* ConfirmForgetPassViewController.xib in Resources */, |
| 549 | 590 | 6E84E3C01F27A9B1001EB88E /* SNSViewController.xib in Resources */, |
| ... | ... | @@ -554,6 +595,8 @@ |
| 554 | 595 | 6EF1630A1F29069300DA306C /* Localizable.strings in Resources */, |
| 555 | 596 | 6E84E3B11F27A975001EB88E /* HomeViewController.xib in Resources */, |
| 556 | 597 | 6E84E3B61F27A98B001EB88E /* HistoryViewController.xib in Resources */, |
| 598 | + E99E13B21F33720600C78787 /* LabelCollectionViewCell.xib in Resources */, | |
| 599 | + E9F73DCD1F338A0F004A3A6F /* HistoryListTableViewCell.xib in Resources */, | |
| 557 | 600 | ); |
| 558 | 601 | runOnlyForDeploymentPostprocessing = 0; |
| 559 | 602 | }; |
| 560 | 603 | |
| 561 | 604 | |
| ... | ... | @@ -633,13 +676,16 @@ |
| 633 | 676 | 6E8DA0F71F2BAC3400CCE941 /* TodayViewController.m in Sources */, |
| 634 | 677 | 6E7F93451F35872B00EFBC71 /* UIScrollView+TPKeyboardAvoidingAdditions.m in Sources */, |
| 635 | 678 | 6E48AF0D1F2F9D3300C1D184 /* CustomTextField.m in Sources */, |
| 679 | + E99E13AB1F336F3600C78787 /* CollectionView.m in Sources */, | |
| 636 | 680 | 6E84E3B01F27A975001EB88E /* HomeViewController.m in Sources */, |
| 637 | 681 | 6E84E3791F27A701001EB88E /* AppDelegate.m in Sources */, |
| 638 | 682 | 6E84E3BA1F27A9A0001EB88E /* RankingViewController.m in Sources */, |
| 639 | 683 | 6E7F93441F35872B00EFBC71 /* TPKeyboardAvoidingTableView.m in Sources */, |
| 684 | + E9F73DCC1F338A0F004A3A6F /* HistoryListTableViewCell.m in Sources */, | |
| 640 | 685 | 6EDC8BF41F2C68D700765ACC /* CMMotionActivityExtra.m in Sources */, |
| 641 | 686 | 9CBDA0FF1F2F03810055DED1 /* RegisterViewController.m in Sources */, |
| 642 | 687 | 9CA8AEEA1F31BB4600C5FC74 /* ConfirmForgetPassViewController.m in Sources */, |
| 688 | + E99E13B11F33720600C78787 /* LabelCollectionViewCell.m in Sources */, | |
| 643 | 689 | 6EDC8BEE1F2C2FB800765ACC /* Utilities.m in Sources */, |
| 644 | 690 | 6E84E3C51F27ACAE001EB88E /* MapViewController.m in Sources */, |
| 645 | 691 | 6E18CEDC1F2E40F50029891F /* User.m in Sources */, |
LifeLog/LifeLog/AppDelegate.m
| ... | ... | @@ -83,7 +83,8 @@ |
| 83 | 83 | HistoryViewController *historyVC = [[HistoryViewController alloc] initWithNibName:@"HistoryViewController" bundle:nil]; |
| 84 | 84 | UINavigationController *naviHistory = [[UINavigationController alloc] initWithRootViewController:historyVC]; |
| 85 | 85 | naviHistory.tabBarItem = [[UITabBarItem alloc] initWithTitle:NSLocalizedString(@"lifelog.tapbar.history", @"") image:[UIImage imageNamed:@"tapbar_history"] tag:2]; |
| 86 | - | |
| 86 | + naviHistory.navigationBar.hidden = YES; | |
| 87 | + | |
| 87 | 88 | RankingViewController *rankingVC = [[RankingViewController alloc] initWithNibName:@"RankingViewController" bundle:nil]; |
| 88 | 89 | UINavigationController *naviRanking = [[UINavigationController alloc] initWithRootViewController:rankingVC]; |
| 89 | 90 | naviRanking.tabBarItem = [[UITabBarItem alloc] initWithTitle:NSLocalizedString(@"lifelog.tapbar.ranking", @"") image:[UIImage imageNamed:@"tapbar_ranking"] tag:3]; |
LifeLog/LifeLog/CollectionView.h
| 1 | +// | |
| 2 | +// CollectionView.h | |
| 3 | +// LifeLog | |
| 4 | +// | |
| 5 | +// Created by nvtu on 8/3/17. | |
| 6 | +// Copyright © 2017 PhongNV. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import <UIKit/UIKit.h> | |
| 10 | + | |
| 11 | +@interface CollectionView : UIView <UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout> { | |
| 12 | + int _number; | |
| 13 | + int _selectedIndex; | |
| 14 | + | |
| 15 | + float _spacing; | |
| 16 | + float _cornerRadius; | |
| 17 | + | |
| 18 | + UIColor * _highlightColor; | |
| 19 | + UIColor * _normalColor; | |
| 20 | + UIColor * _textColor; | |
| 21 | + | |
| 22 | + NSArray * _arrayTitle; | |
| 23 | +} | |
| 24 | + | |
| 25 | +@property (weak, nonatomic) IBOutlet UIView *view; | |
| 26 | +@property (weak, nonatomic) IBOutlet UICollectionView *collectionView; | |
| 27 | + | |
| 28 | +-(void) setButtonNumber: (int) number; | |
| 29 | +-(void) setSpacing: (float) spacing; | |
| 30 | +-(void) setCornerRadius: (float) radius; | |
| 31 | +-(void) setSelectedIndex: (int) index; | |
| 32 | +-(void) setNormalColor: (UIColor *) normal highlightColor: (UIColor *) highlight textColor: (UIColor *) text; | |
| 33 | +-(void) setArrayTitle: (NSArray *) title; | |
| 34 | + | |
| 35 | +-(int) getCurrentIndex; | |
| 36 | +@end |
LifeLog/LifeLog/CollectionView.m
| 1 | +// | |
| 2 | +// CollectionView.m | |
| 3 | +// LifeLog | |
| 4 | +// | |
| 5 | +// Created by nvtu on 8/3/17. | |
| 6 | +// Copyright © 2017 PhongNV. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import "CollectionView.h" | |
| 10 | +#import "LabelCollectionViewCell.h" | |
| 11 | +#import "Utilities.h" | |
| 12 | + | |
| 13 | +@implementation CollectionView | |
| 14 | + | |
| 15 | +-(id) initWithCoder:(NSCoder *)aDecoder { | |
| 16 | + self = [super initWithCoder:aDecoder]; | |
| 17 | + if(self) { | |
| 18 | + [[UINib nibWithNibName:@"CollectionView" bundle:nil] instantiateWithOwner:self options:nil]; | |
| 19 | + [self addSubview:self.view]; | |
| 20 | + self.view.frame = self.bounds; | |
| 21 | + _number = 0; | |
| 22 | + _spacing = 1; | |
| 23 | + _cornerRadius = 5.0; | |
| 24 | + _highlightColor = [Utilities convertHecToColor:0x999999]; | |
| 25 | + _normalColor = [UIColor whiteColor]; | |
| 26 | + _textColor = [UIColor blackColor]; | |
| 27 | + } | |
| 28 | + return self; | |
| 29 | +} | |
| 30 | + | |
| 31 | +-(void) awakeFromNib { | |
| 32 | + [super awakeFromNib]; | |
| 33 | + [self.collectionView registerNib:[UINib nibWithNibName:@"LabelCollectionViewCell" bundle:nil] forCellWithReuseIdentifier:@"LabelCell"]; | |
| 34 | +} | |
| 35 | + | |
| 36 | +-(void) setButtonNumber: (int) number { | |
| 37 | + _number = number; | |
| 38 | +} | |
| 39 | + | |
| 40 | +-(void) setSpacing: (float) spacing { | |
| 41 | + _spacing = spacing; | |
| 42 | +} | |
| 43 | + | |
| 44 | +-(void) setCornerRadius: (float) radius { | |
| 45 | + _cornerRadius = radius; | |
| 46 | +} | |
| 47 | + | |
| 48 | +-(void) setSelectedIndex: (int) index { | |
| 49 | + _selectedIndex = index; | |
| 50 | + [_collectionView reloadData]; | |
| 51 | +} | |
| 52 | + | |
| 53 | +-(void) setNormalColor: (UIColor *) normal highlightColor: (UIColor *) highlight textColor: (UIColor *) text { | |
| 54 | + _normalColor = normal; | |
| 55 | + _highlightColor = highlight; | |
| 56 | + _textColor = text; | |
| 57 | +} | |
| 58 | + | |
| 59 | +-(void) setArrayTitle: (NSArray *) title { | |
| 60 | + _arrayTitle = title; | |
| 61 | +} | |
| 62 | + | |
| 63 | +-(int) getCurrentIndex { | |
| 64 | + return _selectedIndex; | |
| 65 | +} | |
| 66 | + | |
| 67 | +#pragma mark - UICollectionView Delegate | |
| 68 | +- (NSInteger) numberOfSectionsInCollectionView:(UICollectionView *)collectionView { | |
| 69 | + return 1; | |
| 70 | +} | |
| 71 | + | |
| 72 | +- (NSInteger) collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { | |
| 73 | + return _number; | |
| 74 | +} | |
| 75 | + | |
| 76 | +- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { | |
| 77 | + LabelCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"LabelCell" forIndexPath:indexPath]; | |
| 78 | + cell.lblTitle.text = [_arrayTitle objectAtIndex:indexPath.row]; | |
| 79 | + cell.lblTitle.textColor = _textColor; | |
| 80 | + cell.lblTitle.layer.cornerRadius = _cornerRadius; | |
| 81 | + cell.lblTitle.backgroundColor = (indexPath.row == _selectedIndex) ? _highlightColor : _normalColor; | |
| 82 | + return cell; | |
| 83 | +} | |
| 84 | + | |
| 85 | +- (CGSize) collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath { | |
| 86 | + return CGSizeMake((self.frame.size.width - (_spacing * _number)) / _number, collectionView.frame.size.height); | |
| 87 | +} | |
| 88 | + | |
| 89 | +- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section { | |
| 90 | + return _spacing; | |
| 91 | +} | |
| 92 | + | |
| 93 | +-(void) collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { | |
| 94 | + _selectedIndex = indexPath.row; | |
| 95 | + [collectionView reloadData]; | |
| 96 | +} | |
| 97 | +@end |
LifeLog/LifeLog/CollectionView.xib
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="12118" systemVersion="16D32" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES"> | |
| 3 | + <device id="retina4_7" orientation="portrait"> | |
| 4 | + <adaptation id="fullscreen"/> | |
| 5 | + </device> | |
| 6 | + <dependencies> | |
| 7 | + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12086"/> | |
| 8 | + <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | |
| 9 | + </dependencies> | |
| 10 | + <objects> | |
| 11 | + <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="CollectionView"> | |
| 12 | + <connections> | |
| 13 | + <outlet property="collectionView" destination="ubI-h8-MKY" id="QC1-lD-4ud"/> | |
| 14 | + <outlet property="view" destination="iN0-l3-epB" id="31f-60-rLl"/> | |
| 15 | + </connections> | |
| 16 | + </placeholder> | |
| 17 | + <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> | |
| 18 | + <view contentMode="scaleToFill" id="iN0-l3-epB"> | |
| 19 | + <rect key="frame" x="0.0" y="0.0" width="375" height="50"/> | |
| 20 | + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | |
| 21 | + <subviews> | |
| 22 | + <collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" fixedFrame="YES" bounces="NO" scrollEnabled="NO" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="none" translatesAutoresizingMaskIntoConstraints="NO" id="ubI-h8-MKY"> | |
| 23 | + <rect key="frame" x="0.0" y="0.0" width="375" height="50"/> | |
| 24 | + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> | |
| 25 | + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> | |
| 26 | + <collectionViewFlowLayout key="collectionViewLayout" scrollDirection="horizontal" minimumLineSpacing="3" minimumInteritemSpacing="0.0" id="Q46-34-Q0S"> | |
| 27 | + <size key="itemSize" width="50" height="50"/> | |
| 28 | + <size key="headerReferenceSize" width="0.0" height="0.0"/> | |
| 29 | + <size key="footerReferenceSize" width="0.0" height="0.0"/> | |
| 30 | + <inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/> | |
| 31 | + </collectionViewFlowLayout> | |
| 32 | + <connections> | |
| 33 | + <outlet property="dataSource" destination="-1" id="Zto-lx-R1Z"/> | |
| 34 | + <outlet property="delegate" destination="-1" id="bmL-e4-Zy9"/> | |
| 35 | + </connections> | |
| 36 | + </collectionView> | |
| 37 | + </subviews> | |
| 38 | + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> | |
| 39 | + <nil key="simulatedStatusBarMetrics"/> | |
| 40 | + <nil key="simulatedTopBarMetrics"/> | |
| 41 | + <nil key="simulatedBottomBarMetrics"/> | |
| 42 | + <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/> | |
| 43 | + <point key="canvasLocation" x="5.5" y="-17"/> | |
| 44 | + </view> | |
| 45 | + </objects> | |
| 46 | +</document> |
LifeLog/LifeLog/HistoryListTableViewCell.h
| 1 | +// | |
| 2 | +// HistoryListTableViewCell.h | |
| 3 | +// LifeLog | |
| 4 | +// | |
| 5 | +// Created by nvtu on 8/3/17. | |
| 6 | +// Copyright © 2017 PhongNV. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import <UIKit/UIKit.h> | |
| 10 | + | |
| 11 | +@interface HistoryListTableViewCell : UITableViewCell | |
| 12 | + | |
| 13 | +@property (weak, nonatomic) IBOutlet UILabel *lblTitle; | |
| 14 | +@property (weak, nonatomic) IBOutlet UILabel *lblStep; | |
| 15 | +@property (weak, nonatomic) IBOutlet UILabel *lblDistance; | |
| 16 | +@property (weak, nonatomic) IBOutlet UILabel *lblPower; | |
| 17 | +@property (weak, nonatomic) IBOutlet UILabel *lblDuration; | |
| 18 | + | |
| 19 | +@end |
LifeLog/LifeLog/HistoryListTableViewCell.m
| 1 | +// | |
| 2 | +// HistoryListTableViewCell.m | |
| 3 | +// LifeLog | |
| 4 | +// | |
| 5 | +// Created by nvtu on 8/3/17. | |
| 6 | +// Copyright © 2017 PhongNV. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import "HistoryListTableViewCell.h" | |
| 10 | + | |
| 11 | +@implementation HistoryListTableViewCell | |
| 12 | + | |
| 13 | +- (void)awakeFromNib { | |
| 14 | + [super awakeFromNib]; | |
| 15 | + // Initialization code | |
| 16 | +} | |
| 17 | + | |
| 18 | +- (void)setSelected:(BOOL)selected animated:(BOOL)animated { | |
| 19 | + [super setSelected:selected animated:animated]; | |
| 20 | + | |
| 21 | + // Configure the view for the selected state | |
| 22 | +} | |
| 23 | + | |
| 24 | +@end |
LifeLog/LifeLog/HistoryListTableViewCell.xib
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="12118" systemVersion="16D32" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES"> | |
| 3 | + <device id="retina4_7" orientation="portrait"> | |
| 4 | + <adaptation id="fullscreen"/> | |
| 5 | + </device> | |
| 6 | + <dependencies> | |
| 7 | + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12086"/> | |
| 8 | + <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | |
| 9 | + </dependencies> | |
| 10 | + <objects> | |
| 11 | + <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> | |
| 12 | + <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> | |
| 13 | + <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="HistoryListCell" rowHeight="100" id="KGk-i7-Jjw" customClass="HistoryListTableViewCell"> | |
| 14 | + <rect key="frame" x="0.0" y="0.0" width="320" height="188"/> | |
| 15 | + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> | |
| 16 | + <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM"> | |
| 17 | + <rect key="frame" x="0.0" y="0.0" width="320" height="188"/> | |
| 18 | + <autoresizingMask key="autoresizingMask"/> | |
| 19 | + <subviews> | |
| 20 | + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="l97-iI-4Nl"> | |
| 21 | + <rect key="frame" x="0.0" y="0.0" width="320" height="35"/> | |
| 22 | + <subviews> | |
| 23 | + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="1日(月 )" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zW0-JI-PIE"> | |
| 24 | + <rect key="frame" x="4" y="0.0" width="80" height="30"/> | |
| 25 | + <constraints> | |
| 26 | + <constraint firstAttribute="width" constant="80" id="2SR-JF-W5T"/> | |
| 27 | + </constraints> | |
| 28 | + <fontDescription key="fontDescription" type="system" pointSize="13"/> | |
| 29 | + <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | |
| 30 | + <nil key="highlightedColor"/> | |
| 31 | + </label> | |
| 32 | + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="1000" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qgK-8d-giH"> | |
| 33 | + <rect key="frame" x="240" y="0.0" width="80" height="30"/> | |
| 34 | + <constraints> | |
| 35 | + <constraint firstAttribute="width" constant="80" id="efJ-dz-Eyh"/> | |
| 36 | + </constraints> | |
| 37 | + <fontDescription key="fontDescription" type="system" pointSize="13"/> | |
| 38 | + <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | |
| 39 | + <nil key="highlightedColor"/> | |
| 40 | + </label> | |
| 41 | + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="1000 step" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Eop-bg-Dy9"> | |
| 42 | + <rect key="frame" x="84" y="0.0" width="156" height="30"/> | |
| 43 | + <fontDescription key="fontDescription" type="system" pointSize="13"/> | |
| 44 | + <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | |
| 45 | + <nil key="highlightedColor"/> | |
| 46 | + </label> | |
| 47 | + </subviews> | |
| 48 | + <color key="backgroundColor" red="0.36078431372549019" green="0.36078431372549019" blue="0.36078431372549019" alpha="1" colorSpace="calibratedRGB"/> | |
| 49 | + <constraints> | |
| 50 | + <constraint firstAttribute="trailing" secondItem="qgK-8d-giH" secondAttribute="trailing" id="4eG-yY-bgS"/> | |
| 51 | + <constraint firstItem="qgK-8d-giH" firstAttribute="top" secondItem="l97-iI-4Nl" secondAttribute="top" id="8YS-4x-HVg"/> | |
| 52 | + <constraint firstAttribute="height" constant="35" id="R67-hu-UQW"/> | |
| 53 | + <constraint firstItem="Eop-bg-Dy9" firstAttribute="leading" secondItem="zW0-JI-PIE" secondAttribute="trailing" id="Rh3-lL-CfE"/> | |
| 54 | + <constraint firstAttribute="bottom" secondItem="zW0-JI-PIE" secondAttribute="bottom" constant="5" id="W55-gD-NIx"/> | |
| 55 | + <constraint firstAttribute="bottom" secondItem="Eop-bg-Dy9" secondAttribute="bottom" constant="5" id="Wor-Tc-WPf"/> | |
| 56 | + <constraint firstItem="zW0-JI-PIE" firstAttribute="leading" secondItem="l97-iI-4Nl" secondAttribute="leading" constant="4" id="ZBL-QQ-0jD"/> | |
| 57 | + <constraint firstAttribute="bottom" secondItem="qgK-8d-giH" secondAttribute="bottom" constant="5" id="cyO-Tr-6Md"/> | |
| 58 | + <constraint firstItem="zW0-JI-PIE" firstAttribute="top" secondItem="l97-iI-4Nl" secondAttribute="top" id="iDg-dJ-y0S"/> | |
| 59 | + <constraint firstItem="qgK-8d-giH" firstAttribute="leading" secondItem="Eop-bg-Dy9" secondAttribute="trailing" id="vhm-kx-gmg"/> | |
| 60 | + <constraint firstItem="Eop-bg-Dy9" firstAttribute="top" secondItem="l97-iI-4Nl" secondAttribute="top" id="xli-4P-Kun"/> | |
| 61 | + </constraints> | |
| 62 | + <userDefinedRuntimeAttributes> | |
| 63 | + <userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius"> | |
| 64 | + <integer key="value" value="5"/> | |
| 65 | + </userDefinedRuntimeAttribute> | |
| 66 | + </userDefinedRuntimeAttributes> | |
| 67 | + </view> | |
| 68 | + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="yAb-sD-Uf2"> | |
| 69 | + <rect key="frame" x="0.0" y="30" width="320" height="158"/> | |
| 70 | + <subviews> | |
| 71 | + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="距離" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="pTa-iM-GGE"> | |
| 72 | + <rect key="frame" x="10" y="8" width="45" height="15"/> | |
| 73 | + <constraints> | |
| 74 | + <constraint firstAttribute="height" constant="15" id="FsR-rA-SoL"/> | |