Skip to content

Commit

Permalink
Squashed commit of the following: develop
Browse files Browse the repository at this point in the history
commit 7da14c6
Author: chansooo <89574881+chansooo@users.noreply.github.com>
Date:   Fri Jun 30 00:04:13 2023 +0900

    Feature/sign up (#59)

    * feat: DesignSystemType case chip 추가

    * feat: NavigationBar 구현

    * feat: Navigationdemo 구현

    * fix: NavigationDemoViewController 이름 변경

    * fix: NavigationBar titleLabel 중앙 정렬 수정

    * feat: NavigationColorType 구현

    두가지 case로 나눠서 각각 tintcolor와 backgroundcolor 설정할 수 있도록 함

    * feat: 버튼 tintcolor 변경 위해 렌더링 모드 변경

    * add: `MOITTabPager` 생성

    * add: `MOITTabPager` 생성

    * remove: dummy file 삭제

    * feat: MOITChipType 구현

    * feat: MOITChip 구현

    * feat: MOITChipDemoViewController 구현

    * feat: DemoViewController 연결

    * feat: PagerType 구현

    * feat: TapPager 구현

    * feat: SegmentPager 구현

    * feat: PagerDemoViewController 추가

    * fix: unavailable 추가

    * feat: DemoApp Chip 폴더 추가

    * fix: enum case AssociatedValue 사용하지 않는 부분 삭제

    * feat: StudyPreview 구현중

    * feat: 스와이프 ->  삭제 버튼 애니메이션 구현

    * add: secondary color set 추가

    * remove: 필요 없는 파일 삭제

    * feat: optinal인 view addItem 쉽게 할 수 있는 메소드 구현

    * refactor: 스와이프, 탭 부드럽게 변경

    * fix: StudyPreview UI 변경

    * feat: 버튼 누를 수 있는 뷰 추가

    * fix: StudyPreviewDemoViewController 수정

    * refactor: StudyPreview UI Center 맞게 수정

    * refactor: panGesture 로직 변경

    * refactor: final 추가

    * redactor: `layoutIfNeeded` 삭제

    * feat: SignUp 기본 세팅

    * feat: Utils Target 추가

    * feat: SignUp 접근 제한자 변경

    * feat: Utils 타겟에 pinlayout, flexlayout 추가

    * feat: BaseViewController 상속받을 경우 navigateBar 설정 편리하게 구현

    * feat: StudyPreview configure 함수 구현

    * feat: ProfileView image 없이 생성, configureImage 함수 추가

    * refactor: 린트 맞게 코드 수정

    * fix: navigationBar와 flexRootView 겹치지 않게 수정

    * feat: scrollView 자동 설정

    * feat: 탭 시 키보드 사라지도록 구현

    * feat: SignUpViewController 구현

    * feat: 다음 버튼 추가

    * refactor: `MOITProfileView` 이미지 로드 로직 변경

    * feat: NavigationBar logo 추가

    * feat: ViewControllable extension 추가

    * feat: StudyList shortcut 추가

    * feat: dependency 수정

    * feat: SignUp 관련 UseCase 추가

    * feat: SignUpRepository 임시 추가

    * fix: `MOITProfileView` border 추가

    * fix: SignUpDemoApp RIBs 기반으로 생성하도록 수정

    * fix: DemoApp Dependency 설정할 수 있도록 수정

    * fix: DemoApp Dependency 설정

    * feat: SignUpDependency 추가

    * chore: 주석 삭제 및 코드 스타일 수정

    * feat: SignUp 비즈니스 로직 수정

    * fix: interactor.activate 추가

    * profileselect

    * fix: baseView flexLayout 사용에 맞게 수정

    * fix: `ProfileImageType` 참조할 수 있도록 수정

    * feat: uikit 관련 extension 추가

    * fix: bottomsheetViewController 탭 contentView 외부에서 작동하도록 수정

    * fix: MOITProfileView tap 작동방식 변경

    * feat: ProfileSelectView 구현

    * feat: ProfileSelectViewController 구현

    * feat: ProfileSelectInteractor 구현

    * fix: ProfileSelect RIBlet 생성 시 현재 이미지 인덱스 전달

    * fix: SignUpDemoApp 수정

    * feat: SignUpInteractor 로직 구현

    * feat: SignUpRouter 구현

    * feat: SignUpViewController 프로필 이미지 업데이트 구현

    * fix: imageIndex 정보 함께 넘기도록 수정

    * fix: 이미지 인덱스 파라미터 추가

    * chore: 주석 삭제

    * fix: baseViewController에 removeObserver 추가

    * chore: print문 삭제

    ---------

    Co-authored-by: hyerin <hope1053@naver.com>
    Co-authored-by: chansooooo <chansoo@vaultmicro.com>

commit 8bdabbd
Author: hyerin <hope1053@naver.com>
Date:   Thu Jun 29 22:26:02 2023 +0900

    Fix/network layer fix (#55)

    * feat: Response 모델 선언

    * feat: Common Error 추가

    * feat: NetworkImpl 수정

    * feat: 옵셔널 대응

commit 74b0f88
Author: hyerin <hope1053@naver.com>
Date:   Tue Jun 27 10:09:22 2023 +0900

    Feature/adjust line height (#58)

    * feat: font 타입 별 line height return 해주는 메서드 구현

    * feat: ParagraphStyle 적용하는 UILabel Extension 구현

commit e256b51
Author: hyerin <hope1053@naver.com>
Date:   Mon Jun 26 11:38:29 2023 +0900

    Fix/design system fix (#56)

    * fix: Chip Configure 메서드 및 Convenience init 추가

    * fix: MOITTextField title 없는 경우 대응

    * fix: List에 MOITProfileView 적용

    * fix: List StudyOrder 및 Fine Formatter 적용

    * fix: Lint 수정
  • Loading branch information
hope1053 committed Jul 3, 2023
1 parent 55d040b commit 951e04f
Show file tree
Hide file tree
Showing 69 changed files with 2,013 additions and 185 deletions.
27 changes: 19 additions & 8 deletions Core/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,22 @@ import ProjectDescription
import ProjectDescriptionHelpers
import UtilityPlugin

let project = Project(name: "Core",
targets: [
Project.makeTarget(
name: "CSLogger",
dependencies: [
]
),
])
let project = Project(
name: "Core",
targets: [
Project.makeTarget(
name: "CSLogger",
dependencies: []
),
Project.makeTarget(
name: "Utils",
dependencies: [
.DesignSystem,
.ResourceKit,

.ThirdParty.PinLayout,
.ThirdParty.FlexLayout,
]
),
]
)
49 changes: 49 additions & 0 deletions Core/Utils/Base/BaseView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
//
// BaseView.swift
// Utils
//
// Created by 김찬수 on 2023/06/14.
//

import UIKit

import RxSwift
import FlexLayout
import PinLayout

open class BaseView: UIView {

// MARK: - UI
public let flexRootView = UIView()

// MARK: - Properties
public var disposebag = DisposeBag()

// MARK: - Methods
public override init(frame: CGRect) {
super.init(frame: frame)

self.backgroundColor = .white
configureAttributes()
configureHierarchy()
configureConstraints()
bind()
}

open func configureHierarchy() {
self.addSubview(flexRootView)
}
open func configureConstraints() {}
open func configureAttributes() {}
open func bind() {}

open override func layoutSubviews() {
flexRootView.pin.all()
flexRootView.flex.layout(mode: .adjustHeight)
}

@available(*, unavailable)
required public init?(coder: NSCoder) {
fatalError("init(coder:) is called.")
}
}
122 changes: 122 additions & 0 deletions Core/Utils/Base/BaseViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
//
// BaseViewController.swift
// Utils
//
// Created by 김찬수 on 2023/06/14.
//

import UIKit

import DesignSystem

import RxSwift
import PinLayout
import FlexLayout

open class BaseViewController: UIViewController {

// MARK: - UI
public let scrollView = UIScrollView()
public let flexRootView = UIView()
public lazy var navigationBar = MOITNavigationBar()

// MARK: - Properties
public var disposebag = DisposeBag()

private var indicator: UIActivityIndicatorView?

// MARK: - Initializer
public init() {
super.init(nibName: nil, bundle: nil)
}

@available(*, unavailable)
required public init(coder: NSCoder) {
fatalError("init(coder:) is called.")
}

// MARK: - LifeCycle
open override func viewDidLoad() {
super.viewDidLoad()

self.view.backgroundColor = .white

configureAttributes()
configureHierarchy()
configureConstraints()
bind()
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillShow), name: UIResponder.keyboardWillShowNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillHide), name: UIResponder.keyboardWillHideNotification, object: nil)
}

open override func viewDidDisappear(_ animated: Bool) {
NotificationCenter.default.removeObserver(UIResponder.keyboardWillShowNotification)
NotificationCenter.default.removeObserver(UIResponder.keyboardWillHideNotification)
}

@objc func keyboardWillShow(notification: NSNotification) {
if let keyboardSize = (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue {
scrollView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: keyboardSize.height, right: 0)
}
}

@objc func keyboardWillHide(notification: NSNotification) {
scrollView.contentInset = UIEdgeInsets.zero
}

open override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
scrollView.pin.all(view.pin.safeArea)
flexRootView.pin.all()
flexRootView.flex.layout(mode: .adjustHeight)
scrollView.contentSize = flexRootView.frame.size
}
// MARK: - Methods
/// addSubView 하는 함수
public func configureHierarchy() {
self.scrollView.addSubview(flexRootView)
self.view.addSubview(scrollView)
}
/// layout 잡는 함수
open func configureConstraints() {}
/// function to set the value
open func configureAttributes() {
hideKeyboardWhenTapped()
}
/// Function to bind.
open func bind() {}

/// navigationBar 사용하면 flexRootView에 추가해주는 함수
/// `viewDidLayoutSubviews`에 추가해야함
public func configureNavigationBar(
leftItems: [NavigationItemType],
title: String?,
rightItems: [NavigationItemType]
) {
navigationBar.configure(
leftItems: leftItems,
title: title,
rightItems: rightItems
)

view.addSubview(navigationBar)

navigationBar.pin.top(self.view.pin.safeArea.top).horizontally()
configureRootView()

guard let back = navigationBar.leftItems?.first(where: { $0.type == .back }) else { return }
back.rx.tap
.subscribe(onNext: { [weak self] in
self?.navigationController?.popViewController(animated: true)
})
.disposed(by: disposebag)
}

private func configureRootView() {
self.scrollView.pin.top(self.view.pin.safeArea.top + 56).left().right().bottom() // How to solve it other than absolute value..?
// scrollview에 딱 맞게 flexRootView를 pinlayout으로 설정
self.flexRootView.pin.all()
self.flexRootView.flex.layout()
self.flexRootView.flex.markDirty()
}
}
77 changes: 77 additions & 0 deletions Core/Utils/RIBs/ViewControllable+.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
//
// ViewControllable+.swift
// CSLogger
//
// Created by 김찬수 on 2023/06/16.
//

import UIKit

import RIBs

public final class NavigationControllerable: ViewControllable {

public var uiviewController: UIViewController { self.navigationController }
public let navigationController: UINavigationController

public init(root: ViewControllable) {
let navigation = UINavigationController(rootViewController: root.uiviewController)
navigation.navigationBar.isTranslucent = false
navigation.navigationBar.backgroundColor = .white
navigation.navigationBar.scrollEdgeAppearance = navigation.navigationBar.standardAppearance

self.navigationController = navigation
}
}

public extension ViewControllable {

func present(_ viewControllable: ViewControllable, animated: Bool, completion: (() -> Void)?) {
self.uiviewController.present(viewControllable.uiviewController, animated: animated, completion: completion)
}

func dismiss(completion: (() -> Void)?) {
self.uiviewController.dismiss(animated: true, completion: completion)
}

func pushViewController(_ viewControllable: ViewControllable, animated: Bool) {
if let nav = self.uiviewController as? UINavigationController {
nav.pushViewController(viewControllable.uiviewController, animated: animated)
} else {
self.uiviewController.navigationController?.pushViewController(viewControllable.uiviewController, animated: animated)
}
}

func popViewController(animated: Bool) {
if let nav = self.uiviewController as? UINavigationController {
nav.popViewController(animated: animated)
} else {
self.uiviewController.navigationController?.popViewController(animated: animated)
}
}

func popToRoot(animated: Bool) {
if let nav = self.uiviewController as? UINavigationController {
nav.popToRootViewController(animated: animated)
} else {
self.uiviewController.navigationController?.popToRootViewController(animated: animated)
}
}

func setViewControllers(_ viewControllerables: [ViewControllable]) {
if let nav = self.uiviewController as? UINavigationController {
nav.setViewControllers(viewControllerables.map(\.uiviewController), animated: true)
} else {
self.uiviewController.navigationController?.setViewControllers(viewControllerables.map(\.uiviewController), animated: true)
}
}

var topViewControllable: ViewControllable {
var top: ViewControllable = self

while let presented = top.uiviewController.presentedViewController as? ViewControllable {
top = presented
}
return top
}
}
20 changes: 20 additions & 0 deletions Core/Utils/UIKit/AdaptivePresentationControllerDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// AdaptivePresentationControllerDelegate.swift
// Utils
//
// Created by 김찬수 on 2023/06/26.
//

import UIKit

public protocol AdaptivePresentationControllerDelegate: AnyObject {
func presentationControllerDidDismiss()
}

public final class AdaptivePresentationControllerDelegateProxy: NSObject, UIAdaptivePresentationControllerDelegate {
public weak var delegate: AdaptivePresentationControllerDelegate?

public func presentationControllerDidDismiss(_ presentationController: UIPresentationController) {
delegate?.presentationControllerDidDismiss()
}
}
23 changes: 23 additions & 0 deletions Core/Utils/UIKit/UIViewController+.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// UIViewController+.swift
// Utils
//
// Created by 김찬수 on 2023/06/15.
//

import UIKit

extension UIViewController {

func hideKeyboardWhenTapped() {
let tap = UITapGestureRecognizer(target: self, action: #selector(dismissKeyboard))
tap.cancelsTouchesInView = false
// 기본값이 true이면 제스쳐 발동시 터치 이벤트가 뷰로 전달x
// 즉 제스쳐가 동작하면 뷰의 터치이벤트는 발생하지 않는것 false면 둘 다 작동한다는 뜻
view.addGestureRecognizer(tap)
}

@objc func dismissKeyboard() {
self.view.endEditing(true)
}
}
19 changes: 19 additions & 0 deletions DesignSystem/DemoApp/Sources/Chip/MOITChipDemoViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import PinLayout
public final class MOITChipDemoViewController: UIViewController {

private let flexRootContainer = UIView()
private let defaultChip = MOITChip()
private let secondDefaultChip = MOITChip()

override public func viewDidLoad() {
super.viewDidLoad()
Expand All @@ -30,6 +32,17 @@ public final class MOITChipDemoViewController: UIViewController {
flexRootContainer.flex.layout(mode: .adjustWidth)
}

override public func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)

DispatchQueue.main.asyncAfter(deadline: .now() + 2) { [weak self] in
self?.defaultChip.setType(to: .dueDate(date: 10))
self?.secondDefaultChip.setType(to: .attend)
self?.view.flex.markDirty()
self?.view.setNeedsLayout()
}
}

private func configure() {
view.addSubview(flexRootContainer)
view.backgroundColor = . white
Expand All @@ -56,6 +69,12 @@ public final class MOITChipDemoViewController: UIViewController {

flex.addItem(finishChip())
.margin(10)

flex.addItem(defaultChip)
.margin(10)

flex.addItem(secondDefaultChip)
.margin(10)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ final class MOITTextFieldDemoViewController: UIViewController {
placeHolder: "비어있는 텍스트 필드 테스트입니다"
)
private let label = UILabel()

private let noTitleTextField = MOITTextField(
title: nil,
placeHolder: "제목이 없는 텍스트 필드 테스트입니다."
)

private let disposeBag = DisposeBag()

Expand Down Expand Up @@ -49,6 +54,7 @@ final class MOITTextFieldDemoViewController: UIViewController {
.define { flex in
flex.addItem(emptyTextField)
flex.addItem(label).height(20).marginTop(30)
flex.addItem(noTitleTextField).marginTop(30)
}
}

Expand Down
Loading

0 comments on commit 951e04f

Please sign in to comment.