天天看點

iOS小技能:iOS16新特性

引言

​​Session 網頁版:https://developer.apple.com/wwdc22/sessions​​

2022年9月蘋果釋出xcode14及iOS16,蘋果每年都要求開發者送出應用市場App的xcode版本,因為我們需要提前做好充分準備。

​​developer.apple.com/cn/ios/subm…​​

I Xcode14新特性

iOS小技能:iOS16新特性

Xcode 14 中新的編譯器和連結器已經将 ARM64 的消息發送調用從 12 位元組減少到 8 位元組,是以如果是 OC 代碼的話,使用 Xcode 14 編出來的二進制檔案可以少 2%(老系統也有效)。

​​下載下傳 Xcode 14 beta https://developer.apple.com/download/applications/​​ 7個G 。

II iOS16 新特性

2.1 真機調試

iOS 16真機調試時需要在裝置的設定 —> 隐私與安全 —> 開發者模式中打開開發者模式。

Before testing your software on your device, make sure to enable Developer Mode in Settings > Privacy & Security.
iOS小技能:iOS16新特性

Xcode14編譯的時候,第三方庫​

​QMUIResources​

​需要選擇開發團隊進行簽名。

Pods/Pods.xcodeproj error project: Signing for "QMUIKit-QMUIResources" requires a development team. Select a development team in the Signing & Capabilities editor.

2.2 元件API

  1. 月曆視圖​

    ​UICalendarView​

    ​​支援單選與多選日期,無法顯示時分秒,如需時分秒建議繼續使用​

    ​UIDatePicker​

    ​。

A view that displays a calendar with date-specific decorations, and provides for user selection of a single date or multiple dates.

​​developer.apple.com/documentati…​​

  1. 下載下傳隊列管理器:​​ BADownloadManager ​​
  2. 将 View 生成圖檔: ImageRenderer

2.3 鎖定模式(Lockdown Mode)

iOS 16 和 macOS Ventura 開始,對安全性有特殊需求的使用者可以在系統設定中啟用 Lockdown Mode 來犧牲一部分系統功能,但關閉一些潛在的攻擊面。

iOS小技能:iOS16新特性

The Lockdown Mode capability further hardens device defenses and strictly limits certain functionalities, sharply reducing the attack surface that could potentially be exploited by highly targeted mercenary spyware.

​​www.apple.com/newsroom/20…​​

啟用之後增加如下政策:

  • 短信:除圖檔外,屏蔽大部分的 iMessage 附件功能。連結預覽将被禁用
  • 浏覽器:預設禁用一些複雜的 Web 功能,例如即時編譯優化(JIT),除非使用者針對特定網站開啟
  • Apple 服務:預設屏蔽來自陌生人的邀請,包括 FaceTime,除非之前有過通話或者請求記錄
  • iPhone 鎖屏狀态下不再允許 USB 連接配接電腦或接入外部裝置(如讀卡器)
  • 配置檔案無法安裝,無法加入 MDM(移動裝置管理)

III 您不能打開應用程式“Xcode”,因為它正在更新。

3.1 問題背景

背景:通過App Store更新Xcode時,下載下傳完成還是停留在下載下傳,不安裝;安裝開始後一直進行,不能停止;于是通過官網下載下傳最新版替換舊版。

問題:您不能打開應用程式“Xcode”,因為它正在更新。

3.2 解決方案

  1. 臨時打開Xcode:終端執行​

    ​nohup /Applications/Xcode.app/Contents/MacOS/Xcode > /dev/null &​

使用nohup打開Xcode:編輯bash_profile,配置打開xcode的别名。
➜  ~ open -e .bash_profile

alias xcode='nohup /Applications/Xcode.app/Contents/MacOS/Xcode > /dev/null &'
source      
  1. 解決方式:打斷Xcode更新 (由于下載下傳app,需要Apple ID,是以我們退出Apple ID賬号即可打算更新流程),重新登入Apple ID之後重新下載下傳。
退出Apple ID之後點選App Store的全部更新按鈕,來觸發重新登入Apple ID。
iOS小技能:iOS16新特性

IV xcode檔案解鎖

4.1 問題背景

不小心将項目​

​xxx.xcworkspace ​

​​ 鎖住了之後,編輯檔案提示:​

​could not be opened because you don‘t have permission to view it​

4.2 解決方法

  1. 選擇項目工程父檔案夾,顯示詳情,解鎖,打開讀寫權限,應用到全部檔案。
  1. 重新開機終端和Xcode

see also