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

Feature/participate success #64

Merged
merged 22 commits into from
Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
348b2d5
feat: dependency μ„€μ •
hope1053 Jun 16, 2023
313f581
feat: Feature 생성
hope1053 Jun 16, 2023
8f4da01
feat: InputParticipateCode UI μž‘μ—…
hope1053 Jun 16, 2023
5af8646
feat: μ ‘κ·Όμ œμ–΄μž μˆ˜μ •
hope1053 Jun 16, 2023
f4dad0c
feat: Demoapp μˆ˜μ •
hope1053 Jun 16, 2023
2b26d99
feat: 폴더링 및 ParticipationSuccess RIB 파일 생성
hope1053 Jun 16, 2023
83e3f6e
feat: 데λͺ¨μ•± μˆ˜μ •
hope1053 Jun 16, 2023
f6d8c49
feat: ParticipationSuccessViewController UI ꡬ성 쀑
hope1053 Jun 16, 2023
661b667
Squashed commit of the following: MOITInfoCard
hope1053 Jun 20, 2023
ae43def
remove: Design System StudyInfoCard μ‚­μ œ
hope1053 Jun 20, 2023
56ff0a3
feat: 데λͺ¨μ•± μ—°κ²°
hope1053 Jun 20, 2023
7464455
design: MOITDetailCardView μΆ”κ°€
hope1053 Jun 20, 2023
7624baf
feat: dummy file μ‚­μ œ 및 Interface, Implement 뢄리
hope1053 Jun 20, 2023
7fa1ce1
feat: MOITFoundation module μΆ”κ°€
hope1053 Jun 21, 2023
5ccd41a
feat: String Extension μΆ”κ°€
hope1053 Jun 21, 2023
c9d7e4d
feat: TODO μ‚­μ œ 및 ParticipationSuccess UI κ΅¬ν˜„
hope1053 Jun 21, 2023
cfd400c
feat: ParticipationSuccess Impl, Interface 뢄리
hope1053 Jun 21, 2023
7ea7820
Squashed commit of the following: develop
hope1053 Jul 7, 2023
83ec223
fix: dependency 채택
hope1053 Jul 7, 2023
56cee8a
feat: participationSuccess View attach 둜직
hope1053 Jul 7, 2023
c30d0d9
Merge branch 'develop' into feature/participate-success
hope1053 Jul 7, 2023
120724f
fix: attach, detach μˆœμ„œ λ³€κ²½
hope1053 Jul 10, 2023
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
32 changes: 32 additions & 0 deletions Core/MOITFoundation/String+Extension.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//
// String+Extension.swift
// MOITFoundation
//
// Created by 졜혜린 on 2023/06/20.
//

import UIKit

extension String {
public func addParagraphStyle(
lineSpacing: CGFloat,
alignment: NSTextAlignment,
font: UIFont,
textColor: UIColor
) -> NSMutableAttributedString {

let currentText = NSMutableAttributedString(string: self)
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.lineSpacing = lineSpacing
paragraphStyle.alignment = alignment

let attributes: [NSAttributedString.Key: Any] = [
.paragraphStyle: paragraphStyle,
.font: font,
.foregroundColor: textColor
]
currentText.addAttributes(attributes, range: NSRange(location: 0, length: currentText.length))

return currentText
}
}
2 changes: 1 addition & 1 deletion Core/Utils/UIKit/UILabel+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import UIKit

import ResourceKit

extension UILabel {
public extension UILabel {
func setTextWithParagraphStyle(
text: String,
alignment: NSTextAlignment = .left,
Expand Down
4 changes: 2 additions & 2 deletions DesignSystem/DemoApp/Sources/DesignSystemViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ final class DesignSystemViewController: UITableViewController {
self.navigationController?.pushViewController(StudyPreviewDemoViewController(), animated: true)
case .profile:
self.navigationController?.pushViewController(ProfileDemoViewController(), animated: true)
case .list:
self.navigationController?.pushViewController(MOITListDemoViewController(), animated: true)
case .list:
self.navigationController?.pushViewController(MOITListDemoViewController(), animated: true)
default: return
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
//
// dummy.swift
//

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
//
// dummy.swift
//

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
//
// dummy.swift
//

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ public protocol InputParticipateCodeDependency: Dependency {
}

final class InputParticipateCodeComponent: Component<InputParticipateCodeDependency>,
InputParticipateCodeDependency {
InputParticipateCodeDependency,
ParticipationSuccessDependency {
var participateUseCase: ParticipateUseCase { dependency.participateUseCase }
}

Expand All @@ -32,11 +33,18 @@ public final class InputParticipateCodeBuilder: Builder<InputParticipateCodeDepe
public func build(withListener listener: InputParticipateCodeListener) -> ViewableRouting {
let component = InputParticipateCodeComponent(dependency: dependency)
let viewController = InputParticipateCodeViewController()
let interactor = InputParticipateCodeInteractor(
presenter: viewController,
dependency: component
)
let interactor = InputParticipateCodeInteractor(
presenter: viewController,
dependency: component
)
interactor.listener = listener
return InputParticipateCodeRouter(interactor: interactor, viewController: viewController)

let participationSuccessBuildable = ParticipationSuccessBuilder(dependency: component)

return InputParticipateCodeRouter(
interactor: interactor,
viewController: viewController,
participationSuccessBuildable: participationSuccessBuildable
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
// Copyright Β© 2023 chansoo.MOIT. All rights reserved.
//


import MOITParticipateUserInterface
import MOITParticipateDomain

import RIBs
import RxSwift

protocol InputParticipateCodeRouting: ViewableRouting { }
protocol InputParticipateCodeRouting: ViewableRouting {
func attachPariticipationSuccess()
func detachPariticipationSuccess()
}

protocol InputParticipateCodePresentable: Presentable {
var listener: InputParticipateCodePresentableListener? { get set }
Expand Down Expand Up @@ -44,9 +45,10 @@ final class InputParticipateCodeInteractor: PresentableInteractor<InputParticipa
}

func completeButtonDidTap(with code: String) {
debugPrint(code)
// dependency.participateUseCase.execute(
// with: .init(userId: 0, invitationCode: code)
// )
router?.attachPariticipationSuccess()
}

func participationSuccessDismissButtonDidTap() {
router?.detachPariticipationSuccess()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,51 @@ import RIBs

import MOITParticipateUserInterface

protocol InputParticipateCodeInteractable: Interactable {
protocol InputParticipateCodeInteractable: Interactable, ParticipationSuccessListener {
var router: InputParticipateCodeRouting? { get set }
var listener: InputParticipateCodeListener? { get set }
}

protocol InputParticipateCodeViewControllable: ViewControllable { }

final class InputParticipateCodeRouter: ViewableRouter<InputParticipateCodeInteractable, InputParticipateCodeViewControllable>, InputParticipateCodeRouting {
final class InputParticipateCodeRouter: ViewableRouter<InputParticipateCodeInteractable,
InputParticipateCodeViewControllable>,
InputParticipateCodeRouting {

override init(interactor: InputParticipateCodeInteractable, viewController: InputParticipateCodeViewControllable) {
private let participationSuccessBuildable: ParticipationSuccessBuildable
private var participationSuccessRouting: Routing?

init(
interactor: InputParticipateCodeInteractable,
viewController: InputParticipateCodeViewControllable,
participationSuccessBuildable: ParticipationSuccessBuildable
) {
self.participationSuccessBuildable = participationSuccessBuildable
super.init(interactor: interactor, viewController: viewController)
interactor.router = self
}

func attachPariticipationSuccess() {
if participationSuccessRouting != nil {
return
}

let router = participationSuccessBuildable.build(
withListener: interactor
)

let participationSuccessViewController = router.viewControllable.uiviewController
participationSuccessViewController.modalPresentationStyle = .fullScreen
viewController.uiviewController.present(participationSuccessViewController, animated: true)
participationSuccessRouting = router
attachChild(router)
}

func detachPariticipationSuccess() {
guard let router = participationSuccessRouting else { return }

viewController.uiviewController.dismiss(animated: true)
participationSuccessRouting = nil
detachChild(router)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//
// ParticipationSuccessBuilder.swift
// MOITParticipateUserInterface
//
// Created by 졜혜린 on 2023/06/16.
// Copyright Β© 2023 chansoo.MOIT. All rights reserved.
//

import RIBs

import MOITParticipateUserInterface

protocol ParticipationSuccessDependency: Dependency { }

final class ParticipationSuccessComponent: Component<ParticipationSuccessDependency> { }

// MARK: - Builder

final class ParticipationSuccessBuilder: Builder<ParticipationSuccessDependency>, ParticipationSuccessBuildable {

override init(dependency: ParticipationSuccessDependency) {
super.init(dependency: dependency)
}

func build(withListener listener: ParticipationSuccessListener) -> ViewableRouting {
let component = ParticipationSuccessComponent(dependency: dependency)
let viewController = ParticipationSuccessViewController()
let interactor = ParticipationSuccessInteractor(presenter: viewController)
interactor.listener = listener
return ParticipationSuccessRouter(interactor: interactor, viewController: viewController)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//
// ParticipationSuccessInteractor.swift
// MOITParticipateUserInterface
//
// Created by 졜혜린 on 2023/06/16.
// Copyright Β© 2023 chansoo.MOIT. All rights reserved.
//

import RIBs
import RxSwift

import MOITParticipateUserInterface

protocol ParticipationSuccessRouting: ViewableRouting { }

protocol ParticipationSuccessPresentable: Presentable {
var listener: ParticipationSuccessPresentableListener? { get set }
}

final class ParticipationSuccessInteractor: PresentableInteractor<ParticipationSuccessPresentable>, ParticipationSuccessInteractable, ParticipationSuccessPresentableListener {

weak var router: ParticipationSuccessRouting?
weak var listener: ParticipationSuccessListener?

override init(presenter: ParticipationSuccessPresentable) {
super.init(presenter: presenter)
presenter.listener = self
}

override func didBecomeActive() {
super.didBecomeActive()
}

override func willResignActive() {
super.willResignActive()
}

func dismissButtonDidTap() {
listener?.participationSuccessDismissButtonDidTap()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//
// ParticipationSuccessRouter.swift
// MOITParticipateUserInterface
//
// Created by 졜혜린 on 2023/06/16.
// Copyright Β© 2023 chansoo.MOIT. All rights reserved.
//

import RIBs

import MOITParticipateUserInterface

protocol ParticipationSuccessInteractable: Interactable {
var router: ParticipationSuccessRouting? { get set }
var listener: ParticipationSuccessListener? { get set }
}

protocol ParticipationSuccessViewControllable: ViewControllable { }

final class ParticipationSuccessRouter: ViewableRouter<ParticipationSuccessInteractable, ParticipationSuccessViewControllable>, ParticipationSuccessRouting {

override init(interactor: ParticipationSuccessInteractable, viewController: ParticipationSuccessViewControllable) {
super.init(interactor: interactor, viewController: viewController)
interactor.router = self
}
}
Loading
Loading