Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat] #277 - BubbleView Builder 구현 #278

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions GEON-PPANG-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
095FB88A2AB36FCA00C69BD1 /* AnalyticManagerEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 095FB8892AB36FCA00C69BD1 /* AnalyticManagerEvent.swift */; };
095FB88E2AB3703500C69BD1 /* AnalyticManagerEventProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 095FB88D2AB3703500C69BD1 /* AnalyticManagerEventProtocol.swift */; };
0961C3642A501EBF0031A822 /* Strings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0961C3632A501EBF0031A822 /* Strings.swift */; };
096446372C2C064E00D5E85A /* BubbleBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 096446362C2C064E00D5E85A /* BubbleBuilder.swift */; };
096446392C2C065400D5E85A /* BubbleDirector.swift in Sources */ = {isa = PBXBuildFile; fileRef = 096446382C2C065400D5E85A /* BubbleDirector.swift */; };
097682DA2A5C829D0008F4FB /* GradientImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 097682D92A5C829D0008F4FB /* GradientImageView.swift */; };
097682DC2A5C83910008F4FB /* CGFloat+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 097682DB2A5C83910008F4FB /* CGFloat+.swift */; };
097682E32A5C95750008F4FB /* BakeryFilterCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 097682E22A5C95750008F4FB /* BakeryFilterCollectionViewCell.swift */; };
Expand Down Expand Up @@ -312,6 +314,8 @@
095FB8892AB36FCA00C69BD1 /* AnalyticManagerEvent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalyticManagerEvent.swift; sourceTree = "<group>"; };
095FB88D2AB3703500C69BD1 /* AnalyticManagerEventProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalyticManagerEventProtocol.swift; sourceTree = "<group>"; };
0961C3632A501EBF0031A822 /* Strings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Strings.swift; sourceTree = "<group>"; };
096446362C2C064E00D5E85A /* BubbleBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BubbleBuilder.swift; sourceTree = "<group>"; };
096446382C2C065400D5E85A /* BubbleDirector.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BubbleDirector.swift; sourceTree = "<group>"; };
097682D92A5C829D0008F4FB /* GradientImageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GradientImageView.swift; sourceTree = "<group>"; };
097682DB2A5C83910008F4FB /* CGFloat+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CGFloat+.swift"; sourceTree = "<group>"; };
097682E22A5C95750008F4FB /* BakeryFilterCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BakeryFilterCollectionViewCell.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -885,6 +889,15 @@
path = Storyboard;
sourceTree = "<group>";
};
096446352C2C063800D5E85A /* Bubble */ = {
isa = PBXGroup;
children = (
096446362C2C064E00D5E85A /* BubbleBuilder.swift */,
096446382C2C065400D5E85A /* BubbleDirector.swift */,
);
path = Bubble;
sourceTree = "<group>";
};
097682D82A5C828E0008F4FB /* ImageView */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -1158,6 +1171,7 @@
3E2A0B822BE72373004F8D6B /* View */ = {
isa = PBXGroup;
children = (
096446352C2C063800D5E85A /* Bubble */,
0989547B2C1C07B30000D650 /* TextField */,
3E2A0B832BE74E49004F8D6B /* Chip */,
);
Expand Down Expand Up @@ -2030,7 +2044,9 @@
3EA69B5A2B557A52008AE23B /* AuthService.swift in Sources */,
3E23CCF52A8BD9950091957D /* UIView+.swift in Sources */,
3EA69B402B5579A1008AE23B /* ValidationAPI.swift in Sources */,
096446392C2C065400D5E85A /* BubbleDirector.swift in Sources */,
3EA69B632B557A76008AE23B /* BookmarksService.swift in Sources */,
096446372C2C064E00D5E85A /* BubbleBuilder.swift in Sources */,
3E06F8DB2A9E5759001302F4 /* AlertView.swift in Sources */,
3E36D7D62A8E6AF000B2C1CC /* FilterViewController.swift in Sources */,
3EA69BC72B59836B008AE23B /* KakaoService.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/Alamofire/Alamofire.git",
"state" : {
"revision" : "3dc6a42c7727c49bf26508e29b0a0b35f9c7e1ad",
"version" : "5.8.1"
"revision" : "f455c2975872ccd2d9c81594c658af65716e9b9a",
"version" : "5.9.1"
}
},
{
Expand All @@ -15,7 +15,7 @@
"location" : "https://github.com/amplitude/Amplitude-iOS",
"state" : {
"branch" : "main",
"revision" : "82fc62448292c13fa0a6b0b11c4524df83fd3f3b"
"revision" : "bfdec453a31fd35942a619ef472fcf2f09e2313a"
}
},
{
Expand All @@ -32,17 +32,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/kakao/kakao-ios-sdk",
"state" : {
"revision" : "ae3c60cbd4e3b348775f8c766e5b908fa1e66c5a",
"version" : "2.20.0"
"revision" : "e9e649d3ba823c3673867d3d09010fc77005a940",
"version" : "2.22.3"
}
},
{
"identity" : "kingfisher",
"kind" : "remoteSourceControl",
"location" : "https://github.com/onevcat/Kingfisher.git",
"state" : {
"revision" : "5b92f029fab2cce44386d28588098b5be0824ef5",
"version" : "7.11.0"
"revision" : "2ef543ee21d63734e1c004ad6c870255e8716c50",
"version" : "7.12.0"
}
},
{
Expand All @@ -68,26 +68,26 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/ReactiveX/RxSwift.git",
"state" : {
"revision" : "9dcaa4b333db437b0fbfaf453fad29069044a8b4",
"version" : "6.6.0"
"revision" : "b06a8c8596e4c3e8e7788e08e720e3248563ce6a",
"version" : "6.7.1"
}
},
{
"identity" : "sentry-cocoa",
"kind" : "remoteSourceControl",
"location" : "https://github.com/getsentry/sentry-cocoa.git",
"state" : {
"revision" : "b847a202a517a90763e8fd0656d8028aeee7b78d",
"version" : "8.20.0"
"revision" : "8fd4e804f2e72e0b9c1b189ce4e8349c4d10b6a2",
"version" : "8.30.0"
}
},
{
"identity" : "snapkit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/SnapKit/SnapKit",
"state" : {
"revision" : "e74fe2a978d1216c3602b129447c7301573cc2d8",
"version" : "5.7.0"
"revision" : "2842e6e84e82eb9a8dac0100ca90d9444b0307f4",
"version" : "5.7.1"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
//
// BubbleBuilder.swift
// GEON-PPANG-iOS
//
// Created by JEONGEUN KIM on 6/26/24.
//

import UIKit
import SnapKit

final class BubbleBuilder: Builder {

private let view: UIView
private let imageView: UIImageView
private let button: UIButton
private let label: UILabel

init() {
self.view = UIView()
self.imageView = UIImageView()
self.button = UIButton()
self.label = UILabel()

setLayout()
setUI()
}

private func setLayout() {

self.view.snp.makeConstraints {
$0.size.equalTo(CGSize(width: 209, height: 36))
}

self.view.addSubview(imageView)
imageView.snp.makeConstraints {
$0.edges.equalTo(view.snp.edges).inset(0)
}

self.view.addSubview(label)
label.snp.makeConstraints {
$0.leading.equalTo(imageView.snp.leading).inset(10)
$0.centerY.equalTo(imageView.snp.centerY).offset(3)
}

self.view.addSubview(button)
button.snp.makeConstraints {
$0.leading.equalTo(label.snp.trailing).offset(4)
$0.centerY.equalTo(label.snp.centerY)
$0.size.equalTo(16)
}
}

private func setUI() {
label.text = I18N.Home.bubbleTitle
label.font = .captionM2
label.textColor = .gbbGray400

let action = UIAction { _ in self.view.removeFromSuperview() }
button.addAction(action, for: .touchUpInside)
button.setImage(.icDeleteKeyword, for: .normal)
}

func build() -> UIView {
return self.view
}
}

extension BubbleBuilder {

func setImage(to image: UIImage) -> BubbleBuilder {
imageView.image = image
return self
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// BubbleDirector.swift
// GEON-PPANG-iOS
//
// Created by JEONGEUN KIM on 6/26/24.
//

import UIKit

public final class BubbleDirector {

static func buildBubbleToRight() -> UIView {
BubbleBuilder()
.setImage(to: .imgRightBubble)
.build()
}

static func buildBubbleToLeft() -> UIView {
BubbleBuilder()
.setImage(to: .imgLeftBubble)
.build()
}
}
Loading