簡體   English   中英

iOS,如何在Apple Watch上緩存文件

[英]iOS, how to cache file on Apple Watch

我在手機上生成圖像並將其發送到Apple Watch。

func session(_ session: WCSession, didReceive file: WCSessionFile) {
    let img = UIImage(contentsOfFile: file.fileURL.path)
    self.image.setImage(img)
}

我很少需要重新生成此圖像。 如何將其緩存在Apple Watch上? NSFileManager在手表上可用嗎?

是的,NSFileManager可用。 在大多數情況下,WatchKit應用程序的工作方式類似於iOS。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM