iOS11 添加的部分特性(轉(zhuǎn)貼) + Xcode9 無線調(diào)試

1.相冊權(quán)限需要增加,不然會造成閃退喲
增加info.Plist中的字段:
之前的這個字段:Privacy - Photo Library Usage Description
需要增加這個字段Privacy - Photo Library Additions Usage Description,內(nèi)容和上面字段保持一致即可。
2.UITableViewStyleGrouped樣式的UITableViewsectionHeadersectionFooter有一個默認(rèn)的高度,通常不需要顯示header或者footer的時候,會這么寫

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
  return CGFLOAT_MIN;
}
 
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
  return CGFLOAT_MIN;
}

但是在iOS11里面你會發(fā)現(xiàn)段頭段尾又回來辣!改了各種新增的屬性比如safeArea之類的一點用都沒有,最后發(fā)現(xiàn)必須要把estimatedSectionHeaderHeight置0才變回去
3.在iOS11中,蘋果開放了NFC(Near field communication),怕也是其推廣ApplePay的一種策略。
在使用近場通訊時,首先也要在info.plist配置NFCReaderUsageDescription權(quán)限,案例步驟,如下:
iOS 11 Core NFC - any sample code?
4.如果您在Navigation上的titleView上添加searchBar,iOS11情況下可能有問題

- (void)resetSearchBar
{
  CGFloat leftButtonWidth = 35, rightButtonWidth = 75; // left padding right padding
  UIView *container = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width - leftButtonWidth - rightButtonWidth, 44)];
 
  self.searchBar.translatesAutoresizingMaskIntoConstraints = NO;
  [container addSubview:self.searchBar];
 
  CGFloat offset = (rightButtonWidth - leftButtonWidth) / 2;
  // 給searchBar添加約束
  [NSLayoutConstraint activateConstraints:@[
                       [self.searchBar.topAnchor constraintEqualToAnchor:container.topAnchor], // 頂部約束
                       [self.searchBar.leftAnchor constraintEqualToAnchor:container.leftAnchor constant:-25*ScreenScaleX], // 左邊距約束
                       [self.searchBar.rightAnchor constraintEqualToAnchor:container.rightAnchor constant:0], // 右邊距約束
                       [self.searchBar.bottomAnchor constraintEqualToAnchor:container.bottomAnchor], // 底部約束
                       [self.searchBar.centerXAnchor constraintEqualToAnchor:container.centerXAnchor constant:-offset], // 橫向中心約束
                       //                       [self.searchBar.widthAnchor constraintEqualToAnchor:container.widthAnchor constant:width] // 寬度約束
                       ]];
  self.navigationItem.titleView = container; // 頂部導(dǎo)航搜索
}
Xcode9 無線調(diào)試
  • 軟硬件要求:
  - Xcode 9.0 beat 及以上版本
  - macOS 10.12.5 及以上版本
  - iOS 11.0 beat 及以上版本
  • 連接要求
電腦和設(shè)備處于同一 Wifi 環(huán)境

雖然Xcode支持無線調(diào)試, 但讓你的設(shè)備支持無線調(diào)試之前, 必須連接上數(shù)據(jù)線, 做好相應(yīng)配置

 1.  通過數(shù)據(jù)線將您的設(shè)備,連接至Xcode.
 2.  打開菜單欄 `Window > Devices and Simulators`, 然后在打開的菜單中 `選擇 Devices選項`.或者直接按command+shift+2
 3.  按下圖點選

隨后你的設(shè)備右側(cè)會出現(xiàn)一個球狀標(biāo)識, 到此你就可以拔掉數(shù)據(jù)線, 開始無效調(diào)試咯

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容