How to format objective-c block with clang-format?

后端 未结 2 759
野的像风
野的像风 2021-02-20 02:18

I have the following code, for example:

[cardRegistrationVC setCancelBlock:^{
  [weakSelf.navigationController popViewControllerAnimated:YES];
}];
2条回答
  •  遇见更好的自我
    2021-02-20 02:51

    Just add this to the setting file(.clang-format).

    ObjCBlockIndentWidth: 4
    

    Then the block will like this.

     [cardRegistrationVC setCancelBlock:^{
         [weakSelf.navigationController popViewControllerAnimated:YES];
     }];
    

    Hope help you.

    At the same time I would like add :

    UseTab: Never
    IndentWidth: 4
    

提交回复
热议问题