Refactoring to MVP and Introduction to Test-Driven Development
1. Completing the Refactoring to MVP
1.1 Moving Remaining Methods to the Presenter
We’ve shifted various helper methods from the view controller to the presenter. The remaining IBAction methods are cancel() and changePassword() .
For the cancel() method:
1. Select the two lines in the view controller and use Xcode’s “Extract to Method” command. Temporarily name it zz_cancel() as we can’t use cancel() yet while it coexists with the IBAction .
2. Run tests.
3. Move the function to the presenter using the “Move Function” option. Name it cancel() in
超级会员免费看
订阅专栏 解锁全文
473

被折叠的 条评论
为什么被折叠?



