-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Squashed commit of the following: develop
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
Showing
69 changed files
with
2,013 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
20
Core/Utils/UIKit/AdaptivePresentationControllerDelegate.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.