Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Question Protected by gnat
Tweeted twitter.com/StackSoftEng/status/839203676614967296
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
spelling cleanup
Source Link
gnat
  • 20.5k
  • 29
  • 117
  • 309

How do iI refactor massive view controller

I have a view controller which has 5 different subviews, these subviews are changed according to some conditions, then there are functions which apply background color and add some minor aesthetics to the views.

I have segregated the functions in the viewcontroller only for views i.e Applying colors,adding views and button touch events etc.

Only for controllers ViewDidLoad, ViewDidAppear etc.

Rest iI call it as model,as as it does some calculations and other stuff. Calculating the constraints and constants for the view. Can anyone suggest me anyway how to incorporate the view,controller controller and model functions in seperateseparate class? I don't like everything crowding up in the same viewcontroller.

How do i refactor massive view controller

I have a view controller which has 5 different subviews, these subviews are changed according to some conditions, then there are functions which apply background color and add some minor aesthetics to the views.

I have segregated the functions in the viewcontroller only for views i.e Applying colors,adding views and button touch events etc.

Only for controllers ViewDidLoad, ViewDidAppear etc

Rest i call it as model,as it does some calculations and other stuff. Calculating the constraints and constants for the view. Can anyone suggest me anyway how to incorporate the view,controller and model functions in seperate class? I don't like everything crowding up in the same viewcontroller.

How do I refactor massive view controller

I have a view controller which has 5 different subviews, these subviews are changed according to some conditions, then there are functions which apply background color and add some minor aesthetics to the views.

I have segregated the functions in the viewcontroller only for views i.e Applying colors,adding views and button touch events etc.

Only for controllers ViewDidLoad, ViewDidAppear etc.

Rest I call it as model, as it does some calculations and other stuff. Calculating the constraints and constants for the view. Can anyone suggest me anyway how to incorporate the view, controller and model functions in separate class? I don't like everything crowding up in the same viewcontroller.

Bumped by Community user
Bumped by Community user
Source Link
vin
  • 267
  • 1
  • 4

How do i refactor massive view controller

I have a view controller which has 5 different subviews, these subviews are changed according to some conditions, then there are functions which apply background color and add some minor aesthetics to the views.

I have segregated the functions in the viewcontroller only for views i.e Applying colors,adding views and button touch events etc.

Only for controllers ViewDidLoad, ViewDidAppear etc

Rest i call it as model,as it does some calculations and other stuff. Calculating the constraints and constants for the view. Can anyone suggest me anyway how to incorporate the view,controller and model functions in seperate class? I don't like everything crowding up in the same viewcontroller.