Skip to content

Commit

Permalink
feat: 믹스패널 로깅 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
yunyezl committed Jun 8, 2023
1 parent d891b41 commit 3dba52c
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import DesignSystem
import UIKit

import ReactorKit
import Mixpanel

class AbilityViewController: BaseViewController, PageTabProtocol, View {

Expand Down Expand Up @@ -113,6 +114,8 @@ class AbilityViewController: BaseViewController, PageTabProtocol, View {

extension AbilityViewController: UICollectionViewDelegate {
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
Mixpanel.mainInstance().track(event: "모아보기_역량_목록_Clicked")

let detailViewController = DetailViewController(previousView: .ability)
detailViewController.reactor = DetailReactor(
title: self.reactor?.currentState.abilities[indexPath.row].name ?? "",
Expand Down
11 changes: 11 additions & 0 deletions Projects/App/Sources/Screens/Library/DetailViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import DesignSystem
import UIKit

import ReactorKit
import Mixpanel

class DetailViewController: BaseViewController, View {
var disposeBag = DisposeBag()
Expand Down Expand Up @@ -67,6 +68,7 @@ class DetailViewController: BaseViewController, View {
self.setLayout()
self.registerCell()
self.setDataSource()
self.trackEmptyView()
}

private func setNavigationBar() {
Expand Down Expand Up @@ -190,6 +192,15 @@ class DetailViewController: BaseViewController, View {
self.dataSource.apply(snapshot)
}

func trackEmptyView() {
let tapGesture = UITapGestureRecognizer(target: self, action: #selector(addMixpanel(sender:)))
emptyView.addGestureRecognizer(tapGesture)
}

@objc
func addMixpanel(sender: UITapGestureRecognizer) {
Mixpanel.mainInstance().track(event: "모아보기_프로젝트_목록_Clicked")
}
}

extension DetailViewController: CalendarBottomSheetDelegate {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import DesignSystem
import UIKit

import ReactorKit
import Mixpanel

class ProjectViewController: BaseViewController, PageTabProtocol, View {

Expand Down Expand Up @@ -118,6 +119,8 @@ class ProjectViewController: BaseViewController, PageTabProtocol, View {

extension ProjectViewController: UICollectionViewDelegate {
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
Mixpanel.mainInstance().track(event: "모아보기_프로젝트_목록_Clicked")

let detailViewController = DetailViewController(previousView: .project)
detailViewController.reactor = DetailReactor(
title: self.reactor?.currentState.projects[indexPath.row].name ?? "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import Domain

import ReactorKit
import Mixpanel

final class ProjectManagementReactor: Reactor {
var initialState: State
Expand Down Expand Up @@ -68,6 +69,8 @@ final class ProjectManagementReactor: Reactor {
return .empty()
}

Mixpanel.mainInstance().track(event: "설정_프로젝트 생성 버튼_Clicked")

return .concat(
[self.projectUseCase
.createProject(title: currentState.newProjectTitle)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import UIKit

import ReactorKit
import SnapKit
import Mixpanel

class SettingViewController: BaseViewController, View {

Expand Down Expand Up @@ -241,6 +242,8 @@ extension SettingViewController: UITableViewDelegate {
let view: SFSafariViewController = SFSafariViewController(url: url!)
self.present(view, animated: true, completion: nil)
case .csv:
Mixpanel.mainInstance().track(event: "설정_추출버튼_Clicked")

let alert = UIAlertController(title: Text.preparing,
message: nil,
preferredStyle: .alert)
Expand All @@ -260,6 +263,7 @@ extension SettingViewController: UITableViewDelegate {
preferredStyle: .alert)
alert.addAction(UIAlertAction(title: Text.cancel, style: .cancel))
alert.addAction(UIAlertAction(title: Text.confirm, style: .default) { _ in
Mixpanel.mainInstance().track(event: "설정_로그아웃 모달 확인 버튼_Clicked")
UserDefaultsManager.shared.removeToken()
RootViewChange.shared.setRootViewController(.splash)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import ReactorKit
import RxSwift
import SnapKit

import Mixpanel

// swiftlint:disable all
final class WithdrawalViewController: BaseViewController, View {
var disposeBag: RxSwift.DisposeBag = DisposeBag()
Expand Down Expand Up @@ -206,6 +208,7 @@ final class WithdrawalViewController: BaseViewController, View {
owner.presentAlert(
type: .completeWithdraw,
okAction: { _ in
Mixpanel.mainInstance().track(event: "설정_탈퇴 모달 확인 버튼_Clicked")
owner.withDrawPublisher.onNext(())
}
)
Expand Down

0 comments on commit 3dba52c

Please sign in to comment.