Skip to content

SOPT-30th-Team12-Melon/Melon-iOS

Repository files navigation

🍈 Melon-iOS 🍈

🌈 THE SOPT 30th 합동 μ„Έλ―Έλ‚˜ 12μ‘° iOS νŒ€ ν”„λ‘œμ νŠΈ λ ˆν¬μ§€ν„°λ¦¬μž…λ‹ˆλ‹€.

🌈 Notion Page


🌈 Team ENFP πŸ¦„πŸ¦„πŸ¦„

@yujinnee @lee-euijin @sssua-0928
KakaoTalk_Photo_2022-05-26-15-48-31 KakaoTalk_Photo_2022-05-26-15-47-11 KakaoTalk_Photo_2022-05-26-15-46-29
PostingView DetailView MainView

🌈🌈 Code Convention

πŸ”₯ μ§„μ§œ κΌ­ μ§€ν‚΅μ‹œλ‹€!

πŸ”₯ μŠ€νƒ€μΌμ‰μ–΄μ˜ μŠ€μœ„μŠ€νŠΈ μŠ€νƒ€μΌ κ°€μ΄λ“œλ₯Ό μ°Έκ³ ν•©λ‹ˆλ‹€.

πŸ’¬ πŸ’¬ πŸ’¬

1. μ½”λ“œ λ ˆμ΄μ•„μ›ƒ

1-1. 곡백

  • 콜둠(:)을 μ“Έ λ•Œμ—λŠ” 콜둠의 였λ₯Έμͺ½μ—λ§Œ 곡백을 λ‘‘λ‹ˆλ‹€.

    let names: [String: String]?
  • 빈 쀄은 λ”± ν•œ 쀄 μ •λ„λ§Œ.. λ„ˆλ¬΄ λ§Žμ€ 빈 쀄은 μ§€μ–‘ν•©λ‹ˆλ‹€.

1-2. MARK ꡬ문

  • MARK ꡬ문 μœ„μ™€ μ•„λž˜μ—λŠ” 곡백이 ν•„μš”ν•©λ‹ˆλ‹€.

    // MARK: Layout
    
    override func layoutSubviews() {
      // doSomething()
    }
    
    // MARK: Actions
    
    override func menuButtonDidTap() {
      // doSomething()
    }
  • MARK ꡬ문의 μˆœμ„œλŠ” μ•„λž˜μ™€ κ°™μŠ΅λ‹ˆλ‹€.

    // MARK: - Properties
    
    // MARK: - Lifecycle
    
    override func viewDidLoad() {
        super.viewDidLoad()
    }
    
    // MARK: - Override Method UI + Layout
    
    override func configUI() {
        
    }
    
    override func setupAutoLayout() {
        
    }
    
    // MARK: - Custom Method
    
    // MARK: - @objc
  • Cell νŒŒμΌμ€ // MARK: - Lifecycle λŒ€μ‹  μ•„λž˜μ™€ κ°™μŠ΅λ‹ˆλ‹€.

    // MARK: - Initializing
    
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
    }
    
    required convenience init?(coder aDecoder: NSCoder) {
        self.init(style: .default, reuseIdentifier: nil)
    }
  • Delegateλ‚˜ Datasourceλ₯Ό extension으둜 빼쀄 경우 μœ„μ— λ§ˆν¬κ΅¬λ¬Έμ„ κΌ­ μ¨μ€˜μ•Ό ν•©λ‹ˆλ‹€.

    // MARK: - UICollectionViewDelegate
    
    extension MainVC: UICollectionViewDelegate {
    
    ...
    
    }

1-3. μž„ν¬νŠΈ

  • λͺ¨λ“ˆ μž„ν¬νŠΈλŠ” μ•ŒνŒŒλ²³ 순으둜 μ •λ ¬ν•©λ‹ˆλ‹€.

  • λ‚΄μž₯ ν”„λ ˆμž„μ›Œν¬λ₯Ό λ¨Όμ € μž„ν¬νŠΈν•˜κ³ , 빈 μ€„λ‘œ κ΅¬λΆ„ν•˜μ—¬ μ„œλ“œνŒŒν‹° ν”„λ ˆμž„μ›Œν¬λ₯Ό μž„ν¬νŠΈν•©λ‹ˆλ‹€.

    import UIKit
    
    import SwiftyColor
    import SwiftyImage
    import Then
    import URLNavigator

2. 넀이밍

2-1. μ•‘μ…˜ ν•¨μˆ˜ 넀이밍

  • Action ν•¨μˆ˜μ˜ 넀이밍은 'μ£Όμ–΄ + 동사 + λͺ©μ μ–΄' ν˜•νƒœλ₯Ό μ‚¬μš©ν•©λ‹ˆλ‹€.

    • Tap(λˆŒλ €λ‹€ λ—Œ) 은  .touchUpInside에 λŒ€μ‘ν•˜κ³ ,
    • Press(λˆ„λ¦„) λŠ”Β  .touchDown에 λŒ€μ‘ν•©λ‹ˆλ‹€.
    • will~ 은 νŠΉμ • ν–‰μœ„κ°€ μΌμ–΄λ‚˜κΈ° 직전이고,Β did~ λŠ” νŠΉμ • ν–‰μœ„κ°€ μΌμ–΄λ‚œ μ§ν›„μž…λ‹ˆλ‹€.
    • should~ λŠ” 일반적으둜 Bool을 λ°˜ν™˜ν•˜λŠ” ν•¨μˆ˜μ— μ‚¬μš©λ©λ‹ˆλ‹€.
    func backButtonDidTap() {
      // ...
    }
    
    touchUpBackButton
    
    

3. ꢌμž₯사항

3-1. λ³€μˆ˜ μ΄ˆκΈ°ν™”

  • κ°€λŠ₯ν•˜λ‹€λ©΄ λ³€μˆ˜λ₯Ό μ •μ˜ν•  λ•Œ ν•¨κ»˜ μ΄ˆκΈ°ν™”ν•˜λ„λ‘ ν•©λ‹ˆλ‹€.

  • Then 라이브러리λ₯Ό μ‚¬μš©ν•˜λ©΄ μ΄ˆκΈ°ν™”μ™€ ν•¨κ»˜ 속성을 지정할 수 μžˆμŠ΅λ‹ˆλ‹€.

    let label = UILabel().then {
      $0.textAlignment = .center
      $0.textColor = .black
      $0.text = "Hello, World!"
    }
    var job: String = "iOS Programmer"

3-2. enum

  • μƒμˆ˜λ₯Ό μ •μ˜ν•  λ•Œμ—λŠ”Β enumλ₯Ό λ§Œλ“€μ–΄ λΉ„μŠ·ν•œ μƒμˆ˜λΌλ¦¬ λͺ¨μ•„λ‘‘λ‹ˆλ‹€.

    μž¬μ‚¬μš©μ„±κ³Ό μœ μ§€λ³΄μˆ˜ μΈ‘λ©΄μ—μ„œ 큰 ν–₯상을 κ°€μ Έμ˜΅λ‹ˆλ‹€.Β 

    structΒ λŒ€μ‹ Β enum을 μ‚¬μš©ν•˜λŠ” μ΄μœ λŠ”, μƒμ„±μžκ°€ μ œκ³΅λ˜μ§€ μ•ŠλŠ” μžλ£Œν˜•μ„ μ‚¬μš©ν•˜κΈ° μœ„ν•΄μ„œμž…λ‹ˆλ‹€.

  • CGFloatLiteralκ³ΌΒ SwiftyColorλ₯Ό μ‚¬μš©ν•΄μ„œ μ½”λ“œλ₯Ό λ‹¨μˆœν™”μ‹œν‚΅λ‹ˆλ‹€.

    final class ProfileViewController: UIViewController {
    
      private enum Metric {
        static let profileImageViewLeft = 10.f
        static let profileImageViewRight = 10.f
        static let nameLabelTopBottom = 8.f
        static let bioLabelTop = 6.f
      }
    
      private enum Font {
        static let nameLabel = UIFont.boldSystemFont(ofSize: 14)
        static let bioLabel = UIFont.boldSystemFont(ofSize: 12)
      }
    
      private enum Color {
        static let nameLabelText = 0x000000.color
        static let bioLabelText = 0x333333.color ~ 70%
      }
    
    }

3-3. final

  • 더이상 상속이 λ°œμƒν•˜μ§€ μ•ŠλŠ” ν΄λž˜μŠ€λŠ” 항상 finalΒ ν‚€μ›Œλ“œλ‘œ μ„ μ–Έν•©λ‹ˆλ‹€.

    final class MyViewController: UIViewController {
      // ...
    }

4. ViewController

  • ViewController, TableViewCell, CollectionViewCell
    • VC, TVC, CVC둜 μΆ•μ•½ν•΄μ„œ μ‚¬μš©ν•©λ‹ˆλ‹€.


🌈🌈🌈 Git Convention

πŸ”₯ 참고자료

πŸ”₯ λΏŒμ‚λ“€μ˜ κΉƒ μ»¨λ²€μ…˜μ΄ μžμ„Έν•˜κ²Œ 보고 μ‹Άλ‹€λ©΄?

πŸ’¬ πŸ’¬ πŸ’¬

Git Flow

1. Issueλ₯Ό μƒμ„±ν•œλ‹€.
2. feature Branchλ₯Ό μƒμ„±ν•œλ‹€.
3. Add - Commit - Push - Pull Request 의 과정을 κ±°μΉœλ‹€.
4. Pull Requestκ°€ μž‘μ„±λ˜λ©΄ μž‘μ„±μž μ΄μ™Έμ˜ λ‹€λ₯Έ νŒ€μ›μ΄ Code Reviewλ₯Ό ν•œλ‹€.
5. Code Reviewκ°€ μ™„λ£Œλ˜λ©΄ Pull Request μž‘μ„±μžκ°€ develop Branch둜 merge ν•œλ‹€.
6. μ’…λ£Œλœ Issue와 Pull Request의 Labelκ³Ό Projectλ₯Ό κ΄€λ¦¬ν•œλ‹€.

Commit Message Convention

- FEATΒ : μƒˆλ‘œμš΄ κΈ°λŠ₯ κ΅¬ν˜„
- ADDΒ : Feat μ΄μ™Έμ˜ λΆ€μˆ˜μ μΈ μ½”λ“œ μΆ”κ°€, 라이브러리 μΆ”κ°€, μƒˆλ‘œμš΄ Viewλ‚˜ Activity 생성
- CHOREΒ : κ·Έ μ΄μ™Έμ˜ 작일/ 버전 μ½”λ“œ μˆ˜μ •, νŒ¨ν‚€μ§€ ꡬ쑰 λ³€κ²½, 파일 이동, κ°€λ…μ„±μ΄λ‚˜ λ³€μˆ˜λͺ…, reformat λ“±
- FIXΒ : 버그, 였λ₯˜ ν•΄κ²°
- DELΒ : μ“Έλͺ¨μ—†λŠ” μ½”λ“œ 및 파일 μ‚­μ œ
- MODΒ : xml (μŠ€ν† λ¦¬λ³΄λ“œ) 파일만 μˆ˜μ •ν•œ 경우
- DOCSΒ : READMEλ‚˜ WIKI λ“±μ˜ λ¬Έμ„œ κ°œμ •
- REFACTORΒ : λ‚΄λΆ€ λ‘œμ§μ€ λ³€κ²½ ν•˜μ§€ μ•Šκ³  기쑴의 μ½”λ“œλ₯Ό κ°œμ„ ν•˜λŠ” λ¦¬νŒ©ν† λ§ μ‹œ
`Prefix` κ°€ ν—·κ°ˆλ¦΄ λ•Œ μ°Έκ³ ν•΄μ£Όμ„Έμš”!
[ADD] ν™ˆ ν…Œμ΄λΈ”λ·° 높이 κ΄€λ ¨ μ½”λ“œ μΆ”κ°€(#1)
[FEAT] ν™ˆ κΈ°λŠ₯ κ΅¬ν˜„**(#2)
[CHORE] ν™ˆ μ…€ λ ˆμ΄μ•„μ›ƒ μ½”λ“œ μˆ˜μ •(#2)
[MOVE] ν™ˆ 폴더 파일 이동(#2)
[FIX] ν™ˆ μ…€ λ¦¬λ‘œλ“œ 버그 ν•΄κ²°(#3)
[DEL] ν•„μš”μ—†λŠ” 주석 μ‚­μ œ(#2)

Branch Naming

<prefix μ†Œλ¬Έμžλ‘œ>/<이슈번호>-<κ΄€λ ¨μ„€λͺ…>

β†’ λŒ€μ†Œλ¬Έμž κΌ­ μ§€μΌœμ£Όμ„Έμš”!

feature/2-HomeLayout
feature/10-HomeService

Issue

  • Template μ‚¬μš©
  • 라벨 달기
  • ν”„λ‘œμ νŠΈ μΉΈλ°˜λ³΄λ“œ 체크 ν•„μˆ˜

Pull Request

  • Template μ‚¬μš© (λ‚΄μš© κΌΌκΌΌν•˜κ²Œ μž‘μ„±)
  • Code Review 24μ‹œκ°„ λ‚΄λ‘œ

Merge

  • Approved κ±Έκ³  코리 λ°›μœΌλ©΄ μžκΈ°μžμ‹ μ΄ Click


🌈🌈🌈🌈 Foldering

πŸ’¬ πŸ’¬ πŸ’¬

πŸ—‚ Melon-iOS
		   β”‚
		   |── πŸ“‚ Global
			 β”‚     |── πŸ“ Base
		   β”‚     |── πŸ“ Constant
		   β”‚     |── πŸ“ Extension
		   β”‚     └── πŸ“ Protocol
		   β”‚
		   │── πŸ“‚ Source
		   β”‚     |── πŸ“ Model
		   β”‚     |── πŸ“ Network
		   β”‚     └── πŸ“ Screen
			 |           |── Component
		   β”‚           β”‚
		   β”‚           |── TabbarController
		   β”‚           |── πŸ“ Main
		   β”‚           |     |── πŸ“ VC   
		   β”‚           |     |── πŸ“ Cell
		   β”‚           |     └── πŸ“ Component
		   β”‚           |── πŸ“ Album
		   β”‚           |     |── πŸ“ VC
		   β”‚           |     |── πŸ“ Cell
		   β”‚           |     └── πŸ“ Component 
		   β”‚	         |── πŸ“ Posting
		   β”‚                 |── πŸ“ VC 
		   β”‚                 |── πŸ“ Cell 
		   β”‚                 └── πŸ“ Component
		   β”‚           
		   β”‚         
		   β”‚
		   └── πŸ“‚ Resource
		       |
		       |── πŸ“ Support
		       |     |── AppDelegate.swift     
		       |     └── SceneDelegate.swift
		       |
		       |── πŸ“ Storyboard
		       |     |── LaunchScreen.storyboard    
		       |     |── Main.storyboard    
		       |     |── Album.storyboard    
		       |     └── Posting.storyboard
		       |
		       |── Assets.xcassets
		       └── Info.plist
		

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •