{"rsdb":{"rid":"397143","subhead":"","postdate":"0","aid":"273432","fid":"89","uid":"1","topic":"1","content":"
\n 1\u3001UIScrollView<\/strong>\n
\u589e\u52a0\u4e86\u5c5e\u6027\n allowsKeyboardScrolling<\/code>\u8868\u793a\u662f\u5426\u6839\u636e\u8fde\u63a5\u7684\u7269\u7406\u952e\u76d8\u7684\u65b9\u5411\u952e\u800c\u6eda\u52a8\u3002 \n
\n
import UIKit\n\n<\/span>class<\/span> ViewController: UIViewController {\n    lazy var scrollView: UIScrollView <\/span>= {\n        let scrollView <\/span>= UIScrollView(frame: CGRect(x: 0<\/span>,\n                                                    y: <\/span>0<\/span>,\n                                                    width: UIScreen.main.bounds.width,\n                                                    height: UIScreen.main.bounds.width))\n        let imageView <\/span>= UIImageView(image: UIImage(named: "<\/span>img<\/span>"<\/span>))\n        scrollView.addSubview(imageView)\n        scrollView.contentSize <\/span>= imageView.bounds.size\n        <\/span>\/\/<\/span> iOS17\u65b0\u589e\uff0c\u9ed8\u8ba4\u4e3atrue<\/span>\n        scrollView.isScrollEnabled = false<\/span>\n        return<\/span> scrollView\n    }()\n\n    <\/span>override<\/span> func viewDidLoad() {\n        super.viewDidLoad()\n\n        view.addSubview(scrollView)\n    }\n}<\/span><\/pre> \n <\/div> \n 

2\u3001applicationIconBadgeNumber<\/strong>
UIApplication \u7684applicationIconBadgeNumber<\/code>\u5c5e\u6027\u88ab\u5e9f\u5f03\uff0c\u5efa\u8bae\u4f7f\u7528UNUserNotificationCenter.current().setBadgeCount()<\/code>\u65b9\u6cd5\u3002<\/p> \n

\n
import UIKit\nimport UserNotifications\n\n<\/span>class<\/span> ViewController: UIViewController {\n    <\/span>override<\/span> func viewDidLoad() {\n        super.viewDidLoad()\n    }\n\n    <\/span>override<\/span> func touchesBegan(_ touches: Set<UITouch>, with event<\/span>: UIEvent?) {\n        <\/span>\/\/<\/span> iOS17\u4e4b\u540e\u8bbe\u7f6e\u89d2\u6807\uff0c\u9700\u8981\u5148\u6388\u6743\n        <\/span>\/\/<\/span> UNUserNotificationCenter.current().setBadgeCount(10)<\/span>\n        UNUserNotificationCenter.current().setBadgeCount(10<\/span>) { error in<\/span>\n            if<\/span> let error {\n                print(error)\n            }\n        }\n    }\n}<\/span><\/pre> \n <\/div> \n 

3\u3001UIDocumentViewController<\/strong>
\u65b0\u589e\u89c6\u56fe\u63a7\u5236\u5668\uff0c\u7528\u4e8e\u663e\u793a\u4e0e\u7ba1\u7406\u672c\u5730\u6216\u8005\u4e91\u7aef\u6587\u6863\u3002<\/p> \n

\n
import UIKit\n\n<\/span>class<\/span> ViewController: UIViewController {\n    <\/span>override<\/span> func viewDidLoad() {\n        super.viewDidLoad()\n    }\n\n    <\/span>override<\/span> func touchesBegan(_ touches: Set<UITouch>, with event<\/span>: UIEvent?) {\n        let documentViewController <\/span>= UIDocumentViewController()\n        documentViewController.openDocument { _ <\/span>in<\/span>\n            print(<\/span>"<\/span>\u6253\u5f00\u6587\u6863<\/span>"<\/span>)\n        }\n        present(documentViewController, animated: <\/span>true<\/span>)\n    }\n}<\/span><\/pre> \n <\/div> \n 

4\u3001UIHoverStyle<\/strong>
UIView \u589e\u52a0\u4e86\u4e00\u4e2ahoverStyle<\/code>\u5c5e\u6027\uff0c\u53ef\u4ee5\u8bbe\u7f6e\u9f20\u6807\u79fb\u52a8\u5230 UIView \u4e4b\u4e0a\u7684\u6548\u679c\u3002<\/p> \n

\n
import UIKit\n\n<\/span>class<\/span> ViewController: UIViewController {\n    lazy var redView: UIView <\/span>= {\n        let view <\/span>= UIView(frame: CGRect(x: 200<\/span>, y: 200<\/span>, width: 200<\/span>, height: 200<\/span>))\n        view.backgroundColor <\/span>= .red\n        <\/span>\/\/<\/span> iOS17\u65b0\u589eUIHoverStyle\uff0c\u53ef\u4ee5\u8bbe\u7f6eHover\u7684\u6548\u679c\u4e0e\u5f62\u72b6\uff08UIShape\uff09<\/span>\n        let hoverStyle = UIHoverStyle(effect: .lift, shape: .capsule)\n        <\/span>\/\/<\/span> iOS17\u65b0\u589e\uff0c\u9f20\u6807\u79fb\u52a8\u5230UIView\u4e4b\u4e0a\u7684\u6548\u679c<\/span>\n        view.hoverStyle = hoverStyle\n        <\/span>return<\/span> view\n    }()\n\n    <\/span>override<\/span> func viewDidLoad() {\n        super.viewDidLoad()\n\n        view.addSubview(redView)\n    }\n}<\/span><\/pre> \n <\/div> \n 

5\u3001\u7f16\u8bd1\u62a5\u9519cfstring constant not pointer aligned<\/code><\/span><\/p> \n

\n
\u89e3\u51b3\u529e\u6cd5\uff1aBuild Settings<\/span> -> Other Linker Flags<\/span> \u52a0\u5165-ld64<\/span><\/pre> \n <\/div> \n 

6\u3001\u7f16\u8bd1\u62a5\u9519Sandbox\uff1arsync.sanba deny(1) file-write-create xxx<\/code><\/span><\/p> \n

\n
\u4f7f\u7528 Xcode15<\/span> \u65b0\u5efa\u9879\u76ee\u540e\uff0cpod \u5f15\u5165\u90e8\u5206\u7b2c\u4e09\u65b9\u4f1a\u62a5\u4e0a\u9762\u7684\u9519\u8bef\n\u89e3\u51b3\u529e\u6cd5\uff1aBuild Settings<\/span> \u641c\u7d22 sandbox<\/span>\uff0c\u628a Build Options<\/span> \u4e2d\u7684 User Script Sandboxing<\/span>\u6539\u4e3a NO<\/span><\/span><\/pre> \n <\/div> \n 

7\u3001\u7f16\u8bd1\u62a5\u9519UIGraphicsBeginImageContextWithOptions<\/span>\u5d29\u6e83<\/code><\/p> \n

\u53c2\u8003\u94fe\u63a5\uff1aUIGraphicsBeginImageContext Deprecated<\/a><\/p> \n