Skip to content

Code Convention

Hyungyu Kim edited this page Nov 12, 2021 · 9 revisions

Code Convention

StyleShare - swift style guide 을 기본으둜 따라간닀.

μ•„λž˜λŠ” StyleShare μ—μ„œ λ³€κ²½ ν˜Ήμ€ μΆ”κ°€ν•΄μ„œ μ μš©ν•  convention 이닀.

@IBAction

- λ™μ‚¬μ›ν˜• + λͺ©μ μ–΄ ex) touchBackButton

λ·° μ „ν™˜

- pop, push, present, dismiss
- 동사 + To + λͺ©μ μ§€ λ·° (λ‹€μŒμ— 보일 λ·°)
- dismissλŠ” dismiss + ν˜„μž¬ λ·°

register

- register + λͺ©μ μ–΄ ex) registerXib

UICollectionViewDelegate, UICollectionViewDatsource λ“± μ‹œμŠ€ν…œ ν”„λ‘œν† μ½œ

- assignDelegate

μ»€μŠ€ν…€ ν”„λ‘œν† μ½œ

- λ·° 이름 + Delegate

μ„œλ²„ν†΅μ‹ 

- μ„œλΉ„μŠ€ν•¨μˆ˜λͺ… + WithAPI ex) getListWithAPI

μ• λ‹ˆλ©”μ΄μ…˜

- λ™μ‚¬μ›ν˜• + λͺ©μ μ–΄ + WithAnimation
- showButtonsWithAnimation

MARK 주석

()
// MARK: - Properties

// MARK: - @IBOutlet Properties

// MARK: - @IBAction Properties

// MARK: - View Life Cycle

// MARK: - Extensions
> setUI, registerXib, assignDelegate λ“±

// MARK: - Network
> λ„€νŠΈμ›Œν¬ λͺ©μ μ„ 가진 ν•¨μˆ˜λ“€

// TODO: - 
> ν•΄μ•Όν•˜λŠ” 것

// FIXME: -
> κ³ μΉ  μ˜ˆμ •

κΈ°νƒ€κ·œμΉ™

- `self`λŠ” μ΅œλŒ€ν•œ μ‚¬μš©μ„Β μ§€μ–‘
- `viewDidLoad()`μ—μ„œλŠ”Β ν•¨μˆ˜ν˜ΈμΆœλ§Œ
    - delegate 지정, UIκ΄€λ ¨ μ„€μ • λ“±λ“± λͺ¨λ‘ ν•¨μˆ˜μ™€ 역할에 λ”°λΌμ„œ extension 으둜 λΉΌκΈ°
Clone this wiki locally