Skip to content

Commit

Permalink
Merge pull request #32 from Jae-eun/feedLottie
Browse files Browse the repository at this point in the history
tag Lottie 적용
  • Loading branch information
ebPark9511 authored Mar 16, 2019
2 parents dd58df5 + 6ba261d commit 4ceebea
Show file tree
Hide file tree
Showing 12 changed files with 146 additions and 89 deletions.
15 changes: 15 additions & 0 deletions Toonie.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
0957B41AD138D0A49135F214132A015A /* ToonieTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8BEF0670CA0E9737AC0D8BB4C759F3D /* ToonieTests.swift */; };
19D70C5FD733A11319F2B4D5C382CB99 /* UIImageView+imageFromUrl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 307197284628654A8308DA52AEF4572F /* UIImageView+imageFromUrl.swift */; };
16B5F805D0B84D4BAE707BAAED697F08 /* giphy.gif in Resources */ = {isa = PBXBuildFile; fileRef = D8E1AD8B779448DA04C464E96AECF285 /* giphy.gif */; };
42C9F1D0BE9554E33B9D52C08E676107 /* tag.json in Resources */ = {isa = PBXBuildFile; fileRef = CB4CC3F62E900540AB7D0805DE646065 /* tag.json */; };

/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -84,6 +86,8 @@
D32B5ACD1A82F7A257245C24D4210ADC /* ToonieTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ToonieTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
307197284628654A8308DA52AEF4572F /* UIImageView+imageFromUrl.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = "UIImageView+imageFromUrl.swift"; path = "Toonie/MyPage/UIImageView+imageFromUrl.swift"; sourceTree = SOURCE_ROOT; };
D8E1AD8B779448DA04C464E96AECF285 /* giphy.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; name = giphy.gif; path = "toonie/Supporting Files/giphy.gif"; sourceTree = SOURCE_ROOT; };
CB4CC3F62E900540AB7D0805DE646065 /* tag.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = tag.json; sourceTree = "<group>"; };

/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -106,6 +110,14 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
D79B36B02E3BE1C7354741667915DF34 /* tag.json */ = {
isa = PBXGroup;
children = (
CB4CC3F62E900540AB7D0805DE646065 /* tag.json */,
);
path = tag.json;
sourceTree = "<group>";
};
1E5EEACC73F0B2067BEA386D942B1580 /* MyPage */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -224,6 +236,7 @@
isa = PBXGroup;
children = (
D7BD45CDB0C7E1A8A0FE2DB9C0C25B75 /* FeedViewController.swift */,
D79B36B02E3BE1C7354741667915DF34 /* tag.json */,
);
path = Controller;
sourceTree = "<group>";
Expand Down Expand Up @@ -361,6 +374,8 @@
4FFEF2D3318AC791E3F9C6ECC7710F1B /* Main.storyboard in Resources */,
3603ED7C6D7679C3634C60C341C440F4 /* MyPage.storyboard in Resources */,
16B5F805D0B84D4BAE707BAAED697F08 /* giphy.gif in Resources */,
42C9F1D0BE9554E33B9D52C08E676107 /* tag.json in Resources */,

);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
32 changes: 29 additions & 3 deletions Toonie/Feed/Controller/FeedViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,48 @@
//

import UIKit
import Lottie

// 홈 화면
final class FeedViewController: UIViewController {

// MARK: - IBOutlet

@IBOutlet weak var tagView: UIView!
@IBOutlet weak var forYouCollectionView: UICollectionView!
@IBOutlet weak var recentCollectionView: UICollectionView!
@IBOutlet weak var favoriteCollectionView: UICollectionView!

// MARK: - Property

private var tagAnimationView: LOTAnimationView?

// MARK: - Life Cycle

override func viewDidLoad() {
super.viewDidLoad()

}

override func viewWillAppear(_ animated: Bool) {
setTagAnimationView()
}

// MARK: - Function

///tagAnimationView 세팅
func setTagAnimationView() {
tagAnimationView = LOTAnimationView(name: "tag")
if let tagAnimationView = tagAnimationView {
tagAnimationView.contentMode = .scaleAspectFill
tagAnimationView.frame = CGRect.init(x: 0,
y: 0,
width: tagView.bounds.width,
height: tagView.bounds.height)
tagView.addSubview(tagAnimationView)
tagAnimationView.play()
}
}
}

// MARK: - UICollectionViewDataSource
Expand All @@ -32,11 +58,11 @@ extension FeedViewController: UICollectionViewDataSource {
func collectionView(_ collectionView: UICollectionView,
numberOfItemsInSection section: Int) -> Int {
if collectionView == forYouCollectionView {
return 1
return 3
} else if collectionView == recentCollectionView {
return 1
return 3
} else if collectionView == favoriteCollectionView {
return 1
return 3
} else {
return 0
}
Expand Down
1 change: 1 addition & 0 deletions Toonie/Feed/Controller/tag.json/tag.json

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions Toonie/Feed/View/FavoriteCollectionViewCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,5 @@ final class FavoriteCollectionViewCell: UICollectionViewCell {
favoriteToonImageView.image = UIImage(named: "sample3")
favoriteToonTitleLabel.text = "감자"
favoriteToonTagLabel.text = "#직장인 #신혼"

}

/// 이미지 모서리 둥글게 처리
func setFavoriteToonImageView() {
favoriteToonImageView.layer.setBorder(color: .clear, width: 0.0, radius: 5.0)
}
}
Loading

0 comments on commit 4ceebea

Please sign in to comment.