Skip to content

7th seminar#5

Open
SeoyoungOhMe wants to merge 3 commits intodevelopfrom
7thSeminar
Open

7th seminar#5
SeoyoungOhMe wants to merge 3 commits intodevelopfrom
7thSeminar

Conversation

@SeoyoungOhMe
Copy link
Copy Markdown
Collaborator

@SeoyoungOhMe SeoyoungOhMe commented May 27, 2024

🔥Pull requests

⛳️ 작업한 브랜치

👷 작업한 내용

  • 기존의 코드에 SOLID 패턴을 적용했습니다.(기본과제)
  • 폴더링을 신경써서 수정했습니다.
  • viewDidLoad에는 함수만 들어가도록 수정했습니다.
  • 전에 실패했던 API 연결에 성공했습니다.
  • 이슈를 파고 PR을 쪼개서 올리는 것을 시도해보았습니다.

🚨 참고 사항

  • 수정된 폴더링은 다음과 같습니다.
.
├── Week2_assignment
│   ├── Application
│   ├── Base.lproj
│   ├── Global
│   │   ├── Extensions
│   │   ├── Resources
│   │   └── Settings
│   │       ├── Config.swift
│   │       └── Info.plist
│   ├── Network
│   │   ├── Base
│   │   │   ├── BaseService.swift
│   │   │   ├── BaseTargetType.swift
│   │   │   ├── MoyaLoggingPlugin.swift
│   │   │   ├── NetworkResult.swift
│   │   │   └── NetworkService.swift
│   │   └── BoxOffice
│   │       ├── BoxOfficeService.swift
│   │       ├── BoxOfficeTargetType.swift
│   │       └── DTO
│   │           └── GetBoxOfficeResponse.swift
│   └── Presentation
│       ├── ContentCollection
│       │   ├── Cell
│       │   │   ├── BaseballCollectionViewCell.swift
│       │   │   ├── HeaderCollectionView.swift
│       │   │   ├── LiveCollectionViewCell.swift
│       │   │   ├── PosterCollectionViewCell.swift
│       │   │   └── TabControllCollectionViewCell.swift
│       │   ├── ContentCollectionViewCell.swift
│       │   ├── ContentViewController.swift
│       │   ├── Model
│       │   │   ├── BaseballSlogan.swift
│       │   │   ├── LiveProgramModel.swift
│       │   │   └── PosterModel.swift
│       │   └── ViewController
│       │       ├── MainViewController.swift
│       │       └── TabBarController.swift
│       └── Welcome
│           └── ViewController
│               ├── ViewController.swift
│               └── WelcomeViewController.swift

📸 스크린샷

기능 스크린샷
로그인 뷰
메인 뷰

📟 관련 이슈

@SeoyoungOhMe SeoyoungOhMe self-assigned this May 27, 2024
@SeoyoungOhMe SeoyoungOhMe marked this pull request as ready for review May 27, 2024 15:39
@SeoyoungOhMe SeoyoungOhMe changed the base branch from main to develop May 28, 2024 02:58
Copy link
Copy Markdown

@kim-seonwoo kim-seonwoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

상당히 많은 변경이 보이네요..
정말.. 수고많으셨습니다 !! 🙇👍

var task: Task {
switch self {
case let .fetchBoxOfficeData(date):
return .requestParameters(parameters: ["key": "b4ddbf38f567f468512099872d9cc672", "targetDt": date], encoding: URLEncoding.queryString)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

key값도 Config에서 base url 숨기신 방식처럼 처리하시면 안전하답니다!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저도 이것떄문에 꿀밤한번 맞았습니다 선우가 말한대로 Config에서 base url 숨긴 방법처럼 Privacy로 관리하는것이 좋습니다. 아니 그렇게 해야합니다. (특히나 Git레포가 Public 상태라면.)
왜냐하면 이렇게 오픈된 깃 레포에 개인 키나 서버 url이 오픈되어있는 상태라면 이런것만 전문적으로 크롤링하는 사람들이 해당 키를 보고 서영님 서버나 키에 접근해서 멋대로 사용할수도 있는 위험한 상황이 있을수 있습니다.
개인정보 보호를 위해 privacy를 생활화 해봐요!!

(어려운 내용은 아니고 privacy Info.plist , git ignore <- 이 키워드로 검색하시면 이해되실거에요)

Comment on lines +109 to +116
view.addSubview(titleLabel)
view.addSubview(idTextField)
view.addSubview(passwordTextField)
view.addSubview(loginButton)
view.addSubview(idFindButton)
view.addSubview(passwordFindButton)
view.addSubview(accountQuestionLabel)
view.addSubview(signUpButton)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

자료실에 있는 addSubviews 익스텐션 써봐도 좋을것 같아요!!

Comment on lines +220 to +225
if let image = UIImage(named: "x-circle") {
let imageSize = image.size
print("Image Size: \(imageSize)")
} else {
print("Image not found or couldn't be loaded.")
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오옹 이부분은 어떤 이유로 쓰시게 되셨나요~?

Copy link
Copy Markdown
Member

@hooni0918 hooni0918 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아름다운 코드 잘보고갑니다. 오늘도 행복한 하루 되세요 :)


extension UITextField {

/// 텍스트필드의 왼쪽과 오른쪽에 패딩을 추가하는 함수
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

하나씩 알아가려는 모습 정말 좋습니다!!!

var task: Task {
switch self {
case let .fetchBoxOfficeData(date):
return .requestParameters(parameters: ["key": "b4ddbf38f567f468512099872d9cc672", "targetDt": date], encoding: URLEncoding.queryString)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저도 이것떄문에 꿀밤한번 맞았습니다 선우가 말한대로 Config에서 base url 숨긴 방법처럼 Privacy로 관리하는것이 좋습니다. 아니 그렇게 해야합니다. (특히나 Git레포가 Public 상태라면.)
왜냐하면 이렇게 오픈된 깃 레포에 개인 키나 서버 url이 오픈되어있는 상태라면 이런것만 전문적으로 크롤링하는 사람들이 해당 키를 보고 서영님 서버나 키에 접근해서 멋대로 사용할수도 있는 위험한 상황이 있을수 있습니다.
개인정보 보호를 위해 privacy를 생활화 해봐요!!

(어려운 내용은 아니고 privacy Info.plist , git ignore <- 이 키워드로 검색하시면 이해되실거에요)

private func setStyle() {
self.navigationController?.navigationBar.isHidden = true

mainPoster.do {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

와우 .do 를 사용하니 훨씬 가독성이 좋아졋네요! do를 이렇게 잘 사용하시다니 정말 멋져요!!

Comment on lines +162 to +193
// //테이블 뷰에 셀 등록 1.어떤 셀 등록할지 2.식별자
// private func register() {
// contentTableView.register(
// ContentTableViewCell.self,
// forCellReuseIdentifier: ContentTableViewCell.identifier
// )
// }
// private func setDelegate() {
// contentTableView.delegate = self
// contentTableView.dataSource = self
// }

}

//extension MainViewController: UITableViewDelegate {
// func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
// return tableView.frame.width // 테이블 뷰의 너비를 셀의 높이로 사용하여 가로 스크롤을 위한 높이 조절
// }
//}

//extension MainViewController: UITableViewDataSource {
// func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
// return 5
// }
//
// func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
// guard let cell = tableView.dequeueReusableCell(withIdentifier: ContentTableViewCell.identifier, for: indexPath) as? ContentTableViewCell else { return UITableViewCell() }
// cell.dataBind(contentList[indexPath.row])
// return cell
// }
//}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

불필요한 코드는 지우기!

Comment on lines +250 to +257
protocol LoginPresenterProtocol {
func didTapLoginButton(id: String?, password: String?)
func didChangeTextField(text: String?, for textField: UITextField)
}

// MARK: - LoginPresenter
class LoginPresenter: LoginPresenterProtocol {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요부분도 새롭게 분리해보는것 추천드려요 같은 파일내부보다 이부분만 도려내서 새로운 .swift파일로 만들어도 좋을것같습니다 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] 리펙토링

3 participants