Skip to content

Commit

Permalink
[Feat]: PopupView Category 별 이미지 변경 기능 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeon0976 committed Feb 28, 2024
1 parent 042e6d9 commit de1f0c9
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 9 deletions.
1 change: 0 additions & 1 deletion AVIRO/Custom/SubClass/UIButton/FranchiseToggleButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// Created by 전성훈 on 2024/02/23.
//


// MARK: - Toggle button Custom Refectoring 필요
// TODO: 좀 더 외부에서 프로퍼티 값을 받을 수 있도록 수정 예정
import UIKit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Foundation

struct PlaceTopModel {
let placeState: VeganType
let category: CategoryType
let placeTitle: String
let placeCategory: String
let distance: String
Expand Down
7 changes: 3 additions & 4 deletions AVIRO/Scene/Base/AVIROTabBarController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -238,14 +238,13 @@ final class AVIROTabBarController: UIViewController, TabBarDelegate {

redDotView.backgroundColor = .red

let redDotSize: CGFloat = 9
redDotView.layer.cornerRadius = 4.5
redDotView.clipsToBounds = true

let redDotSize: CGFloat = 9
redDotView.translatesAutoresizingMaskIntoConstraints = false

guard let imageView = button.imageView else { return }

redDotView.translatesAutoresizingMaskIntoConstraints = false

imageView.addSubview(redDotView)

NSLayoutConstraint.activate([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,23 +311,61 @@ final class PlaceSummaryView: UIView {

switch placeModel.placeState {
case .All:
placeIconImage = UIImage.allBox
switch placeModel.category {
case .Bar:
placeIconImage = UIImage.allBoxBar
placeCategory.text = placeModel.placeCategory + "" + Text.all.rawValue
case .Bread:
placeIconImage = UIImage.allBoxBread
placeCategory.text = placeModel.placeCategory + "" + Text.all.rawValue
case .Coffee:
placeIconImage = UIImage.allBoxCoffee
placeCategory.text = placeModel.placeCategory + "" + Text.all.rawValue
case .Restaurant:
placeIconImage = UIImage.allBoxRestaurant
placeCategory.text = placeModel.placeCategory + "" + Text.all.rawValue
}
whenSlideTopLabel.textColor = .all
whenSlideTopLabelString = Text.all.rawValue
case .Some:
placeIconImage = UIImage.someBox
switch placeModel.category {
case .Bar:
placeIconImage = UIImage.someBoxBar
placeCategory.text = placeModel.placeCategory + "" + Text.some.rawValue
case .Bread:
placeIconImage = UIImage.someBoxBread
placeCategory.text = placeModel.placeCategory + "" + Text.some.rawValue
case .Coffee:
placeIconImage = UIImage.someBoxCoffee
placeCategory.text = placeModel.placeCategory + "" + Text.some.rawValue
case .Restaurant:
placeIconImage = UIImage.someBoxRestaurant
placeCategory.text = placeModel.placeCategory + "" + Text.some.rawValue
}
whenSlideTopLabel.textColor = .some
whenSlideTopLabelString = Text.some.rawValue
case .Request:
placeIconImage = UIImage.requestBox
switch placeModel.category {
case .Bar:
placeIconImage = UIImage.requestBoxBar
placeCategory.text = placeModel.placeCategory + "" + Text.request.rawValue
case .Bread:
placeIconImage = UIImage.requestBoxBread
placeCategory.text = placeModel.placeCategory + "" + Text.request.rawValue
case .Coffee:
placeIconImage = UIImage.requestBoxCoffee
placeCategory.text = placeModel.placeCategory + "" + Text.request.rawValue
case .Restaurant:
placeIconImage = UIImage.requestBoxRestaurant
placeCategory.text = placeModel.placeCategory + "" + Text.request.rawValue
}
whenSlideTopLabel.textColor = .request
whenSlideTopLabelString = Text.request.rawValue
}

placeIcon.image = placeIconImage

placeTitle.text = placeModel.placeTitle
placeCategory.text = placeModel.placeCategory
distanceLabel.text = placeModel.distance
reviewsLabel.text = placeModel.reviewsCount + ""
addressLabel.text = placeModel.address
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,8 @@ final class HomeViewPresenter: NSObject {

markerModelManager.updateMarkerModelWhenClicked(with: selectedMarkerModel!)
viewController?.moveToCameraWhenHasAVIRO(validMarkerModel, zoomTo: nil)

print("Test")
}

// MARK: Load Place Sumamry
Expand Down Expand Up @@ -485,6 +487,7 @@ final class HomeViewPresenter: NSObject {

let placeTopModel = PlaceTopModel(
placeState: mapPlace,
category: markerModel.categoryType,
placeTitle: place.title,
placeCategory: place.category,
distance: distanceString,
Expand Down

0 comments on commit de1f0c9

Please sign in to comment.