<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                ## 空格 - 縮進使用 4 個空格。 永遠不要使用 tab, 確保你在 Xcode 的設置里面是這樣設置的。 - 方法的大括號和其他的大括號(`if`/`else`/`switch`/`while` 等) 總是在同一行開始,在新起一行結束。 **推薦:** ~~~ if (user.isHappy) { //Do something } else { //Do something else } ~~~ **不推薦:** ~~~ if (user.isHappy) { //Do something } else { //Do something else } ~~~ * 方法之間應該要有一個空行來幫助代碼看起來清晰且有組織。 方法內的空格應該用來分離功能,但是通常不同的功能應該用新的方法來定義。優先使用 auto-synthesis。但是如果必要的話, `@synthesize` and `@dynamic` - 在實現文件中的聲明應該新起一行。 - 應該總是讓冒號對其。有一些方法簽名可能超過三個冒號,用冒號對齊可以讓代碼更具有可讀性。總是用冒號對其方法,即使有代碼塊存在。 【疑問】 **推薦:** ~~~ [UIView animateWithDuration:1.0 animations:^{ // something } completion:^(BOOL finished) { // something }]; ~~~ **不推薦:** ~~~ [UIView animateWithDuration:1.0 animations:^{ // something } completion:^(BOOL finished) { // something }]; ~~~ 如果自動對齊讓可讀性變得糟糕,那么應該在之前把 block 定義為變量,或者重新考慮你的代碼簽名設計。 ## Line Breaks 換行 本指南關注代碼顯示效果以及在線瀏覽的可讀性,所以換行是一個重要的主題。 舉個例子: ~~~ self.productsRequest = [[SKProductsRequest alloc] initWithProductIdentifiers:productIdentifiers]; ~~~ 一個像上面的長行的代碼在第二行以一個間隔(2個空格)延續 ~~~ self.productsRequest = [[SKProductsRequest alloc] initWithProductIdentifiers:productIdentifiers]; ~~~ ## 括號 在以下的地方使用 [Egyptian風格 括號](https://en.wikipedia.org/wiki/Indent_style#K.26R_style) (譯者注:又稱 K&R 風格,代碼段括號的開始位于一行的末尾,而不是另外起一行的風格。關于為什么叫做 Egyptian Brackets,可以參考 [http://blog.codinghorror.com/new-programming-jargon/](http://blog.codinghorror.com/new-programming-jargon/) ) - 控制語句 (if-else, for, switch) 非 Egyptian 括號可以用在: - 類的實現(如果存在) - 方法的實現
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看