Skip to content

Commit

Permalink
chore: 'develop' branch 머지
Browse files Browse the repository at this point in the history
  • Loading branch information
iceHood committed Nov 14, 2024
2 parents 3a87fd6 + baa0e9a commit e519512
Show file tree
Hide file tree
Showing 33 changed files with 373 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
build:
runs-on: macos-latest
runs-on: macos-15

steps:
- uses: actions/checkout@v4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@ final class SceneDelegate: UIResponder, UIWindowSceneDelegate {
guard let windowScene = (scene as? UIWindowScene) else { return }
window = UIWindow(windowScene: windowScene)

let initialViewController = UserDefaults.standard.object(forKey: Constant.houseNameUserDefaultKey) == nil
? RegisterViewController()
: HomeViewController()
let initialViewController: UIViewController
if let houseName = UserDefaults.standard.object(forKey: Constant.houseNameUserDefaultKey) as? String {
let viewModel = HomeViewModel(houseName: houseName)
initialViewController = HomeViewController(viewModel: viewModel)
} else {
initialViewController = RegisterViewController()
}

let navigationController = UINavigationController(rootViewController: initialViewController)
navigationController.navigationBar.isHidden = true
window?.rootViewController = navigationController
window?.makeKeyAndVisible()
}
Expand Down
12 changes: 6 additions & 6 deletions MemorialHouse/MHDomain/MHDomain/Entity/BookCover.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ public struct BookCover {
public let bookIdentifer = UUID()
public let title: String
public let imageURL: String
public let bookType: BookColor
public let bookColor: BookColor
public let category: String
public let favorite: Bool
public let isLike: Bool

public init(
title: String,
imageURL: String,
bookType: BookColor,
bookColor: BookColor,
category: String,
favorite: Bool = false
isLike: Bool = false
) {
self.title = title
self.imageURL = imageURL
self.bookType = bookType
self.bookColor = bookColor
self.category = category
self.favorite = favorite
self.isLike = isLike
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Subject.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "image 19.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "image [email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "image [email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Vector 17.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Vector [email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Vector [email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Favorite_duotone.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Favorite.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import UIKit
import MHFoundation
import MHDomain

final class MHBook: UIView {
final class MHBookCover: UIView {
// MARK: - Property
private let bookCoverImageView = UIImageView()
private let titleLabel: UILabel = {
Expand All @@ -22,7 +22,7 @@ final class MHBook: UIView {

return imageView
}()
private let publisherLabel = UILabel(style: .body2)
private let houseLabel = UILabel(style: .body2)

// MARK: - Initializer
init() {
Expand All @@ -39,24 +39,30 @@ final class MHBook: UIView {
configureConstraints()
}

func resetProperties() {
bookCoverImageView.image = nil
titleLabel.text = nil
targetImageView.image = nil
}

// MARK: - Configuration
func configure(
title: String,
bookCoverImage: UIImage,
targetImage: UIImage,
publisher: String
houseName: String
) {
titleLabel.text = title
bookCoverImageView.image = bookCoverImage
targetImageView.image = targetImage
publisherLabel.text = publisher
houseLabel.text = houseName
}

private func configureAddSubView() {
addSubview(bookCoverImageView)
addSubview(titleLabel)
addSubview(targetImageView)
addSubview(publisherLabel)
addSubview(houseLabel)
}

private func configureConstraints() {
Expand All @@ -66,8 +72,8 @@ final class MHBook: UIView {
titleLabel.setTrailing(anchor: trailingAnchor, constant: 12)
targetImageView.setTop(anchor: titleLabel.bottomAnchor, constant: 14)
targetImageView.setCenterX(view: self, constant: 8)
targetImageView.setWidthAndHeight(width: 100, height: 100)
publisherLabel.setBottom(anchor: bottomAnchor, constant: 12)
publisherLabel.setTrailing(anchor: trailingAnchor, constant: 12)
targetImageView.setWidthAndHeight(width: 100, height: 110)
houseLabel.setBottom(anchor: bottomAnchor, constant: 12)
houseLabel.setTrailing(anchor: trailingAnchor, constant: 12)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import UIKit

extension UIImage {
static func resizedImage(image: UIImage, size: CGSize) -> UIImage {
let renderer = UIGraphicsImageRenderer(size: size)

return renderer.image { _ in
image.draw(in: CGRect(origin: .zero, size: size))
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import UIKit

final class BookCollectionViewCell: UICollectionViewCell {
// MARK: - Properties
private let bookCoverView = MHBookCover()
private let likeButton = UIButton(type: .custom)
private let dropDownButton = UIButton(type: .custom)

// MARK: - Initializer
override init(frame: CGRect) {
super.init(frame: frame)

configureAddSubView()
configureAction()
configureConstraints()
}

required init?(coder: NSCoder) {
super.init(coder: coder)

configureAddSubView()
configureAction()
configureConstraints()
}

override func prepareForReuse() {
super.prepareForReuse()

bookCoverView.resetProperties()
likeButton.imageView?.image = nil
}

// MARK: - Configuration
func configure(
title: String,
bookCoverImage: UIImage,
targetImage: UIImage,
isLike: Bool,
// category: String, // TODO: 카테고리 처리 생각해보기

Check warning on line 39 in MemorialHouse/MHPresentation/MHPresentation/Source/Home/BookCollectionViewCell.swift

View workflow job for this annotation

GitHub Actions / SwiftLint

Todo Violation: TODOs should be resolved (카테고리 처리 생각해보기) (todo)
houseName: String
) {
bookCoverView.configure(
title: title,
bookCoverImage: bookCoverImage,
targetImage: targetImage,
houseName: houseName
)

let likeImage = UIImage.resizedImage(
image: isLike ? .likeFill : .likeEmpty,
size: CGSize(width: 28, height: 28)
)
likeButton.setImage(likeImage, for: .normal)
dropDownButton.setImage(.dotHorizontal, for: .normal)
}

private func configureAddSubView() {
contentView.addSubview(bookCoverView)
contentView.addSubview(likeButton)
contentView.addSubview(dropDownButton)
}

private func configureAction() {
likeButton.addAction(UIAction { _ in
// TODO: 좋아요 버튼 로직

Check warning on line 65 in MemorialHouse/MHPresentation/MHPresentation/Source/Home/BookCollectionViewCell.swift

View workflow job for this annotation

GitHub Actions / SwiftLint

Todo Violation: TODOs should be resolved (좋아요 버튼 로직) (todo)
}, for: .touchUpInside)

dropDownButton.addAction(UIAction { _ in
// TODO: UI Menu 띄우기

Check warning on line 69 in MemorialHouse/MHPresentation/MHPresentation/Source/Home/BookCollectionViewCell.swift

View workflow job for this annotation

GitHub Actions / SwiftLint

Todo Violation: TODOs should be resolved (UI Menu 띄우기) (todo)
}, for: .touchUpInside)
}

private func configureConstraints() {
bookCoverView.fillSuperview()
likeButton.setAnchor(
top: bookCoverView.bottomAnchor,
trailing: dropDownButton.leadingAnchor, constantTrailing: 10
)
dropDownButton.setAnchor(
trailing: contentView.trailingAnchor, constantTrailing: 4,
width: 24, height: 16
)
dropDownButton.setCenterY(view: likeButton)
}
}
Loading

0 comments on commit e519512

Please sign in to comment.