From bedc514f219d541d21f4d19d4d3191855fd7ff69 Mon Sep 17 00:00:00 2001 From: LeeMyeongJin Date: Fri, 6 Oct 2023 22:15:19 +0900 Subject: [PATCH 01/10] =?UTF-8?q?[Feat]=20#192=20-=20DropDown=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 라이브러리 다운 --- Runnect-iOS/Podfile | 1 + Runnect-iOS/Podfile.lock | 6 +++- .../Runnect-iOS.xcodeproj/project.pbxproj | 4 +++ .../Global/UIComponents/RNMenuVC.swift | 29 +++++++++++++++++++ 4 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 Runnect-iOS/Runnect-iOS/Global/UIComponents/RNMenuVC.swift diff --git a/Runnect-iOS/Podfile b/Runnect-iOS/Podfile index c9ac53f9..0c456718 100644 --- a/Runnect-iOS/Podfile +++ b/Runnect-iOS/Podfile @@ -16,6 +16,7 @@ target 'Runnect-iOS' do pod 'KakaoSDKShare' pod 'KakaoSDKTemplate' pod 'FirebaseDynamicLinks' + pod 'DropDown' # Pods for Runnect-iOS diff --git a/Runnect-iOS/Podfile.lock b/Runnect-iOS/Podfile.lock index 5b4d89c1..eb89b5a0 100644 --- a/Runnect-iOS/Podfile.lock +++ b/Runnect-iOS/Podfile.lock @@ -1,5 +1,6 @@ PODS: - Alamofire (5.7.1) + - DropDown (2.3.13) - FirebaseCore (10.14.0): - FirebaseCoreInternal (~> 10.0) - GoogleUtilities/Environment (~> 7.8) @@ -42,6 +43,7 @@ PODS: - Then (3.0.0) DEPENDENCIES: + - DropDown - FirebaseDynamicLinks - KakaoSDKAuth - KakaoSDKCommon @@ -57,6 +59,7 @@ DEPENDENCIES: SPEC REPOS: trunk: - Alamofire + - DropDown - FirebaseCore - FirebaseCoreInternal - FirebaseDynamicLinks @@ -76,6 +79,7 @@ SPEC REPOS: SPEC CHECKSUMS: Alamofire: 0123a34370cb170936ae79a8df46cc62b2edeb88 + DropDown: 8a2116376c1981888557f72ec2ffc9a5e0e456ec FirebaseCore: 6fc17ac9f03509d51c131298aacb3ee5698b4f02 FirebaseCoreInternal: d558159ee6cc4b823c2296ecc193de9f6d9a5bb3 FirebaseDynamicLinks: 0eaabff2d0e5d0e576c0227227b00771aa2f3aaf @@ -93,6 +97,6 @@ SPEC CHECKSUMS: SnapKit: e01d52ebb8ddbc333eefe2132acf85c8227d9c25 Then: 844265ae87834bbe1147d91d5d41a404da2ec27d -PODFILE CHECKSUM: 43e89e9e217761b44c0c7e93fb4abfab29a82ece +PODFILE CHECKSUM: 8c75b9b0a2cf370949980b5f04bcc016bcd48163 COCOAPODS: 1.12.1 diff --git a/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj b/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj index 47b9d4dc..3026502a 100644 --- a/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj +++ b/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj @@ -9,6 +9,7 @@ /* Begin PBXBuildFile section */ 0AEBD608F3973389E8E1C6D6 /* Pods_Runnect_iOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 015778D02D5CDE0838284CD7 /* Pods_Runnect_iOS.framework */; }; 712F661D2A7B7BAB00D9539B /* Config.swift in Sources */ = {isa = PBXBuildFile; fileRef = 712F661C2A7B7BAB00D9539B /* Config.swift */; }; + 71CC64BD2ACFD9A100BC9235 /* RNMenuVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 71CC64BC2ACFD9A100BC9235 /* RNMenuVC.swift */; }; 71DBF23E2ABB255A0013415B /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 71DBF23D2ABB255A0013415B /* GoogleService-Info.plist */; }; A3305A97296EF58C000B1A10 /* GoalRewardInfoDto.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3305A96296EF58C000B1A10 /* GoalRewardInfoDto.swift */; }; A3BC2F2B2962C3D500198261 /* GoalRewardInfoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3BC2F2A2962C3D500198261 /* GoalRewardInfoVC.swift */; }; @@ -166,6 +167,7 @@ 3C3033C911343B5C57EB68E7 /* Pods-Runnect-iOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runnect-iOS.debug.xcconfig"; path = "Target Support Files/Pods-Runnect-iOS/Pods-Runnect-iOS.debug.xcconfig"; sourceTree = ""; }; 7110A6032AA337DD009A7E99 /* Runnect-iOSDebug.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "Runnect-iOSDebug.entitlements"; sourceTree = ""; }; 712F661C2A7B7BAB00D9539B /* Config.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Config.swift; sourceTree = ""; }; + 71CC64BC2ACFD9A100BC9235 /* RNMenuVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RNMenuVC.swift; sourceTree = ""; }; 71DBF23D2ABB255A0013415B /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "../../../../Runnect-iOS/Runnect-iOS/Runnect-iOS/GoogleService-Info.plist"; sourceTree = ""; }; A3305A96296EF58C000B1A10 /* GoalRewardInfoDto.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GoalRewardInfoDto.swift; sourceTree = ""; }; A3BC2F2A2962C3D500198261 /* GoalRewardInfoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GoalRewardInfoVC.swift; sourceTree = ""; }; @@ -1050,6 +1052,7 @@ CEB0BCBB29D123350048CCD5 /* GuideView.swift */, CED791B22A2626AF001BFCFB /* ShadowView.swift */, A3C2CAD629E53B2900EC525B /* RNAlertVC.swift */, + 71CC64BC2ACFD9A100BC9235 /* RNMenuVC.swift */, ); path = UIComponents; sourceTree = ""; @@ -1355,6 +1358,7 @@ CE66560A295D924A00C64E12 /* Result+.swift in Sources */, DA20D847296697A600F1581F /* MyCourseSelectVC.swift in Sources */, CE10065529680F7000FD31FB /* DepartureSearchingResponseDto.swift in Sources */, + 71CC64BD2ACFD9A100BC9235 /* RNMenuVC.swift in Sources */, CE66560E295D92A500C64E12 /* setStatusBarBackgroundColor.swift in Sources */, CE9291292965E01D0010959C /* RNTimeFormatter.swift in Sources */, CE0C23792966D6AF00B45063 /* ViewPager.swift in Sources */, diff --git a/Runnect-iOS/Runnect-iOS/Global/UIComponents/RNMenuVC.swift b/Runnect-iOS/Runnect-iOS/Global/UIComponents/RNMenuVC.swift new file mode 100644 index 00000000..958395cb --- /dev/null +++ b/Runnect-iOS/Runnect-iOS/Global/UIComponents/RNMenuVC.swift @@ -0,0 +1,29 @@ +// +// RNMenuVC.swift +// Runnect-iOS +// +// Created by 이명진 on 2023/10/06. +// + +import UIKit + +class RNMenuVC: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + } + + + /* + // MARK: - Navigation + + // In a storyboard-based application, you will often want to do a little preparation before navigation + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { + // Get the new view controller using segue.destination. + // Pass the selected object to the new view controller. + } + */ + +} From ec4c5dd36fff6db03e3f515a125fa68dc0620f2c Mon Sep 17 00:00:00 2001 From: LeeMyeongJin Date: Mon, 9 Oct 2023 16:06:01 +0900 Subject: [PATCH 02/10] =?UTF-8?q?[Feat]=20#192=20-=20DropDown=20=EC=BB=A4?= =?UTF-8?q?=EC=8A=A4=ED=85=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Global/UIComponents/RNMenuVC.swift | 121 +++++++++++++++++- 1 file changed, 114 insertions(+), 7 deletions(-) diff --git a/Runnect-iOS/Runnect-iOS/Global/UIComponents/RNMenuVC.swift b/Runnect-iOS/Runnect-iOS/Global/UIComponents/RNMenuVC.swift index 958395cb..9ba71a02 100644 --- a/Runnect-iOS/Runnect-iOS/Global/UIComponents/RNMenuVC.swift +++ b/Runnect-iOS/Runnect-iOS/Global/UIComponents/RNMenuVC.swift @@ -6,24 +6,131 @@ // import UIKit +import DropDown +import Combine class RNMenuVC: UIViewController { + + let menu = DropDown() + + let dropbutton = UIButton().then { + $0.setTitle("DropDownClick", for: .normal) + $0.tintColor = .m1 + } + + let line = UIView().then { + $0.backgroundColor = .black + $0.frame.size.height = 30 // 구분선의 높이를 1로 설정 + } + + private let dropView = UIView().then { + $0.backgroundColor = .w1 + } + override func viewDidLoad() { super.viewDidLoad() + view.backgroundColor = .g1.withAlphaComponent(0.3) + view.addSubviews(dropView, dropbutton) + + initUI() + setTarget() + setDropDown() + // anchorView를 통해 UI와 연결 + + dropbutton.snp.makeConstraints { make in + make.center.equalToSuperview() + } // Do any additional setup after loading the view. } + func setDropDown() { + + let items = ["수정하기", "삭제하기"] + + menu.dataSource = items + menu.cellNib = UINib(nibName: "RNDropDownCell", bundle: nil) + menu.anchorView = dropbutton +// dropDown.bottomOffset = CGPoint(x: -20, y: dropbutton.bounds.height + 50) + menu.width = 170 + menu.cellHeight = 40 + menu.cornerRadius = 10 + menu.dismissMode = .onTap + +// dropDown.customCellConfiguration = { (index: Index, item: String, cell: DropDownCell) -> Void in +// let dividerLine = UIView(frame: CGRect(x: 0, y: cell.frame.height - 4 , width: self.view.frame.width - 20, height: 1)) +// dividerLine.backgroundColor = UIColor(hex: "EBEBEB") +// cell.addSubview(dividerLine) +// } + menu.separatorColor = .black + } - /* - // MARK: - Navigation +} + +extension RNMenuVC { + + // DropDown UI 커스텀 + func initUI() { + // DropDown View의 배경 + dropView.backgroundColor = UIColor.init(hex: "#F1F1F1") + dropView.layer.cornerRadius = 8 + + DropDown.appearance().textColor = UIColor.black // 아이템 텍스트 색상 + DropDown.appearance().selectedTextColor = UIColor.red // 선택된 아이템 텍스트 색상 + DropDown.appearance().backgroundColor = UIColor.white // 아이템 팝업 배경 색상 + DropDown.appearance().selectionBackgroundColor = UIColor.lightGray // 선택한 아이템 배경 색상 + DropDown.appearance().setupCornerRadius(10) + menu.dismissMode = .automatic // 팝업을 닫을 모드 설정 + + menu.customCellConfiguration = { index, title, cell in + guard let cell = cell as? RNDropDownCell else {return} + + + } + menu.customCellConfiguration = { (index: Index, item: String, cell: DropDownCell) -> Void in + let lastdividerLineRemove = UIView(frame: CGRect(origin: CGPoint(x: 0, y: 119), size: CGSize(width: 170, height: 10))) + lastdividerLineRemove.backgroundColor = .white + cell.addSubview(lastdividerLineRemove) + } + + // 마지막 줄만 없에는 코드 있으면 완벽함 + + } + + private func setTarget() { + dropbutton.addTarget(self, action: #selector(touchButton), for: .touchUpInside) + } + + @objc private func touchButton() { + menu.show() + } + +} - // In a storyboard-based application, you will often want to do a little preparation before navigation - override func prepare(for segue: UIStoryboardSegue, sender: Any?) { - // Get the new view controller using segue.destination. - // Pass the selected object to the new view controller. +#if DEBUG +import SwiftUI +struct Preview: UIViewControllerRepresentable { + + func makeUIViewController(context: Context) -> UIViewController { + // 이부분 + RNMenuVC() + // 이거 보고싶은 현재 VC로 바꾸면됩니다. + } + + func updateUIViewController(_ uiView: UIViewController, context: Context) { + // leave this empty } - */ +} +struct ViewController_PreviewProvider: PreviewProvider { + static var previews: some View { + Group { + Preview() + .edgesIgnoringSafeArea(.all) + .previewDisplayName("Preview") + .previewDevice(PreviewDevice(rawValue: "iPhone 12 Pro")) + } + } } +#endif From d98320f9664ab90d4cb104f12cc6928271a3bd9c Mon Sep 17 00:00:00 2001 From: LeeMyeongJin Date: Tue, 10 Oct 2023 15:53:03 +0900 Subject: [PATCH 03/10] =?UTF-8?q?[Feat]=20#192=20-=20DropDown=20asset=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Global/Literal/ImageLiterals.swift | 2 + .../ic_modify.imageset/Contents.json | 23 +++++++++ .../ic_modify.imageset/Vector.png | Bin 0 -> 256 bytes .../ic_modify.imageset/Vector@2x.png | Bin 0 -> 375 bytes .../ic_modify.imageset/Vector@3x.png | Bin 0 -> 459 bytes .../ic_remove.imageset/Contents.json | 23 +++++++++ .../ic_remove.imageset/Vector.png | Bin 0 -> 407 bytes .../ic_remove.imageset/Vector@2x.png | Bin 0 -> 736 bytes .../ic_remove.imageset/Vector@3x.png | Bin 0 -> 967 bytes .../Global/UIComponents/RNMenuVC.swift | 47 ++++++++++++------ 10 files changed, 80 insertions(+), 15 deletions(-) create mode 100644 Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_modify.imageset/Contents.json create mode 100644 Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_modify.imageset/Vector.png create mode 100644 Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_modify.imageset/Vector@2x.png create mode 100644 Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_modify.imageset/Vector@3x.png create mode 100644 Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_remove.imageset/Contents.json create mode 100644 Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_remove.imageset/Vector.png create mode 100644 Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_remove.imageset/Vector@2x.png create mode 100644 Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_remove.imageset/Vector@3x.png diff --git a/Runnect-iOS/Runnect-iOS/Global/Literal/ImageLiterals.swift b/Runnect-iOS/Runnect-iOS/Global/Literal/ImageLiterals.swift index 2c61a6e8..d98c8f8f 100644 --- a/Runnect-iOS/Runnect-iOS/Global/Literal/ImageLiterals.swift +++ b/Runnect-iOS/Runnect-iOS/Global/Literal/ImageLiterals.swift @@ -49,6 +49,8 @@ enum ImageLiterals { static var icFollowButton: UIImage {.load(named: "ic_follow_button")} static var icFollowedButton: UIImage {.load(named: "ic_followed_button")} static var icShareButton: UIImage {.load(named: "ic_share")} + static var icModify: UIImage {.load(named: "ic_modify")} + static var icRemove: UIImage {.load(named: "ic_remove")} // img static var imgBackground: UIImage { .load(named: "img_background") } diff --git a/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_modify.imageset/Contents.json b/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_modify.imageset/Contents.json new file mode 100644 index 00000000..df240cf1 --- /dev/null +++ b/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_modify.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "Vector.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Vector@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Vector@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_modify.imageset/Vector.png b/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_modify.imageset/Vector.png new file mode 100644 index 0000000000000000000000000000000000000000..002713a2a6c0e7833ee7fcc95ec3df6f2c830cc1 GIT binary patch literal 256 zcmeAS@N?(olHy`uVBq!ia0vp^+(693!3HF^taP6Tq&N#aB8!3I!XV7ZFl&wkP>``W z$lZxy-8q?;Kn_c~qpu?a!^VE@KZ&eB{!~vF$B+uf-u{iehYfgGTo3i`nxbXtWYna7 z!s{Gcq^hvROa<*7Aus)=s@SvMXkd)K#>^6T<)Nokv7+G4wezwT6#EsOQ+|`P_U+DT z63JIW)>d;QKH2P2^RM&8%%E4Ml3!nIEoS`?P^MZ{@m}4I`MR9(hb7!Y?1AI z`B~(&rJ?$A z?QP}}noFZK_7qk#F8=6tcv*Pzd1ejm^iF(WC$JF`w#?{iht=IU% zxx*K%dR1o-cyZ2Tm7Q0r_Zq)*_HNl2y4l?|a7TT!uMJjl3Ek=)kQ1@RknzA#Vg+?RMW7tw literal 0 HcmV?d00001 diff --git a/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_modify.imageset/Vector@3x.png b/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_modify.imageset/Vector@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..b6ceced0a8fe5970e7dc6193135169b8c1711fa6 GIT binary patch literal 459 zcmV;+0W|)JP)*uEJ+N^c0+ z1MtvC^?MsYc3u#}CLA{22t>fS+t~=+EHHo|U{h6HGe< zuIm@|ULiyykDV%E1HcR`(lpJFI=*6-frW?z;L8-CK<;#7RtN+@X|V#F+2uP;(~WM> zxF_ZU)E;m`Py&n))PPAu2*4;J6hMmz2{?%e4LCw90XRS`1^7oS3D_f+24Ge$09cG( zeE~3+E&%u$*)or@T16=URtPG9F@h3cgrEjsegQbX3~T$0N#Fng002ovPDHLkV1hF@ Bu)F{O literal 0 HcmV?d00001 diff --git a/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_remove.imageset/Contents.json b/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_remove.imageset/Contents.json new file mode 100644 index 00000000..df240cf1 --- /dev/null +++ b/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_remove.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "Vector.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Vector@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Vector@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_remove.imageset/Vector.png b/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_remove.imageset/Vector.png new file mode 100644 index 0000000000000000000000000000000000000000..508320edaa075946cad7ad8a44c6f6403e490e17 GIT binary patch literal 407 zcmV;I0cie-P)00009a7bBm000XU z000XU0RWnu7ytkO0drDELIAGL9O(c600d`2O+f$vv5yP;gVoJ=wQtgk}Sekc`j`GD=6u22LlaH;66<4EUnleDJ4_g4hy*ML?nSLO#AH zS!Gc)P17Q^d@hROJ`6)IYx1bU?EBtfd*Zb$OGmh@dkf4AQg&G1qUHjk8|wVDZQGo} zp#%7VvsFsDED@;DNK|+CKwZ~QnrMvCEQK>+>=kuCUS1%wd7kTeo^Qd+Czzke3fLDK zEM)blaq=P@K#f9|kmiUqleY&iFVcME33x?#@MPsAYSiKeWoZ5%jW5|`1JhxU7pWv? z%>XJMABTUNe|q*okPBkaC#Uf^`OgRSbsDrp*!o={+f-{V$}oqoMZ!Glc*E002ovPDHLkV1kIy Brz`*f literal 0 HcmV?d00001 diff --git a/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_remove.imageset/Vector@2x.png b/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_remove.imageset/Vector@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..6cd5a2b15f0ac5fbab077a65e0101e977939efeb GIT binary patch literal 736 zcmV<60w4W}P)Lckf2fr|+2&0rmYHv{iR0FGdB1dB6}4^%;Mu()yH<0mYQ zdoR3U@7cs-2_iLBLX6Q2Qud`Ba8yWJS=Gu=pZ21w*;wVM0p`u)D7@Ui~) z0mIKwl>`U`{o9p-%`9LuGDLIONS_U2{8JPCq02F-j2J2=U`)_{GRkI9`HLz5zCNJQ zG1IYqK|4<;v9l?DCuG_qRfP6oe7)MS$acWIbrh*eK$H{0o9479VE(H&#%n>o% zrIS%Kg@CDb+yQVbulxP}O$gDkV)U4)Hw&TvFt+s(NebX_IGmj}o6R(7P&em(yF9KY#G*qY&mi*m>xodT!=AWFZS)0)%Z zA3`_lym9iSd}xjpa7MV7$fm3;^%H;IY&Hut6DGE8eFcfgY#+vBRQL;(gvr)K z_faAXK9{)?>rXX~N`I0CRfELN@A*JxNBXF+laJ^=>MN7YpfbR^A6WO~j{gN0hZ^8Q SglBjF0000S100009a7bBm001F4 z001F40Y#QEU;qFB0drDELIAGL9O(c600d`2O+f$vv5yP8^{R-Mc~F##BZc>~5e(!sp=PwqEDHK3%a;;WN z9S()Fk@`kwe(b7LjAS7u|mkFA-wG<7B;F?^dhT zzEl^4y&)Q(Vco<Ka0%29n0-730~#u&-qILq69vC8zlOfhmSGkF6g z0{g!ua{A1rOVD5>uN&Rot#?woMuat1MSNwKd4 zC?acK86(FNK87L(w6a2$i=PM=;Xh3aEc~48faYP1hesE={{ktoh>=T)1i9Us&`!~U zbn6)-mlO%;byn8*TIPNYIpA`uCbE(mNGG}l&uASw%3&`=-kZ%41h0iSBV+rgaS1N) z&nOP?_nl?5qD~gL$cblNurBT-1*{u^aPgC%qpaXMV!SkRWhb0TaFLr4`9s!}JS)um zFb;ZP%P7yJcH(ykb6*#HZ=ld{I?(G22tJ@pAqzPJyttX5(g4cGSG<$^C{^(A9?@)002ovPDHLkV1oUyyubhe literal 0 HcmV?d00001 diff --git a/Runnect-iOS/Runnect-iOS/Global/UIComponents/RNMenuVC.swift b/Runnect-iOS/Runnect-iOS/Global/UIComponents/RNMenuVC.swift index 9ba71a02..6b2bcb83 100644 --- a/Runnect-iOS/Runnect-iOS/Global/UIComponents/RNMenuVC.swift +++ b/Runnect-iOS/Runnect-iOS/Global/UIComponents/RNMenuVC.swift @@ -11,9 +11,11 @@ import Combine class RNMenuVC: UIViewController { - let menu = DropDown() + private var items = [String]() + private var popUpImageArray = [UIImage]() + let dropbutton = UIButton().then { $0.setTitle("DropDownClick", for: .normal) $0.tintColor = .m1 @@ -28,6 +30,16 @@ class RNMenuVC: UIViewController { $0.backgroundColor = .w1 } +// init(ImageArray: [UIImage], items: [String]) { +// super.init(nibName: nil, bundle: nil) +// self.popUpImageArray = ImageArray +// self.items = items +// } +// +// required init?(coder: NSCoder) { +// fatalError("init(coder:) has not been implemented") +// } + override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .g1.withAlphaComponent(0.3) @@ -48,21 +60,16 @@ class RNMenuVC: UIViewController { func setDropDown() { let items = ["수정하기", "삭제하기"] + let itemsCount = items.count menu.dataSource = items - menu.cellNib = UINib(nibName: "RNDropDownCell", bundle: nil) menu.anchorView = dropbutton -// dropDown.bottomOffset = CGPoint(x: -20, y: dropbutton.bounds.height + 50) + menu.bottomOffset = CGPoint(x: -20, y: dropbutton.bounds.height + 50) menu.width = 170 menu.cellHeight = 40 menu.cornerRadius = 10 menu.dismissMode = .onTap -// dropDown.customCellConfiguration = { (index: Index, item: String, cell: DropDownCell) -> Void in -// let dividerLine = UIView(frame: CGRect(x: 0, y: cell.frame.height - 4 , width: self.view.frame.width - 20, height: 1)) -// dividerLine.backgroundColor = UIColor(hex: "EBEBEB") -// cell.addSubview(dividerLine) -// } menu.separatorColor = .black } @@ -73,6 +80,8 @@ extension RNMenuVC { // DropDown UI 커스텀 func initUI() { // DropDown View의 배경 + + let imageArray: [UIImage] = [ImageLiterals.icModify, ImageLiterals.icRemove] dropView.backgroundColor = UIColor.init(hex: "#F1F1F1") dropView.layer.cornerRadius = 8 @@ -82,22 +91,30 @@ extension RNMenuVC { DropDown.appearance().selectionBackgroundColor = UIColor.lightGray // 선택한 아이템 배경 색상 DropDown.appearance().setupCornerRadius(10) menu.dismissMode = .automatic // 팝업을 닫을 모드 설정 - - menu.customCellConfiguration = { index, title, cell in - guard let cell = cell as? RNDropDownCell else {return} - - - } + menu.customCellConfiguration = { (index: Index, item: String, cell: DropDownCell) -> Void in - let lastdividerLineRemove = UIView(frame: CGRect(origin: CGPoint(x: 0, y: 119), size: CGSize(width: 170, height: 10))) + let lastdividerLineRemove = UIView(frame: CGRect(origin: CGPoint(x: 0, y: 79), size: CGSize(width: 170, height: 10))) lastdividerLineRemove.backgroundColor = .white cell.addSubview(lastdividerLineRemove) + cell.dropDownImage.image = imageArray[index] + } + + menu.selectionAction = { [unowned self] (index, item) in + + self.menu.clearSelection() + print("선택 index \(index)") + print("선택 item \(item)") + } // 마지막 줄만 없에는 코드 있으면 완벽함 } + private func setLayout() { + + } + private func setTarget() { dropbutton.addTarget(self, action: #selector(touchButton), for: .touchUpInside) } From d3a0e75306047cb44f5e626b9fb1a53e98705ce5 Mon Sep 17 00:00:00 2001 From: LeeMyeongJin Date: Tue, 10 Oct 2023 18:28:48 +0900 Subject: [PATCH 04/10] =?UTF-8?q?[Feat]=20#192=20-=20=EC=8B=A0=EA=B3=A0?= =?UTF-8?q?=ED=95=98=EA=B8=B0=20=EB=B2=84=ED=8A=BC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ic_report.imageset/Contents.json | 23 ++++++++++++++++++ .../ic_report.imageset/Group 9565.png | Bin 0 -> 286 bytes .../ic_report.imageset/Group 9565@2x.png | Bin 0 -> 407 bytes .../ic_report.imageset/Group 9565@3x.png | Bin 0 -> 521 bytes 4 files changed, 23 insertions(+) create mode 100644 Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_report.imageset/Contents.json create mode 100644 Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_report.imageset/Group 9565.png create mode 100644 Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_report.imageset/Group 9565@2x.png create mode 100644 Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_report.imageset/Group 9565@3x.png diff --git a/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_report.imageset/Contents.json b/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_report.imageset/Contents.json new file mode 100644 index 00000000..b4671c4f --- /dev/null +++ b/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_report.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "Group 9565.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Group 9565@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Group 9565@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_report.imageset/Group 9565.png b/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_report.imageset/Group 9565.png new file mode 100644 index 0000000000000000000000000000000000000000..e4ddd72685bfee968910d2943bcd31fc67bd3673 GIT binary patch literal 286 zcmeAS@N?(olHy`uVBq!ia0vp^{2``W z$lZxy-8q?;Kn_c~qpu?a!^VE@KZ&eB{$@`X$B+ufqmu#!4;cu!OmAxNIKX(&QS||X z%9s9ll?M%04opG^7#B2HX;haq`piz_s@Y(if9c-YXYVF4#Oi)%J@drF_mg7V#xP^q zFSV-bk4{F-K6kP;q&9S~*^I2c6J>9{xNjA;tvBqej!$(_h)u{usgv4)tE+re?>#OJ zSu!c(San&)nyDootGRZc`q2C@eV$8_Ws~#IBQc9AJvH}!TCA|c>HptjTX?l^E6?Qp eY`gBvUB;^$JpZih|a_%6V+eQS000cH9N7QIsMwp*)rbAA}CmS z*Mx(uNP&LJAYX8#!#WT(*0I4Ic@A-2-dxw7&tvSg&AD(Euk+~Xu`?i0+ zY1tXU<`b(kZ92kRKAv6Ie?y}6zsU46<$Lqj96lBzv3$puAAC0^$RrzvtU30hQ!7aS z_1Xgl7o%P;PnG6r>|zT)+p$zO?b>zAS3Wmc4>L#lu1QL@V`42@t++)md`aNsb3H%& zKG<)Z74evJ1+U=hoaD8+5yJ6#?=Nl)wYGYblQ46+eD3c~vFdp%Vk}Ng>)Z5PvT=^g zmdK II;Vst0CxuAB>(^b literal 0 HcmV?d00001 From 72fbc6a6b0e724a2e5fe848938a0f38260cb5569 Mon Sep 17 00:00:00 2001 From: LeeMyeongJin Date: Tue, 10 Oct 2023 18:29:57 +0900 Subject: [PATCH 05/10] =?UTF-8?q?[Feat]=20#192=20-=20=EB=B0=94=EB=80=90=20?= =?UTF-8?q?=ED=8C=9D=EC=97=85=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit refactoring 필요 --- .../Global/Literal/ImageLiterals.swift | 1 + .../Global/UIComponents/RNMenuVC.swift | 58 ++++-------- .../CourseDetail/VC/CourseDetailVC.swift | 89 +++++++++++++------ 3 files changed, 80 insertions(+), 68 deletions(-) diff --git a/Runnect-iOS/Runnect-iOS/Global/Literal/ImageLiterals.swift b/Runnect-iOS/Runnect-iOS/Global/Literal/ImageLiterals.swift index d98c8f8f..1bcbf738 100644 --- a/Runnect-iOS/Runnect-iOS/Global/Literal/ImageLiterals.swift +++ b/Runnect-iOS/Runnect-iOS/Global/Literal/ImageLiterals.swift @@ -51,6 +51,7 @@ enum ImageLiterals { static var icShareButton: UIImage {.load(named: "ic_share")} static var icModify: UIImage {.load(named: "ic_modify")} static var icRemove: UIImage {.load(named: "ic_remove")} + static var icReport: UIImage {.load(named: "ic_report")} // img static var imgBackground: UIImage { .load(named: "img_background") } diff --git a/Runnect-iOS/Runnect-iOS/Global/UIComponents/RNMenuVC.swift b/Runnect-iOS/Runnect-iOS/Global/UIComponents/RNMenuVC.swift index 6b2bcb83..c31c8ee1 100644 --- a/Runnect-iOS/Runnect-iOS/Global/UIComponents/RNMenuVC.swift +++ b/Runnect-iOS/Runnect-iOS/Global/UIComponents/RNMenuVC.swift @@ -11,21 +11,16 @@ import Combine class RNMenuVC: UIViewController { - let menu = DropDown() + private let menu = DropDown() private var items = [String]() private var popUpImageArray = [UIImage]() - let dropbutton = UIButton().then { + private let dropbutton = UIButton().then { $0.setTitle("DropDownClick", for: .normal) $0.tintColor = .m1 } - let line = UIView().then { - $0.backgroundColor = .black - $0.frame.size.height = 30 // 구분선의 높이를 1로 설정 - } - private let dropView = UIView().then { $0.backgroundColor = .w1 } @@ -71,6 +66,7 @@ class RNMenuVC: UIViewController { menu.dismissMode = .onTap menu.separatorColor = .black + // UIColor(hex: "#EBEBEB") } } @@ -82,19 +78,20 @@ extension RNMenuVC { // DropDown View의 배경 let imageArray: [UIImage] = [ImageLiterals.icModify, ImageLiterals.icRemove] - dropView.backgroundColor = UIColor.init(hex: "#F1F1F1") + dropView.backgroundColor = UIColor(hex: "#FFFFFF") dropView.layer.cornerRadius = 8 DropDown.appearance().textColor = UIColor.black // 아이템 텍스트 색상 DropDown.appearance().selectedTextColor = UIColor.red // 선택된 아이템 텍스트 색상 + DropDown.appearance().selectionBackgroundColor = UIColor(hex: "#FFFFFF") // 선택한 아이템 배경 색상 DropDown.appearance().backgroundColor = UIColor.white // 아이템 팝업 배경 색상 - DropDown.appearance().selectionBackgroundColor = UIColor.lightGray // 선택한 아이템 배경 색상 DropDown.appearance().setupCornerRadius(10) menu.dismissMode = .automatic // 팝업을 닫을 모드 설정 - + menu.customCellConfiguration = { (index: Index, item: String, cell: DropDownCell) -> Void in let lastdividerLineRemove = UIView(frame: CGRect(origin: CGPoint(x: 0, y: 79), size: CGSize(width: 170, height: 10))) lastdividerLineRemove.backgroundColor = .white + cell.separatorInset = .zero cell.addSubview(lastdividerLineRemove) cell.dropDownImage.image = imageArray[index] } @@ -102,8 +99,18 @@ extension RNMenuVC { menu.selectionAction = { [unowned self] (index, item) in self.menu.clearSelection() - print("선택 index \(index)") - print("선택 item \(item)") + + switch item { + case "수정하기": + print("수정") + case "삭제하기": + print("삭제") + case "신고하기": + print("신고") + default: + print("암것도 아님") + + } } @@ -124,30 +131,3 @@ extension RNMenuVC { } } - -#if DEBUG -import SwiftUI -struct Preview: UIViewControllerRepresentable { - - func makeUIViewController(context: Context) -> UIViewController { - // 이부분 - RNMenuVC() - // 이거 보고싶은 현재 VC로 바꾸면됩니다. - } - - func updateUIViewController(_ uiView: UIViewController, context: Context) { - // leave this empty - } -} - -struct ViewController_PreviewProvider: PreviewProvider { - static var previews: some View { - Group { - Preview() - .edgesIgnoringSafeArea(.all) - .previewDisplayName("Preview") - .previewDevice(PreviewDevice(rawValue: "iPhone 12 Pro")) - } - } -} -#endif diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseDetailVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseDetailVC.swift index bab77f65..93580024 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseDetailVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseDetailVC.swift @@ -17,6 +17,7 @@ import FirebaseCore import FirebaseDynamicLinks import KakaoSDKShare import KakaoSDKTemplate +import DropDown final class CourseDetailVC: UIViewController { @@ -194,41 +195,63 @@ extension CourseDetailVC { } @objc func moreButtonDidTap() { guard let isMyCourse = self.isMyCourse, let uploadedCourseDetailModel = self.uploadedCourseDetailModel else { return } - - let cancelAction = UIAlertAction(title: "닫기", style: .cancel, handler: nil) - - if isMyCourse == true { - let editAlertController = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet) - - let editAction = UIAlertAction(title: "수정하기", style: .default, handler: {(_: UIAlertAction!) in + + let menu = DropDown() + let items = isMyCourse ? ["수정하기", "삭제하기"] : ["신고하기"] + let imageArray: [UIImage] = isMyCourse ? [ImageLiterals.icModify, ImageLiterals.icRemove] : [ImageLiterals.icReport] + + DropDown.appearance().textColor = UIColor.black + DropDown.appearance().selectedTextColor = UIColor.red + DropDown.appearance().selectionBackgroundColor = UIColor(hex: "#FFFFFF") + DropDown.appearance().backgroundColor = UIColor.white + DropDown.appearance().setupCornerRadius(12) + + menu.customCellConfiguration = { (index: Index, item: String, cell: DropDownCell) -> Void in + let lastdividerLineRemove = UIView(frame: CGRect(origin: CGPoint(x: 0, y: isMyCourse ? 79 : 39), size: CGSize(width: 170, height: 10))) + lastdividerLineRemove.backgroundColor = .white + cell.separatorInset = .zero + cell.addSubview(lastdividerLineRemove) + cell.dropDownImage.image = imageArray[index] + } + menu.anchorView = moreButton + menu.bottomOffset = CGPoint(x: -136, y: moreButton.bounds.height - 10) + menu.width = 170 + menu.cellHeight = 40 + menu.cornerRadius = 12 + menu.dismissMode = .onTap + menu.separatorColor = .black + menu.dataSource = items + menu.show() + + menu.selectionAction = { [unowned self] (index, item) in + menu.clearSelection() + + switch item { + case "수정하기": let courseEditVC = CourseEditVC() courseEditVC.loadData(model: uploadedCourseDetailModel) courseEditVC.publicCourseId = self.publicCourseId - self.navigationController?.pushViewController(courseEditVC, animated: false) - }) - let deleteAlertVC = RNAlertVC(description: "러닝 기록을 정말로 삭제하시겠어요?").setButtonTitle("취소", "삭제하기") - deleteAlertVC.rightButtonTapAction = { [weak self] in - deleteAlertVC.dismiss(animated: false) - self?.deleteCourse() + self.navigationController?.pushViewController(courseEditVC, animated: true) + case "삭제하기": + let deleteAlertVC = RNAlertVC(description: "러닝 기록을 정말로 삭제하시겠어요?").setButtonTitle("취소", "삭제하기") + self.navigationController?.pushViewController(deleteAlertVC, animated: true) + deleteAlertVC.modalPresentationStyle = .overFullScreen + deleteAlertVC.rightButtonTapAction = { [weak self] in + deleteAlertVC.dismiss(animated: false) + self?.deleteCourse() + } + case "신고하기": + if !isMyCourse { + let formUrl = NSURL(string: "https://docs.google.com/forms/d/e/1FAIpQLSek2rkClKfGaz1zwTEHX3Oojbq_pbF3ifPYMYezBU0_pe-_Tg/viewform") + let formSafariView: SFSafariViewController = SFSafariViewController(url: formUrl! as URL) + self.present(formSafariView, animated: true, completion: nil) + } + default: + print("암것도 아님") } - deleteAlertVC.modalPresentationStyle = .overFullScreen - let deleteAction = UIAlertAction(title: "삭제하기", style: .destructive, handler: {(_: UIAlertAction!) in - self.present(deleteAlertVC, animated: false, completion: nil) - }) - [ editAction, deleteAction, cancelAction].forEach { editAlertController.addAction($0) } - present(editAlertController, animated: false, completion: nil) - } else { - // 신고폼 올라오는 거(유저아이디가 내가 아닌 경우) - let reportAlertController = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet) - let formUrl = NSURL(string: "https://docs.google.com/forms/d/e/1FAIpQLSek2rkClKfGaz1zwTEHX3Oojbq_pbF3ifPYMYezBU0_pe-_Tg/viewform") - let formSafariView: SFSafariViewController = SFSafariViewController(url: formUrl! as URL) - let reportAction = UIAlertAction(title: "신고하기", style: .destructive, handler: {(_: UIAlertAction!) in - self.present(formSafariView, animated: true, completion: nil) - }) - [ reportAction, cancelAction ].forEach { reportAlertController.addAction($0) } - present(reportAlertController, animated: true, completion: nil) } } + private func pushToCountDownVC() { guard let courseModel = self.courseModel, @@ -534,3 +557,11 @@ extension CourseDetailVC { } } } + +extension CourseDetailVC { + + func moreButtonDidTapped() { + + } +} + From 9910a60fb68ce276eba1b9a6544bedd5eae2237c Mon Sep 17 00:00:00 2001 From: LeeMyeongJin Date: Tue, 10 Oct 2023 22:36:40 +0900 Subject: [PATCH 06/10] =?UTF-8?q?[Feat]=20#192=20-=20=ED=8C=9D=EC=97=85=20?= =?UTF-8?q?=EB=A1=9C=EC=A7=81=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CourseDetail/VC/CourseDetailVC.swift | 12 ++++++------ .../Presentation/CourseDetail/VC/CourseEditVC.swift | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseDetailVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseDetailVC.swift index 93580024..93db6927 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseDetailVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseDetailVC.swift @@ -223,23 +223,23 @@ extension CourseDetailVC { menu.dataSource = items menu.show() - menu.selectionAction = { [unowned self] (index, item) in + menu.selectionAction = { [unowned self] (_, item) in menu.clearSelection() - + switch item { case "수정하기": let courseEditVC = CourseEditVC() courseEditVC.loadData(model: uploadedCourseDetailModel) courseEditVC.publicCourseId = self.publicCourseId - self.navigationController?.pushViewController(courseEditVC, animated: true) + self.navigationController?.pushViewController(courseEditVC, animated: false) case "삭제하기": let deleteAlertVC = RNAlertVC(description: "러닝 기록을 정말로 삭제하시겠어요?").setButtonTitle("취소", "삭제하기") - self.navigationController?.pushViewController(deleteAlertVC, animated: true) deleteAlertVC.modalPresentationStyle = .overFullScreen - deleteAlertVC.rightButtonTapAction = { [weak self] in + deleteAlertVC.rightButtonTapAction = { deleteAlertVC.dismiss(animated: false) - self?.deleteCourse() + self.deleteCourse() } + self.present(deleteAlertVC, animated: false) case "신고하기": if !isMyCourse { let formUrl = NSURL(string: "https://docs.google.com/forms/d/e/1FAIpQLSek2rkClKfGaz1zwTEHX3Oojbq_pbF3ifPYMYezBU0_pe-_Tg/viewform") diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseEditVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseEditVC.swift index 4a5176db..d9738214 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseEditVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseEditVC.swift @@ -393,6 +393,7 @@ extension CourseEditVC { let status = result.statusCode if 200..<300 ~= status { self.showToast(message: "게시글 수정이 완료되었어요") + self.navigationController?.popViewController(animated: true) } if status >= 400 { print("400 error") From 0bd269a41c378efa98e661d9d4a97cd32237c703 Mon Sep 17 00:00:00 2001 From: LeeMyeongJin Date: Wed, 11 Oct 2023 16:31:14 +0900 Subject: [PATCH 07/10] =?UTF-8?q?[Feat]=20#192=20-=20UI=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20=EB=B0=8F=20pod=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Runnect-iOS/Podfile | 2 +- Runnect-iOS/Podfile.lock | 17 ++- .../Runnect-iOS.xcodeproj/project.pbxproj | 4 - .../Global/UIComponents/RNMenuVC.swift | 133 ------------------ .../CourseDetail/VC/CourseDetailVC.swift | 105 +++++++------- .../CourseDetail/VC/CourseEditVC.swift | 2 +- 6 files changed, 70 insertions(+), 193 deletions(-) delete mode 100644 Runnect-iOS/Runnect-iOS/Global/UIComponents/RNMenuVC.swift diff --git a/Runnect-iOS/Podfile b/Runnect-iOS/Podfile index 0c456718..4dc887e5 100644 --- a/Runnect-iOS/Podfile +++ b/Runnect-iOS/Podfile @@ -16,7 +16,7 @@ target 'Runnect-iOS' do pod 'KakaoSDKShare' pod 'KakaoSDKTemplate' pod 'FirebaseDynamicLinks' - pod 'DropDown' + pod 'DropDown', :git => 'https://github.com/thingineeer/DropDown.git', :commit => '95ee36f7bd925d466033c2c169979f1c574bf3b9' # Pods for Runnect-iOS diff --git a/Runnect-iOS/Podfile.lock b/Runnect-iOS/Podfile.lock index eb89b5a0..709b4440 100644 --- a/Runnect-iOS/Podfile.lock +++ b/Runnect-iOS/Podfile.lock @@ -43,7 +43,7 @@ PODS: - Then (3.0.0) DEPENDENCIES: - - DropDown + - DropDown (from `https://github.com/thingineeer/DropDown.git`, commit `95ee36f7bd925d466033c2c169979f1c574bf3b9`) - FirebaseDynamicLinks - KakaoSDKAuth - KakaoSDKCommon @@ -59,7 +59,6 @@ DEPENDENCIES: SPEC REPOS: trunk: - Alamofire - - DropDown - FirebaseCore - FirebaseCoreInternal - FirebaseDynamicLinks @@ -77,9 +76,19 @@ SPEC REPOS: - SnapKit - Then +EXTERNAL SOURCES: + DropDown: + :commit: 95ee36f7bd925d466033c2c169979f1c574bf3b9 + :git: https://github.com/thingineeer/DropDown.git + +CHECKOUT OPTIONS: + DropDown: + :commit: 95ee36f7bd925d466033c2c169979f1c574bf3b9 + :git: https://github.com/thingineeer/DropDown.git + SPEC CHECKSUMS: Alamofire: 0123a34370cb170936ae79a8df46cc62b2edeb88 - DropDown: 8a2116376c1981888557f72ec2ffc9a5e0e456ec + DropDown: bf260fd688978138019ad7d94f63a2362dad85ba FirebaseCore: 6fc17ac9f03509d51c131298aacb3ee5698b4f02 FirebaseCoreInternal: d558159ee6cc4b823c2296ecc193de9f6d9a5bb3 FirebaseDynamicLinks: 0eaabff2d0e5d0e576c0227227b00771aa2f3aaf @@ -97,6 +106,6 @@ SPEC CHECKSUMS: SnapKit: e01d52ebb8ddbc333eefe2132acf85c8227d9c25 Then: 844265ae87834bbe1147d91d5d41a404da2ec27d -PODFILE CHECKSUM: 8c75b9b0a2cf370949980b5f04bcc016bcd48163 +PODFILE CHECKSUM: 1690034adc086f3ca4725818bc29571a720d60db COCOAPODS: 1.12.1 diff --git a/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj b/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj index 3026502a..47b9d4dc 100644 --- a/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj +++ b/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj @@ -9,7 +9,6 @@ /* Begin PBXBuildFile section */ 0AEBD608F3973389E8E1C6D6 /* Pods_Runnect_iOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 015778D02D5CDE0838284CD7 /* Pods_Runnect_iOS.framework */; }; 712F661D2A7B7BAB00D9539B /* Config.swift in Sources */ = {isa = PBXBuildFile; fileRef = 712F661C2A7B7BAB00D9539B /* Config.swift */; }; - 71CC64BD2ACFD9A100BC9235 /* RNMenuVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 71CC64BC2ACFD9A100BC9235 /* RNMenuVC.swift */; }; 71DBF23E2ABB255A0013415B /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 71DBF23D2ABB255A0013415B /* GoogleService-Info.plist */; }; A3305A97296EF58C000B1A10 /* GoalRewardInfoDto.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3305A96296EF58C000B1A10 /* GoalRewardInfoDto.swift */; }; A3BC2F2B2962C3D500198261 /* GoalRewardInfoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3BC2F2A2962C3D500198261 /* GoalRewardInfoVC.swift */; }; @@ -167,7 +166,6 @@ 3C3033C911343B5C57EB68E7 /* Pods-Runnect-iOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runnect-iOS.debug.xcconfig"; path = "Target Support Files/Pods-Runnect-iOS/Pods-Runnect-iOS.debug.xcconfig"; sourceTree = ""; }; 7110A6032AA337DD009A7E99 /* Runnect-iOSDebug.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "Runnect-iOSDebug.entitlements"; sourceTree = ""; }; 712F661C2A7B7BAB00D9539B /* Config.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Config.swift; sourceTree = ""; }; - 71CC64BC2ACFD9A100BC9235 /* RNMenuVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RNMenuVC.swift; sourceTree = ""; }; 71DBF23D2ABB255A0013415B /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "../../../../Runnect-iOS/Runnect-iOS/Runnect-iOS/GoogleService-Info.plist"; sourceTree = ""; }; A3305A96296EF58C000B1A10 /* GoalRewardInfoDto.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GoalRewardInfoDto.swift; sourceTree = ""; }; A3BC2F2A2962C3D500198261 /* GoalRewardInfoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GoalRewardInfoVC.swift; sourceTree = ""; }; @@ -1052,7 +1050,6 @@ CEB0BCBB29D123350048CCD5 /* GuideView.swift */, CED791B22A2626AF001BFCFB /* ShadowView.swift */, A3C2CAD629E53B2900EC525B /* RNAlertVC.swift */, - 71CC64BC2ACFD9A100BC9235 /* RNMenuVC.swift */, ); path = UIComponents; sourceTree = ""; @@ -1358,7 +1355,6 @@ CE66560A295D924A00C64E12 /* Result+.swift in Sources */, DA20D847296697A600F1581F /* MyCourseSelectVC.swift in Sources */, CE10065529680F7000FD31FB /* DepartureSearchingResponseDto.swift in Sources */, - 71CC64BD2ACFD9A100BC9235 /* RNMenuVC.swift in Sources */, CE66560E295D92A500C64E12 /* setStatusBarBackgroundColor.swift in Sources */, CE9291292965E01D0010959C /* RNTimeFormatter.swift in Sources */, CE0C23792966D6AF00B45063 /* ViewPager.swift in Sources */, diff --git a/Runnect-iOS/Runnect-iOS/Global/UIComponents/RNMenuVC.swift b/Runnect-iOS/Runnect-iOS/Global/UIComponents/RNMenuVC.swift deleted file mode 100644 index c31c8ee1..00000000 --- a/Runnect-iOS/Runnect-iOS/Global/UIComponents/RNMenuVC.swift +++ /dev/null @@ -1,133 +0,0 @@ -// -// RNMenuVC.swift -// Runnect-iOS -// -// Created by 이명진 on 2023/10/06. -// - -import UIKit -import DropDown -import Combine - -class RNMenuVC: UIViewController { - - private let menu = DropDown() - - private var items = [String]() - private var popUpImageArray = [UIImage]() - - private let dropbutton = UIButton().then { - $0.setTitle("DropDownClick", for: .normal) - $0.tintColor = .m1 - } - - private let dropView = UIView().then { - $0.backgroundColor = .w1 - } - -// init(ImageArray: [UIImage], items: [String]) { -// super.init(nibName: nil, bundle: nil) -// self.popUpImageArray = ImageArray -// self.items = items -// } -// -// required init?(coder: NSCoder) { -// fatalError("init(coder:) has not been implemented") -// } - - override func viewDidLoad() { - super.viewDidLoad() - view.backgroundColor = .g1.withAlphaComponent(0.3) - view.addSubviews(dropView, dropbutton) - - initUI() - setTarget() - setDropDown() - // anchorView를 통해 UI와 연결 - - dropbutton.snp.makeConstraints { make in - make.center.equalToSuperview() - } - - // Do any additional setup after loading the view. - } - - func setDropDown() { - - let items = ["수정하기", "삭제하기"] - let itemsCount = items.count - - menu.dataSource = items - menu.anchorView = dropbutton - menu.bottomOffset = CGPoint(x: -20, y: dropbutton.bounds.height + 50) - menu.width = 170 - menu.cellHeight = 40 - menu.cornerRadius = 10 - menu.dismissMode = .onTap - - menu.separatorColor = .black - // UIColor(hex: "#EBEBEB") - } - -} - -extension RNMenuVC { - - // DropDown UI 커스텀 - func initUI() { - // DropDown View의 배경 - - let imageArray: [UIImage] = [ImageLiterals.icModify, ImageLiterals.icRemove] - dropView.backgroundColor = UIColor(hex: "#FFFFFF") - dropView.layer.cornerRadius = 8 - - DropDown.appearance().textColor = UIColor.black // 아이템 텍스트 색상 - DropDown.appearance().selectedTextColor = UIColor.red // 선택된 아이템 텍스트 색상 - DropDown.appearance().selectionBackgroundColor = UIColor(hex: "#FFFFFF") // 선택한 아이템 배경 색상 - DropDown.appearance().backgroundColor = UIColor.white // 아이템 팝업 배경 색상 - DropDown.appearance().setupCornerRadius(10) - menu.dismissMode = .automatic // 팝업을 닫을 모드 설정 - - menu.customCellConfiguration = { (index: Index, item: String, cell: DropDownCell) -> Void in - let lastdividerLineRemove = UIView(frame: CGRect(origin: CGPoint(x: 0, y: 79), size: CGSize(width: 170, height: 10))) - lastdividerLineRemove.backgroundColor = .white - cell.separatorInset = .zero - cell.addSubview(lastdividerLineRemove) - cell.dropDownImage.image = imageArray[index] - } - - menu.selectionAction = { [unowned self] (index, item) in - - self.menu.clearSelection() - - switch item { - case "수정하기": - print("수정") - case "삭제하기": - print("삭제") - case "신고하기": - print("신고") - default: - print("암것도 아님") - - } - - } - - // 마지막 줄만 없에는 코드 있으면 완벽함 - - } - - private func setLayout() { - - } - - private func setTarget() { - dropbutton.addTarget(self, action: #selector(touchButton), for: .touchUpInside) - } - - @objc private func touchButton() { - menu.show() - } - -} diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseDetailVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseDetailVC.swift index 93db6927..de7dd673 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseDetailVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseDetailVC.swift @@ -195,63 +195,35 @@ extension CourseDetailVC { } @objc func moreButtonDidTap() { guard let isMyCourse = self.isMyCourse, let uploadedCourseDetailModel = self.uploadedCourseDetailModel else { return } - - let menu = DropDown() + let items = isMyCourse ? ["수정하기", "삭제하기"] : ["신고하기"] let imageArray: [UIImage] = isMyCourse ? [ImageLiterals.icModify, ImageLiterals.icRemove] : [ImageLiterals.icReport] + + let menu = DropDown().then { + $0.anchorView = moreButton + $0.backgroundColor = .w1 + $0.bottomOffset = CGPoint(x: -136, y: moreButton.bounds.height - 10) + $0.width = 170 + $0.cellHeight = 40 + $0.cornerRadius = 12 + $0.dismissMode = .onTap + $0.separatorColor = UIColor(hex: "#EBEBEB") + $0.dataSource = items + $0.textFont = .b3 + } - DropDown.appearance().textColor = UIColor.black - DropDown.appearance().selectedTextColor = UIColor.red - DropDown.appearance().selectionBackgroundColor = UIColor(hex: "#FFFFFF") - DropDown.appearance().backgroundColor = UIColor.white - DropDown.appearance().setupCornerRadius(12) - - menu.customCellConfiguration = { (index: Index, item: String, cell: DropDownCell) -> Void in + menu.customCellConfiguration = { (index: Index, _: String, cell: DropDownCell) -> Void in let lastdividerLineRemove = UIView(frame: CGRect(origin: CGPoint(x: 0, y: isMyCourse ? 79 : 39), size: CGSize(width: 170, height: 10))) lastdividerLineRemove.backgroundColor = .white cell.separatorInset = .zero - cell.addSubview(lastdividerLineRemove) cell.dropDownImage.image = imageArray[index] + cell.addSubview(lastdividerLineRemove) } - menu.anchorView = moreButton - menu.bottomOffset = CGPoint(x: -136, y: moreButton.bounds.height - 10) - menu.width = 170 - menu.cellHeight = 40 - menu.cornerRadius = 12 - menu.dismissMode = .onTap - menu.separatorColor = .black - menu.dataSource = items + + dropDownTouchAction(menu: menu, uploadedCourseDetailModel: uploadedCourseDetailModel, isMyCourse: isMyCourse) + menu.show() - - menu.selectionAction = { [unowned self] (_, item) in - menu.clearSelection() - - switch item { - case "수정하기": - let courseEditVC = CourseEditVC() - courseEditVC.loadData(model: uploadedCourseDetailModel) - courseEditVC.publicCourseId = self.publicCourseId - self.navigationController?.pushViewController(courseEditVC, animated: false) - case "삭제하기": - let deleteAlertVC = RNAlertVC(description: "러닝 기록을 정말로 삭제하시겠어요?").setButtonTitle("취소", "삭제하기") - deleteAlertVC.modalPresentationStyle = .overFullScreen - deleteAlertVC.rightButtonTapAction = { - deleteAlertVC.dismiss(animated: false) - self.deleteCourse() - } - self.present(deleteAlertVC, animated: false) - case "신고하기": - if !isMyCourse { - let formUrl = NSURL(string: "https://docs.google.com/forms/d/e/1FAIpQLSek2rkClKfGaz1zwTEHX3Oojbq_pbF3ifPYMYezBU0_pe-_Tg/viewform") - let formSafariView: SFSafariViewController = SFSafariViewController(url: formUrl! as URL) - self.present(formSafariView, animated: true, completion: nil) - } - default: - print("암것도 아님") - } - } } - private func pushToCountDownVC() { guard let courseModel = self.courseModel, @@ -558,10 +530,43 @@ extension CourseDetailVC { } } +// MARK: - DropDown + extension CourseDetailVC { - - func moreButtonDidTapped() { + private func dropDownTouchAction(menu: DropDown, uploadedCourseDetailModel: UploadedCourseDetailResponseDto, isMyCourse: Bool) { + DropDown.appearance().textColor = .g1 + DropDown.appearance().selectionBackgroundColor = .w1 + DropDown.appearance().shadowColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.2) + DropDown.appearance().shadowOpacity = 1 + DropDown.appearance().shadowRadius = 10 + + menu.selectionAction = { [unowned self] (_, item) in + menu.clearSelection() + + switch item { + case "수정하기": + let courseEditVC = CourseEditVC() + courseEditVC.loadData(model: uploadedCourseDetailModel) + courseEditVC.publicCourseId = self.publicCourseId + self.navigationController?.pushViewController(courseEditVC, animated: false) + case "삭제하기": + let deleteAlertVC = RNAlertVC(description: "러닝 기록을 정말로 삭제하시겠어요?").setButtonTitle("취소", "삭제하기") + deleteAlertVC.modalPresentationStyle = .overFullScreen + deleteAlertVC.rightButtonTapAction = { + deleteAlertVC.dismiss(animated: false) + self.deleteCourse() + } + self.present(deleteAlertVC, animated: false) + case "신고하기": + if !isMyCourse { + let formUrl = NSURL(string: "https://docs.google.com/forms/d/e/1FAIpQLSek2rkClKfGaz1zwTEHX3Oojbq_pbF3ifPYMYezBU0_pe-_Tg/viewform") + let formSafariView: SFSafariViewController = SFSafariViewController(url: formUrl! as URL) + self.present(formSafariView, animated: true, completion: nil) + } + default: + self.showToast(message: "없는 명령어 입니다.") + } + } } } - diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseEditVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseEditVC.swift index d9738214..ef6821fe 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseEditVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseEditVC.swift @@ -392,8 +392,8 @@ extension CourseEditVC { case .success(let result): let status = result.statusCode if 200..<300 ~= status { - self.showToast(message: "게시글 수정이 완료되었어요") self.navigationController?.popViewController(animated: true) + showToast(message: "게시글 수정이 완료되었어요") } if status >= 400 { print("400 error") From 2a8bd6eb10aa3fa6b17d9f32b20d0c759e708ec6 Mon Sep 17 00:00:00 2001 From: LeeMyeongJin Date: Wed, 11 Oct 2023 16:51:44 +0900 Subject: [PATCH 08/10] =?UTF-8?q?[Feat]=20#192=20-=20=EC=82=AD=EC=A0=9C=20?= =?UTF-8?q?reloadData()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Presentation/CourseDetail/VC/CourseDetailVC.swift | 1 + .../Presentation/MyPage/VC/InfoVC/UploadedCourseInfoVC.swift | 1 + 2 files changed, 2 insertions(+) diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseDetailVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseDetailVC.swift index de7dd673..179e207f 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseDetailVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseDetailVC.swift @@ -517,6 +517,7 @@ extension CourseDetailVC { let status = result.statusCode if 200..<300 ~= status { print("삭제 성공") + self.navigationController?.popViewController(animated: true) } if status >= 400 { print("400 error") diff --git a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/UploadedCourseInfoVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/UploadedCourseInfoVC.swift index 4a990933..405115cc 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/UploadedCourseInfoVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/UploadedCourseInfoVC.swift @@ -342,6 +342,7 @@ extension UploadedCourseInfoVC { let responseDto = try result.map(BaseResponse.self) guard let data = responseDto.data else { return } self.setData(courseList: data.publicCourses) + UploadedCourseInfoCollectionView.reloadData() } catch { print(error.localizedDescription) } From 4ff1c730b5e508791bbb206f20b0d5428c26f897 Mon Sep 17 00:00:00 2001 From: LeeMyeongJin Date: Wed, 11 Oct 2023 19:44:08 +0900 Subject: [PATCH 09/10] =?UTF-8?q?[Feat]=20#192=20-=20=EC=82=AD=EC=A0=9C?= =?UTF-8?q?=EB=B2=84=ED=8A=BC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Presentation/CourseDetail/VC/CourseDetailVC.swift | 2 +- .../Runnect-iOS/Presentation/CourseDetail/VC/CourseEditVC.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseDetailVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseDetailVC.swift index 179e207f..d11f69eb 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseDetailVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseDetailVC.swift @@ -517,7 +517,6 @@ extension CourseDetailVC { let status = result.statusCode if 200..<300 ~= status { print("삭제 성공") - self.navigationController?.popViewController(animated: true) } if status >= 400 { print("400 error") @@ -557,6 +556,7 @@ extension CourseDetailVC { deleteAlertVC.rightButtonTapAction = { deleteAlertVC.dismiss(animated: false) self.deleteCourse() + self.navigationController?.popViewController(animated: true) } self.present(deleteAlertVC, animated: false) case "신고하기": diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseEditVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseEditVC.swift index ef6821fe..c175793f 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseEditVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseEditVC.swift @@ -392,7 +392,7 @@ extension CourseEditVC { case .success(let result): let status = result.statusCode if 200..<300 ~= status { - self.navigationController?.popViewController(animated: true) + self.navigationController?.popViewController(animated: true) /// 추가한 부분 수정 필요 showToast(message: "게시글 수정이 완료되었어요") } if status >= 400 { From 15e68782b8a66b35678b1c9d72a28fccef4de0a5 Mon Sep 17 00:00:00 2001 From: LeeMyeongJin Date: Fri, 13 Oct 2023 16:10:28 +0900 Subject: [PATCH 10/10] =?UTF-8?q?[Feat]=20#192=20-=20=EB=B3=80=EC=88=98?= =?UTF-8?q?=EB=AA=85=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Presentation/CourseDetail/VC/CourseDetailVC.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseDetailVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseDetailVC.swift index d11f69eb..ab2aa6c6 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseDetailVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseDetailVC.swift @@ -213,11 +213,11 @@ extension CourseDetailVC { } menu.customCellConfiguration = { (index: Index, _: String, cell: DropDownCell) -> Void in - let lastdividerLineRemove = UIView(frame: CGRect(origin: CGPoint(x: 0, y: isMyCourse ? 79 : 39), size: CGSize(width: 170, height: 10))) - lastdividerLineRemove.backgroundColor = .white + let lastDividerLineRemove = UIView(frame: CGRect(origin: CGPoint(x: 0, y: isMyCourse ? 79 : 39), size: CGSize(width: 170, height: 10))) + lastDividerLineRemove.backgroundColor = .white cell.separatorInset = .zero cell.dropDownImage.image = imageArray[index] - cell.addSubview(lastdividerLineRemove) + cell.addSubview(lastDividerLineRemove) } dropDownTouchAction(menu: menu, uploadedCourseDetailModel: uploadedCourseDetailModel, isMyCourse: isMyCourse)