Skip to content

Commit

Permalink
#27 Feat: Cell animation
Browse files Browse the repository at this point in the history
  • Loading branch information
zzisun committed May 11, 2021
1 parent a7e92c0 commit 664c367
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
3 changes: 2 additions & 1 deletion iOS/baseballApp/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ target 'baseballApp' do
pod 'RxSwift'
pod 'RxCocoa'
pod 'Alamofire'
target 'baseballAppTests' do
pod 'RxDataSources'
target 'baseballAppTests' do
inherit! :search_paths
# Pods for testing
end
Expand Down
12 changes: 11 additions & 1 deletion iOS/baseballApp/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,30 +1,40 @@
PODS:
- Alamofire (5.4.3)
- Differentiator (5.0.0)
- RxCocoa (6.1.0):
- RxRelay (= 6.1.0)
- RxSwift (= 6.1.0)
- RxDataSources (5.0.0):
- Differentiator (~> 5.0)
- RxCocoa (~> 6.0)
- RxSwift (~> 6.0)
- RxRelay (6.1.0):
- RxSwift (= 6.1.0)
- RxSwift (6.1.0)

DEPENDENCIES:
- Alamofire
- RxCocoa
- RxDataSources
- RxSwift

SPEC REPOS:
trunk:
- Alamofire
- Differentiator
- RxCocoa
- RxDataSources
- RxRelay
- RxSwift

SPEC CHECKSUMS:
Alamofire: e447a2774a40c996748296fa2c55112fdbbc42f9
Differentiator: e8497ceab83c1b10ca233716d547b9af21b9344d
RxCocoa: 5c51f02d562cbd94629f6c26cf0c80fe4ab8d343
RxDataSources: aa47cc1ed6c500fa0dfecac5c979b723542d79cf
RxRelay: 483e1a19fad961b41f0b0c0bee506f46c1ae14fe
RxSwift: a834e5c538e89eca0cae86f403f4fbf0336786ce

PODFILE CHECKSUM: bfd5efee62af1da2c3e9239e52797cdc2a4d7c90
PODFILE CHECKSUM: d2d7901f019d6d03a1d9db762401d5160e98b9fb

COCOAPODS: 1.10.1
8 changes: 4 additions & 4 deletions iOS/baseballApp/baseballApp/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
<rect key="frame" x="0.0" y="0.0" width="346" height="139"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Game 0" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3FB-vA-mfu">
<rect key="frame" x="143" y="29.5" width="60" height="20.5"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3FB-vA-mfu">
<rect key="frame" x="173" y="39.5" width="0.0" height="0.0"/>
<constraints>
<constraint firstAttribute="width" secondItem="3FB-vA-mfu" secondAttribute="height" multiplier="59:20" id="QBY-wP-aJn"/>
</constraints>
Expand All @@ -53,7 +53,7 @@
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillProportionally" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="O8d-u4-vK3">
<rect key="frame" x="57" y="69" width="232" height="41"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Home" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" adjustsFontForContentSizeCategory="YES" translatesAutoresizingMaskIntoConstraints="NO" id="w5u-NF-G8J">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="w5u-NF-G8J">
<rect key="frame" x="0.0" y="0.0" width="94.5" height="41"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="34"/>
<nil key="textColor"/>
Expand All @@ -68,7 +68,7 @@
<userDefinedRuntimeAttribute type="boolean" keyPath="" value="YES"/>
</userDefinedRuntimeAttributes>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Away" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" minimumFontSize="17" adjustsFontForContentSizeCategory="YES" translatesAutoresizingMaskIntoConstraints="NO" id="VqJ-U7-lsZ">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="VqJ-U7-lsZ">
<rect key="frame" x="144.5" y="0.0" width="87.5" height="41"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="34"/>
<nil key="textColor"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@ class HomeViewController: UIViewController {
viewModel.getGameInfo()
viewModel.games
.bind(to: mainCollectionView.rx.items(cellIdentifier: Identifier.GameCell, cellType: GameCell.self)) {
_, game, cell in
cell.configureCell(game: game)
row, game, cell in

cell.configureCell(game: game)
cell.alpha = 0
UIView.animate(withDuration: 0.5, delay: 0.5 * Double(row)) {
cell.alpha = 1
}
}.disposed(by: disposeBag)
}

Expand Down

0 comments on commit 664c367

Please sign in to comment.