markdown 评论。第2.md部分

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 评论。第2.md部分相关的知识,希望对你有一定的参考价值。

# Recommendations. Part 2

### Code Style

#### CustomLoader

Alghough the next methods do the same thing: setting rootViewController, their naming is non-consistent:  
* configureSomething()
* configureForSomething()
* loadSomething()
* showSomething()

#### StartViewController

The methods such as startSocialFlow() should be `private`  
Controversial: `//MARK: - IVARS` notations (in capitals) looks bad.

### Architecture

_Let's review from the beginning of the app's life cycle._

#### AuthCredentials
This UI property shouldn't be here:  `var flowType: AuthFlowType = .signUp`

#### SplashScreenViewController

Current responsibilities:

1. checks the saved user credentials
2. calls sign in network request
3. saves user and session objects
4. presents main or auth screens

The non-UI actions should be put into an appropriate view model. So we have a better separation of concerns.

#### StartViewController

The view controller:

1. initializes UI (buttons, labels)
2. keeps the state of the view
3. sends network request to sign in
4. saves user, session, credential objects
5. opens the next screen

Wouldn't it be better to split so many responsibilities between the <view> and a <view model>? There should be bindings set between them.  
So,

1. `view` initializes UI (buttons, labels)
2. `view model` keeps the state of the view
3. `view model` sends network request to sign in
4. `view model` saves user, session, credential objects
5. `view model` opens the next screen


#### MainTabBarViewController

When you sign out the whole view hierarchy remains in the memory until you sign in again.  
The child view controllers keep observing events and notifications which may lead to problems in future.

#### PlaybookViewController

What is the purpose of recreating UI elements on the navigation item from the `viewWillAppear:`?  
Other tab view controllers do the same.  
These days even Phone 6 with iOS11 may respond not smoothly.

### Performance
The `collection.filter().first` is used throughout the app. Its algorithm has higher time complexity than the `collection.index()`.

以上是关于markdown 评论。第2.md部分的主要内容,如果未能解决你的问题,请参考以下文章

markdown 如何删除包含部分单词的WordPress评论?

markdown objective_2.MD

markdown python-2.md

MD文件如何打开

md文件怎么打开

.md文件怎么打开