Skip to content

Commit

Permalink
[#12] HandyTabComponent -> HandyTabCell 이름 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
chongin12 committed Jan 9, 2025
1 parent 092e1bc commit cd6ba50
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions Handy/Handy.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
2D41E8162C5A21B50043161D /* HandyFab.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D41E8152C5A21B50043161D /* HandyFab.swift */; };
6FD1A1802D213129001E6F2E /* TabsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FD1A17F2D21311C001E6F2E /* TabsViewController.swift */; };
6FE73E942D23C52F00E06422 /* HandyTabs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FE73E932D23C52C00E06422 /* HandyTabs.swift */; };
6FE73E962D23C55900E06422 /* HandyTabComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FE73E952D23C55900E06422 /* HandyTabComponent.swift */; };
6FE73E962D23C55900E06422 /* HandyTabCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FE73E952D23C55900E06422 /* HandyTabCell.swift */; };
6FE73E982D23D7A900E06422 /* MainViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FE73E972D23D6E500E06422 /* MainViewController.swift */; };
A56B3DE22C4E51D300C3610A /* HandyChip.swift in Sources */ = {isa = PBXBuildFile; fileRef = A56B3DE12C4E51D300C3610A /* HandyChip.swift */; };
A5A12A7E2C57A6D900996916 /* ChipViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5A12A7C2C57A6C200996916 /* ChipViewController.swift */; };
Expand Down Expand Up @@ -127,7 +127,7 @@
2D41E8152C5A21B50043161D /* HandyFab.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HandyFab.swift; sourceTree = "<group>"; };
6FD1A17F2D21311C001E6F2E /* TabsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabsViewController.swift; sourceTree = "<group>"; };
6FE73E932D23C52C00E06422 /* HandyTabs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HandyTabs.swift; sourceTree = "<group>"; };
6FE73E952D23C55900E06422 /* HandyTabComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HandyTabComponent.swift; sourceTree = "<group>"; };
6FE73E952D23C55900E06422 /* HandyTabCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HandyTabCell.swift; sourceTree = "<group>"; };
6FE73E972D23D6E500E06422 /* MainViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainViewController.swift; sourceTree = "<group>"; };
A56B3DE12C4E51D300C3610A /* HandyChip.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HandyChip.swift; sourceTree = "<group>"; };
A5A12A7C2C57A6C200996916 /* ChipViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChipViewController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -344,7 +344,7 @@
6FE73E922D23C51600E06422 /* HandyTabs */ = {
isa = PBXGroup;
children = (
6FE73E952D23C55900E06422 /* HandyTabComponent.swift */,
6FE73E952D23C55900E06422 /* HandyTabCell.swift */,
6FE73E932D23C52C00E06422 /* HandyTabs.swift */,
);
path = HandyTabs;
Expand Down Expand Up @@ -533,7 +533,7 @@
02BCB2302CDF417500D0C796 /* HandyListItem.swift in Sources */,
A5F6D36B2C96F32D00FB961F /* HandyDivider.swift in Sources */,
02BDB7FC2C3E99920050FB67 /* HandyFont.swift in Sources */,
6FE73E962D23C55900E06422 /* HandyTabComponent.swift in Sources */,
6FE73E962D23C55900E06422 /* HandyTabCell.swift in Sources */,
02ED764A2C5779C3001569F1 /* UIImage+.swift in Sources */,
029E48002C49FD4000D2F3B7 /* HandyTypography.swift in Sources */,
E5650D432C4D326D002790CC /* HandyCheckBox.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// HandyTabComponent.swift
// HandyTabCell.swift
// Handy
//
// Created by chongin on 12/31/24.
Expand All @@ -8,7 +8,7 @@
import UIKit

/// ``HandyTabs``의 Header를 구성하는 cell입니다.
open class HandyTabComponent: UICollectionViewCell {
open class HandyTabCell: UICollectionViewCell {
// MARK: - open & public properties

/// 글씨 크기를 결정합니다.
Expand Down Expand Up @@ -105,13 +105,13 @@ open class HandyTabComponent: UICollectionViewCell {
}
}

extension HandyTabComponent {
extension HandyTabCell {
public enum SizeType {
case small
case large
}
}

extension HandyTabComponent {
static let reuseIdentifier = "HandyTabComponent"
extension HandyTabCell {
static let reuseIdentifier = "HandyTabCell"
}
14 changes: 7 additions & 7 deletions Handy/Handy/Source/Atom/HandyTabs/HandyTabs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import UIKit

open class HandyTabs: UIViewController {
// MARK: - open & public properties
/// `HandyTabComponent`의 크기를 결정합니다.
open var sizeType: HandyTabComponent.SizeType
/// `HandyTabCell`의 크기를 결정합니다.
open var sizeType: HandyTabCell.SizeType


/// 보여질 탭의 정보를 의미합니다.
Expand Down Expand Up @@ -63,7 +63,7 @@ open class HandyTabs: UIViewController {
// MARK: - private properties

/// Tab의 정보 중 `title` 부분이 표현되는 헤더 영역입니다.
/// `FlowLayout`으로 구성되어 있습니다. cell은 ``HandyTabComponent``만 등록되어 있습니다.
/// `FlowLayout`으로 구성되어 있습니다. cell은 ``HandyTabCell``만 등록되어 있습니다.
private var tabsHeader: UICollectionView!

/// Tab의 정보 중 `ViewController` 부분이 표현되는 콘텐츠 영역입니다.
Expand All @@ -81,7 +81,7 @@ open class HandyTabs: UIViewController {
}

// MARK: - Init
public init(sizeType: HandyTabComponent.SizeType) {
public init(sizeType: HandyTabCell.SizeType) {
self.sizeType = sizeType
super.init(nibName: nil, bundle: nil)
setTabsHeader()
Expand Down Expand Up @@ -113,7 +113,7 @@ open class HandyTabs: UIViewController {
}

// register cells
tabsHeader.register(HandyTabComponent.self, forCellWithReuseIdentifier: HandyTabComponent.reuseIdentifier)
tabsHeader.register(HandyTabCell.self, forCellWithReuseIdentifier: HandyTabCell.reuseIdentifier)

// set delegates
tabsHeader.delegate = self
Expand Down Expand Up @@ -169,7 +169,7 @@ extension HandyTabs: UICollectionViewDelegate, UICollectionViewDataSource {
}

public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: HandyTabComponent.reuseIdentifier, for: indexPath) as! HandyTabComponent
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: HandyTabCell.reuseIdentifier, for: indexPath) as! HandyTabCell
cell.sizeType = sizeType
cell.title = tabs[indexPath.row].title
return cell
Expand All @@ -190,7 +190,7 @@ extension HandyTabs: UICollectionViewDelegate, UICollectionViewDataSource {
collectionView.reloadItems(at: [indexPath])
} completion: { _ in
UIView.animate(withDuration: 0.3) {
if let selectedCell = collectionView.cellForItem(at: indexPath) as? HandyTabComponent {
if let selectedCell = collectionView.cellForItem(at: indexPath) as? HandyTabCell {
selectedCell.isSelected = true
}
}
Expand Down

0 comments on commit cd6ba50

Please sign in to comment.