Skip to content

Commit

Permalink
💫 :: [#116] FeatureLayer / PullToRefresh 실행 시 LottieAnimation을 실행
Browse files Browse the repository at this point in the history
  • Loading branch information
baekteun committed Jul 27, 2023
1 parent c0924dc commit bca04f4
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ public extension TargetDependency {
}

public extension TargetDependency.SPM {
static let Lottie = TargetDependency.external(name: "Lottie")
static let Anim = TargetDependency.external(name: "Anim")
static let CombineMiniature = TargetDependency.external(name: "CombineMiniature")
static let AsyncNeiSwift = TargetDependency.external(name: "AsyncNeiSwift")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ final class MassageViewController: BaseStoredViewController<MassageStore> {
.then {
$0.register(cellType: MassageCell.self)
}
private let massageRefreshContorol = UIRefreshControl()
private let massageRefreshContorol = DotoriRefreshControl()
private lazy var massageTableAdapter = TableViewAdapter<GenericSectionModel<MassageRankModel>>(
tableView: massageTableView
) { tableView, indexPath, item in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ final class NoticeViewController: BaseStoredViewController<NoticeStore> {
.then {
$0.register(cellType: NoticeCell.self)
}
private let noticeRefreshControl = UIRefreshControl()
private let noticeRefreshControl = DotoriRefreshControl()
private lazy var noticeTableAdapter = TableViewAdapter<GenericSectionModel<NoticeModel>>(
tableView: noticeTableView
) { tableView, indexPath, notice in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ final class SelfStudyViewController: BaseStoredViewController<SelfStudyStore> {
.then {
$0.register(cellType: SelfStudyCell.self)
}
private let selfStudyRefreshContorol = UIRefreshControl()
private let selfStudyRefreshContorol = DotoriRefreshControl()
private lazy var selfStudyTableAdapter = TableViewAdapter<GenericSectionModel<SelfStudyRankModel>>(
tableView: selfStudyTableView
) { [store] tableView, indexPath, item in
Expand Down
1 change: 1 addition & 0 deletions Projects/UserInterface/DesignSystem/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ let project = Project.module(
dependencies: [
.SPM.Anim,
.SPM.MSGLayout,
.SPM.Lottie,
.userInterface(target: .DWebKit),
.shared(target: .GlobalThirdPartyLibrary),
.shared(target: .UIKitUtil)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import Lottie
import MSGLayout
import UIKit

public final class DotoriRefreshControl: UIRefreshControl {
private let dotoriLoadingView = LottieAnimationView(
animation: AnimationAsset.dotoriLoading.animation
)

public override init() {
super.init()
self.tintColor = .clear
dotoriLoadingView.loopMode = .loop
self.addSubviews {
dotoriLoadingView
}
MSGLayout.buildLayout {
dotoriLoadingView.layout
.size(100)
.center(.toSuperview())
}
dotoriLoadingView.play()
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

public override func beginRefreshing() {
super.beginRefreshing()
dotoriLoadingView.play()
}
}
1 change: 1 addition & 0 deletions Tuist/Dependencies.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ let dependencies = Dependencies(
carthage: nil,
swiftPackageManager: SwiftPackageManagerDependencies(
[
.remote(url: "https://github.com/airbnb/lottie-ios.git", requirement: .exact("4.2.0")),
.remote(url: "https://github.com/GSM-MSG/Anim.git", requirement: .exact("1.1.0")),
.remote(url: "https://github.com/GSM-MSG/Miniature.git", requirement: .exact("1.3.1")),
.remote(url: "https://github.com/baekteun/NeiSwift.git", requirement: .exact("2.0.2")),
Expand Down

0 comments on commit bca04f4

Please sign in to comment.