Skip to content

Commit

Permalink
Merge pull request #214 from Team-Smeme/feat/#210-customBanner
Browse files Browse the repository at this point in the history
[Feat] #210 Custom banner
  • Loading branch information
cchanmi authored Aug 6, 2024
2 parents cf814ad + f2ed44a commit 50d05d2
Show file tree
Hide file tree
Showing 7 changed files with 292 additions and 57 deletions.
70 changes: 45 additions & 25 deletions Smeem-iOS/Smeem-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,15 @@
3728B8D32A2CFED300EF4CF8 /* ForeignDiaryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3728B8D22A2CFED300EF4CF8 /* ForeignDiaryViewController.swift */; };
3728B8D52A2CFF2C00EF4CF8 /* StepOneKoreanDiaryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3728B8D42A2CFF2C00EF4CF8 /* StepOneKoreanDiaryViewController.swift */; };
3728B8D72A2CFF3A00EF4CF8 /* StepTwoKoreanDiaryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3728B8D62A2CFF3A00EF4CF8 /* StepTwoKoreanDiaryViewController.swift */; };
373A7F552C3D78CC00CF554C /* CustomBannerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 373A7F542C3D78CC00CF554C /* CustomBannerView.swift */; };
373E38592A2F889500DF96F0 /* DiaryDetailRandomSubjectView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 373E38582A2F889500DF96F0 /* DiaryDetailRandomSubjectView.swift */; };
374F828C2AC327A200C128B9 /* SmeemTextViewHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 374F828B2AC327A200C128B9 /* SmeemTextViewHandler.swift */; };
374F828E2AC5DFFE00C128B9 /* DiaryBottomView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 374F828D2AC5DFFE00C128B9 /* DiaryBottomView.swift */; };
374FAF812A2CACCF00237A1A /* DiaryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 374FAF802A2CACCF00237A1A /* DiaryViewController.swift */; };
375B62872C590D0D00DA8E30 /* FirebaseAnalytics in Frameworks */ = {isa = PBXBuildFile; productRef = 375B62862C590D0D00DA8E30 /* FirebaseAnalytics */; };
375B62892C590D0D00DA8E30 /* FirebaseCrashlytics in Frameworks */ = {isa = PBXBuildFile; productRef = 375B62882C590D0D00DA8E30 /* FirebaseCrashlytics */; };
375B628B2C590D0D00DA8E30 /* FirebaseMessaging in Frameworks */ = {isa = PBXBuildFile; productRef = 375B628A2C590D0D00DA8E30 /* FirebaseMessaging */; };
375B628D2C590D0D00DA8E30 /* FirebaseRemoteConfig in Frameworks */ = {isa = PBXBuildFile; productRef = 375B628C2C590D0D00DA8E30 /* FirebaseRemoteConfig */; };
3761116C2A278D0E0095EC5A /* String+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3761116B2A278D0E0095EC5A /* String+.swift */; };
3785072F2BD1480C004CC922 /* SharedDiaryDataService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37499E3C2BD0C3A100BA6FAF /* SharedDiaryDataService.swift */; };
378B20EE2BA0A01600604935 /* ForeignDiaryViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 378B20ED2BA0A01600604935 /* ForeignDiaryViewModel.swift */; };
Expand Down Expand Up @@ -138,8 +143,6 @@
4AA942C22A2767D000A552A0 /* FSCalendar in Frameworks */ = {isa = PBXBuildFile; productRef = 4AA942C12A2767D000A552A0 /* FSCalendar */; };
4AA942C52A2767D900A552A0 /* SnapKit in Frameworks */ = {isa = PBXBuildFile; productRef = 4AA942C42A2767D900A552A0 /* SnapKit */; };
4AA942CD2A276A9F00A552A0 /* Moya in Frameworks */ = {isa = PBXBuildFile; productRef = 4AA942CC2A276A9F00A552A0 /* Moya */; };
4AA942D02A276AFF00A552A0 /* FirebaseAnalyticsWithoutAdIdSupport in Frameworks */ = {isa = PBXBuildFile; productRef = 4AA942CF2A276AFF00A552A0 /* FirebaseAnalyticsWithoutAdIdSupport */; };
4AA942D22A276AFF00A552A0 /* FirebaseMessaging in Frameworks */ = {isa = PBXBuildFile; productRef = 4AA942D12A276AFF00A552A0 /* FirebaseMessaging */; };
4AA942D52A276C7900A552A0 /* KakaoSDKAuth in Frameworks */ = {isa = PBXBuildFile; productRef = 4AA942D42A276C7900A552A0 /* KakaoSDKAuth */; };
4AA942D72A276C7900A552A0 /* KakaoSDKCommon in Frameworks */ = {isa = PBXBuildFile; productRef = 4AA942D62A276C7900A552A0 /* KakaoSDKCommon */; };
4AA942D92A276C7900A552A0 /* KakaoSDKUser in Frameworks */ = {isa = PBXBuildFile; productRef = 4AA942D82A276C7900A552A0 /* KakaoSDKUser */; };
Expand Down Expand Up @@ -263,6 +266,7 @@
3728B8D22A2CFED300EF4CF8 /* ForeignDiaryViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ForeignDiaryViewController.swift; sourceTree = "<group>"; };
3728B8D42A2CFF2C00EF4CF8 /* StepOneKoreanDiaryViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StepOneKoreanDiaryViewController.swift; sourceTree = "<group>"; };
3728B8D62A2CFF3A00EF4CF8 /* StepTwoKoreanDiaryViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StepTwoKoreanDiaryViewController.swift; sourceTree = "<group>"; };
373A7F542C3D78CC00CF554C /* CustomBannerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomBannerView.swift; sourceTree = "<group>"; };
373E38582A2F889500DF96F0 /* DiaryDetailRandomSubjectView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DiaryDetailRandomSubjectView.swift; sourceTree = "<group>"; };
37499E3C2BD0C3A100BA6FAF /* SharedDiaryDataService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SharedDiaryDataService.swift; sourceTree = "<group>"; };
374F828B2AC327A200C128B9 /* SmeemTextViewHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SmeemTextViewHandler.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -485,16 +489,18 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
4AA942D22A276AFF00A552A0 /* FirebaseMessaging in Frameworks */,
4AA942D72A276C7900A552A0 /* KakaoSDKCommon in Frameworks */,
4AA942C22A2767D000A552A0 /* FSCalendar in Frameworks */,
A301B0A22A30720F006BE0BA /* Kingfisher in Frameworks */,
375B628D2C590D0D00DA8E30 /* FirebaseRemoteConfig in Frameworks */,
4AA942CD2A276A9F00A552A0 /* Moya in Frameworks */,
4AA942D92A276C7900A552A0 /* KakaoSDKUser in Frameworks */,
4AA942D02A276AFF00A552A0 /* FirebaseAnalyticsWithoutAdIdSupport in Frameworks */,
4AA942C52A2767D900A552A0 /* SnapKit in Frameworks */,
4A08480C2B554513008327C7 /* AmplitudeSwift in Frameworks */,
375B62892C590D0D00DA8E30 /* FirebaseCrashlytics in Frameworks */,
4AA942D52A276C7900A552A0 /* KakaoSDKAuth in Frameworks */,
375B628B2C590D0D00DA8E30 /* FirebaseMessaging in Frameworks */,
375B62872C590D0D00DA8E30 /* FirebaseAnalytics in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -645,6 +651,7 @@
4A1EE9552A4DFB86007BFEF3 /* SmeemComponent */,
4A1EE9532A4DFB42007BFEF3 /* Diary */,
4A3F2E952A0ABB9C00F6AC60 /* Alarm */,
373A7F542C3D78CC00CF554C /* CustomBannerView.swift */,
);
path = UIComponents;
sourceTree = "<group>";
Expand Down Expand Up @@ -1810,13 +1817,15 @@
4AA942C12A2767D000A552A0 /* FSCalendar */,
4AA942C42A2767D900A552A0 /* SnapKit */,
4AA942CC2A276A9F00A552A0 /* Moya */,
4AA942CF2A276AFF00A552A0 /* FirebaseAnalyticsWithoutAdIdSupport */,
4AA942D12A276AFF00A552A0 /* FirebaseMessaging */,
4AA942D42A276C7900A552A0 /* KakaoSDKAuth */,
4AA942D62A276C7900A552A0 /* KakaoSDKCommon */,
4AA942D82A276C7900A552A0 /* KakaoSDKUser */,
A301B0A12A30720F006BE0BA /* Kingfisher */,
4A08480B2B554513008327C7 /* AmplitudeSwift */,
375B62862C590D0D00DA8E30 /* FirebaseAnalytics */,
375B62882C590D0D00DA8E30 /* FirebaseCrashlytics */,
375B628A2C590D0D00DA8E30 /* FirebaseMessaging */,
375B628C2C590D0D00DA8E30 /* FirebaseRemoteConfig */,
);
productName = "Smeem-iOS";
productReference = 4A8FFA4C29C9E1FD00FB76C0 /* Smeem-iOS.app */;
Expand Down Expand Up @@ -1857,10 +1866,10 @@
4AA942C02A2767D000A552A0 /* XCRemoteSwiftPackageReference "FSCalendar" */,
4AA942C32A2767D900A552A0 /* XCRemoteSwiftPackageReference "SnapKit" */,
4AA942CB2A276A9F00A552A0 /* XCRemoteSwiftPackageReference "Moya" */,
4AA942CE2A276AFF00A552A0 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */,
4AA942D32A276C7900A552A0 /* XCRemoteSwiftPackageReference "kakao-ios-sdk" */,
A301B0A02A30720F006BE0BA /* XCRemoteSwiftPackageReference "Kingfisher" */,
4A08480A2B554513008327C7 /* XCRemoteSwiftPackageReference "Amplitude-Swift" */,
375B62852C590D0D00DA8E30 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */,
);
productRefGroup = 4A8FFA4D29C9E1FD00FB76C0 /* Products */;
projectDirPath = "";
Expand Down Expand Up @@ -2053,6 +2062,7 @@
4ABCBCDC2BE2484B003138A8 /* MyPlanAppData.swift in Sources */,
3728B8D72A2CFF3A00EF4CF8 /* StepTwoKoreanDiaryViewController.swift in Sources */,
4A07F8A82B7B3E5E004185F2 /* SignupBottomSheetViewController.swift in Sources */,
373A7F552C3D78CC00CF554C /* CustomBannerView.swift in Sources */,
4ABCBCC52BDD3375003138A8 /* MySummaryEndPoint.swift in Sources */,
4A454A832B6666FF0079D48D /* TrainingGoalViewModel.swift in Sources */,
37DCA66E2A484D3100FF8F90 /* PostDiaryResponse.swift in Sources */,
Expand Down Expand Up @@ -2429,6 +2439,14 @@
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
375B62852C590D0D00DA8E30 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/firebase/firebase-ios-sdk";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 10.29.0;
};
};
4A08480A2B554513008327C7 /* XCRemoteSwiftPackageReference "Amplitude-Swift" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/amplitude/Amplitude-Swift";
Expand Down Expand Up @@ -2461,14 +2479,6 @@
kind = branch;
};
};
4AA942CE2A276AFF00A552A0 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/firebase/firebase-ios-sdk";
requirement = {
branch = master;
kind = branch;
};
};
4AA942D32A276C7900A552A0 /* XCRemoteSwiftPackageReference "kakao-ios-sdk" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/kakao/kakao-ios-sdk";
Expand All @@ -2488,6 +2498,26 @@
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
375B62862C590D0D00DA8E30 /* FirebaseAnalytics */ = {
isa = XCSwiftPackageProductDependency;
package = 375B62852C590D0D00DA8E30 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
productName = FirebaseAnalytics;
};
375B62882C590D0D00DA8E30 /* FirebaseCrashlytics */ = {
isa = XCSwiftPackageProductDependency;
package = 375B62852C590D0D00DA8E30 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
productName = FirebaseCrashlytics;
};
375B628A2C590D0D00DA8E30 /* FirebaseMessaging */ = {
isa = XCSwiftPackageProductDependency;
package = 375B62852C590D0D00DA8E30 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
productName = FirebaseMessaging;
};
375B628C2C590D0D00DA8E30 /* FirebaseRemoteConfig */ = {
isa = XCSwiftPackageProductDependency;
package = 375B62852C590D0D00DA8E30 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
productName = FirebaseRemoteConfig;
};
4A08480B2B554513008327C7 /* AmplitudeSwift */ = {
isa = XCSwiftPackageProductDependency;
package = 4A08480A2B554513008327C7 /* XCRemoteSwiftPackageReference "Amplitude-Swift" */;
Expand All @@ -2508,16 +2538,6 @@
package = 4AA942CB2A276A9F00A552A0 /* XCRemoteSwiftPackageReference "Moya" */;
productName = Moya;
};
4AA942CF2A276AFF00A552A0 /* FirebaseAnalyticsWithoutAdIdSupport */ = {
isa = XCSwiftPackageProductDependency;
package = 4AA942CE2A276AFF00A552A0 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
productName = FirebaseAnalyticsWithoutAdIdSupport;
};
4AA942D12A276AFF00A552A0 /* FirebaseMessaging */ = {
isa = XCSwiftPackageProductDependency;
package = 4AA942CE2A276AFF00A552A0 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
productName = FirebaseMessaging;
};
4AA942D42A276C7900A552A0 /* KakaoSDKAuth */ = {
isa = XCSwiftPackageProductDependency;
package = 4AA942D32A276C7900A552A0 /* XCRemoteSwiftPackageReference "kakao-ios-sdk" */;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/abseil-cpp-binary.git",
"state" : {
"revision" : "df308b8b46607675f2b9ec8e569109008f9155ce",
"version" : "1.2022062300.1"
"revision" : "194a6706acbd25e4ef639bcaddea16e8758a3e27",
"version" : "1.2024011602.0"
}
},
{
Expand Down Expand Up @@ -36,13 +36,22 @@
"version" : "1.0.3"
}
},
{
"identity" : "app-check",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/app-check.git",
"state" : {
"revision" : "3b62f154d00019ae29a71e9738800bb6f18b236d",
"version" : "10.19.2"
}
},
{
"identity" : "firebase-ios-sdk",
"kind" : "remoteSourceControl",
"location" : "https://github.com/firebase/firebase-ios-sdk",
"state" : {
"branch" : "master",
"revision" : "2937104f9b6adbc98ef1603b258c8251f2e09304"
"revision" : "eca84fd638116dd6adb633b5a3f31cc7befcbb7d",
"version" : "10.29.0"
}
},
{
Expand All @@ -59,8 +68,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleAppMeasurement.git",
"state" : {
"revision" : "69f5b8425dd473d2f2475bba7f88f82cd9da0e36",
"version" : "10.10.0"
"revision" : "fe727587518729046fc1465625b9afd80b5ab361",
"version" : "10.28.0"
}
},
{
Expand All @@ -86,8 +95,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/grpc-binary.git",
"state" : {
"revision" : "f1b366129d1125be7db83247e003fc333104b569",
"version" : "1.50.2"
"revision" : "e9fad491d0673bdda7063a0341fb6b47a30c5359",
"version" : "1.62.2"
}
},
{
Expand All @@ -99,6 +108,15 @@
"version" : "3.5.0"
}
},
{
"identity" : "interop-ios-for-google-sdks",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/interop-ios-for-google-sdks.git",
"state" : {
"revision" : "2d12673670417654f08f5f90fdd62926dc3a2648",
"version" : "100.0.0"
}
},
{
"identity" : "kakao-ios-sdk",
"kind" : "remoteSourceControl",
Expand Down
12 changes: 12 additions & 0 deletions Smeem-iOS/Smeem-iOS/Global/Constants/UserDefaultsManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,16 @@ struct UserDefaultsManager {
get { return UserDefaults.standard.bool(forKey: "tipView")}
set { UserDefaults.standard.set(newValue, forKey: "tipView")}
}

// MARK: - RemoteConfig

static var currentBannerVersion: Int {
get { return UserDefaults.standard.integer(forKey: "bannerVersion")}
set { UserDefaults.standard.set(newValue, forKey: "bannerVersion")}
}

static var hasBannerClosed: Bool {
get { return UserDefaults.standard.bool(forKey: "hasBannerClosed")}
set { UserDefaults.standard.set(newValue, forKey: "hasBannerClosed")}
}
}
93 changes: 93 additions & 0 deletions Smeem-iOS/Smeem-iOS/Global/UIComponents/CustomBannerView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
//
// CustomBannerView.swift
// Smeem-iOS
//
// Created by Joon Baek on 2024/07/09.
//

import UIKit
import Combine

import SnapKit

final class CustomBannerView: BaseView {

private (set) var closeButtonTapped = PassthroughSubject<Void, Never>()
private var cancelBag = Set<AnyCancellable>()

private let titleLabel: UILabel = {
let label = UILabel()
label.font = .s1
label.textColor = .smeemBlack
// label.text = "헤더레이블"
return label
}()

private let bodyLabel: UILabel = {
let label = UILabel()
label.font = .c3
label.textColor = .smeemBlack
// label.text = "바디레이블"
return label
}()

private lazy var closeButton: UIButton = {
let button = UIButton()
button.setImage(Constant.Image.icnCancelGrey, for: .normal)
button.tintColor = .gray200
return button
}()

override init(frame: CGRect) {
super.init(frame: frame)

setUI()
setLayout()
subscribeButtonEvent()
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

override func setUI() {
backgroundColor = .gray100
layer.cornerRadius = 10
}
}

extension CustomBannerView {
private func setLayout() {
addSubviews(titleLabel, bodyLabel, closeButton)

titleLabel.snp.makeConstraints { make in
make.top.equalToSuperview().offset(22)
make.leading.equalToSuperview().offset(18)
}

bodyLabel.snp.makeConstraints { make in
make.top.equalTo(titleLabel.snp.bottom).offset(4)
make.leading.equalTo(titleLabel)
}

closeButton.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.trailing.equalToSuperview()
make.size.equalTo(40)
}
}

private func subscribeButtonEvent() {
closeButton.tapPublisher.sink { [weak self] in
self?.closeButtonTapped.send()
}
.store(in: &cancelBag)
}

func setLabelText(with title: String, body: String) {
DispatchQueue.main.async {[weak self] in
self?.titleLabel.text = title
self?.bodyLabel.text = body
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ extension SeparationLine {
}
}

// MARK: - Extension:
// MARK: - Extension

extension SeparationLine {
static func createThickLine() -> UIView {
Expand Down
Loading

0 comments on commit 50d05d2

Please sign in to comment.