[디자인 패턴] MVC

J_sung_0o0
1 min readSep 12, 2020

--

Model

struct 이나 간단한 class 형태로 앱 데이터를 들고 있습니다.

View

스크린 상의 시각적 요소와 컨트롤들을 보여줍니다. 보통 UIView 의 서브클래스 형태입니다.

Controller

Model View 들을 조직화 합니다. 보통 UIViewController 의 서브클래스 형태입니다.

View”들은 delegate 를 통해 그들이 속한 컨트롤러를 weak 하게 참조합니다.

주의 사항

MVC에는 한계가 있습니다. 모든 객체가 M/V/C 어디에도 확실히 들어 맞지는 않습니다. 때문에 MVC 만 사용하는 앱은 Controller 들이 많은 로직을 갖게 될 수 있습니다. 이는 ViewController 가 계속 커지는 문제를 야기합니다. (MVC는 Massive View Controller 라는 우스갯소리도 있을 정도)

이를 해결하기 위해 필요에 따라 다른 디자인 패턴을 도입해야 합니다.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

J_sung_0o0
J_sung_0o0

Written by J_sung_0o0

Apple WWDC 19 & 20 Winner (The 1st two-time winner of all time from South Korea)

No responses yet

Write a response