{"id":31385,"date":"2024-03-01T15:41:33","date_gmt":"2024-03-01T07:41:33","guid":{"rendered":"https:\/\/app.applebyme.cn\/cloud\/?p=31385"},"modified":"2024-03-01T15:41:33","modified_gmt":"2024-03-01T07:41:33","slug":"%e7%bd%91%e7%ab%99%e5%b0%81%e8%a3%85%e8%8b%b9%e6%9e%9capp%e5%a6%82%e4%bd%95%e5%81%9a%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/app.applebyme.cn\/cloud\/appkaifa\/31385.html","title":{"rendered":"\u7f51\u7ad9\u5c01\u88c5\u82f9\u679capp\u5982\u4f55\u505a\uff1f"},"content":{"rendered":"<p>\u5728\u79fb\u52a8\u4e92\u8054\u7f51\u65f6\u4ee3\uff0c\u5e94\u7528\u7684\u5f00\u53d1\u548c\u53d1\u5e03\u5df2\u7ecf\u6210<a href=\"https:\/\/appfengzhuang.yimenapp.com\/app-408.html\">python\u5c01\u88c5app<\/a>\u4e3a\u4e92\u8054\u7f51\u751f\u6001\u4e2d\u4e0d\u53ef\u6216\u7f3a\u7684\u4e00\u90e8\u5206\u3002\u968f\u7740Web\u6280\u672f\u7684\u98de\u901f\u8fdb\u6b65\uff0c\u8bb8\u591a\u7f51\u7ad9\u5f00\u59cb\u8f6c\u578b\u4e3a\u79fb\u52a8\u5e94\u7528\u3002\u5c24\u5176\u662f\u9488\u5bf9\u82f9\u679c\u8bbe\u5907\uff0c\u8bb8\u591a\u7f51\u7ad9\u5f00\u53d1\u8005\u5e0c\u671b\u5c06\u81ea\u5df1\u7684\u7f51\u7ad9\u5c01\u88c5\u6210\u4e3a\u4e00\u4e2a\u72ec\u7acb\u7684iOS\u5e94\u7528\uff0c\u4fbf\u4e8e\u7528\u6237\u5728iPhone\u548ciPad\u4e0a\u8fdb\u884c\u4f53\u9a8c\u3002\u5728\u8fd9\u7bc7\u6587\u7ae0\u4e2d\uff0c\u6211\u4eec\u5c06\u63a2\u8ba8\u7f51\u7ad9\u5c01\u88c5\u6210\u82f9\u679c\u5e94\u7528\u7684\u539f\u7406\u4ee5\u53ca\u8be6\u7ec6\u4ecb\u7ecd\u5c01\u88c5\u8fc7\u7a0b\u3002<\/p>\n<p>**\u7f51\u7ad9\u5c01\u88c5\u82f9\u679c\u5e94\u7528\u7684\u539f\u7406**<\/p>\n<p>\u5c01\u88c5\u7f51\u7ad9\u4e3a\u82f9\u679c\u5e94\u7528\u7684\u57fa\u672c\u539f\u7406\u662f\u5c06\u73b0\u6709\u7684\u7f51\u9875\u5e94\u7528\uff08Web App\uff09\u901a\u8fc7iOS\u5f00\u53d1\u5de5\u5177\uff0c\u5982Xcode\u8fdb\u884c\u5c01\u88c5\uff0c\u751f\u6210\u4e00\u4e2aiOS\u5e94\u7528\u3002\u8fd9\u4e2a\u5e94\u7528\u4e3b\u8981\u662f\u4e00\u4e2aUIWebView\u6216\u8005WKWebView\u7684\u5bb9\u5668\uff0c\u901a\u8fc7\u8bbf\u95ee\u7279\u5b9a\u7684\u7f51\u5740\uff0c\u5c06\u7f51\u9875\u5185\u5bb9\u5c55\u73b0\u5728\u8fd9\u4e2a\u5bb9\u5668\u4e2d\uff0c\u5e76\u63d0\u4f9b\u539f\u751f\u5e94\u7528\u7684\u4ea4\u4e92\u548c\u64cd\u4f5c\u65b9\u5f0f\u3002\u4e0e\u5728\u6d4f\u89c8\u5668\u4e2d\u8bbf\u95ee\u7f51\u7ad9\u76f8\u6bd4\uff0c\u5c01\u88c5\u540e\u7684\u82f9\u679c\u5e94\u7528\u5177\u6709\u4e00\u5b9a\u7684\u539f\u751f\u5e94\u7528\u4f53\u9a8c\uff0c\u5982\u66f4\u597d\u5730\u6c89\u6d78\u5f0f\u4f53\u9a8c\uff0c\u79bb\u7ebf\u6d4f\u89c8\u7b49\u3002<\/p>\n<p>**\u5c01\u88c5\u7f51\u7ad9\u4e3a\u82f9\u679c\u5e94\u7528\u7684\u8be6\u7ec6\u6b65\u9aa4**<\/p>\n<p>1. \u51c6\u5907\u5de5\u4f5c<\/p>\n<p>   \u5728\u5f00\u59cb\u5c01\u88c5\u7f51\u7ad9\u4e3a\u82f9\u679c\u5e94\u7528\u4e4b\u524d\uff0c\u9996\u5148\u8981\u786e\u4fdd\u62e5\u6709Apple Developer\u8d26<\/p>\n<p><figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/i.yimenyun.net\/2023-04\/07\/10\/26033893664.jpg\" \/><\/figure>\n<\/p>\n<p>\u53f7\uff0c\u4ee5\u4fbf\u5f00\u53d1\u8005\u80fd\u591f\u5728App Store\u53d1\u5e03\u5e94\u7528\u3002\u7136\u540e\u9700\u8981\u5b89\u88c5Xcode\u5f00\u53d1\u73af\u5883\uff0c\u4ee5\u4fbf\u8fdb\u884ciOS\u5e94\u7528\u7684\u521b\u5efa\u548c\u914d\u7f6e\u3002<\/p>\n<p>2. \u521b\u5efa\u4e00\u4e2a\u65b0\u7684iOS\u9879\u76ee<\/p>\n<p>   \u542f\u52a8Xcode\uff0c\u5e76\u9009\u62e9\u521b\u5efa\u4e00\u4e2a\u65b0\u7684iOS\u9879\u76ee\u3002\u9009\u62e9\u201cSingle View Application\u201d\uff0c\u5e76\u8bbe\u7f6e\u9879\u76ee\u7684\u540d\u79f0\u3001\u7ec4\u7ec7\u6807\u8bc6\u7b26\u3001\u5f00\u53d1\u8bed\u8a00\uff08Swift\u6216Objective-C\uff09\u7b49\u4fe1\u606f\u3002<\/p>\n<p>3. \u5728\u9879\u76ee\u4e2d\u5f15\u5165UIWebView\u6216WKWebView<\/p>\n<p>   \u5728\u521b\u5efa\u7684\u9879\u76ee\u4e2d\uff0c\u627e\u5230\u4e3b\u754c\u9762\u7684`ViewController`\uff0c\u5c06UIWebView\u6216WKWebView\u7ec4\u4ef6\u62d6\u62fd\u5230\u89c6\u56fe\u4e2d\u3002\u6ce8\u610f\u8fd9\u91cc\u63a8\u8350\u4f7f\u7528WKWebView\uff0c\u56e0\u4e3a\u5b83\u5177\u6709\u66f4\u9ad8\u7684\u6027\u80fd\u548c\u5bf9\u6700\u65b0Web\u6280\u672f\u7684\u652f\u6301\u3002<\/p>\n<p>4. \u52a0\u8f7d\u7f51\u9875\u5185\u5bb9<\/p>\n<p>   \u5728`ViewController`\u7684`viewDidLoad`\u65b9\u6cd5\u4e2d\uff0c\u901a\u8fc7\u5bfc\u5165`WebKi<a href=\"https:\/\/appfengzhuang.yimenapp.com\/app-141.html\">\u5c01\u88c5app\u5e26\u626b<\/a>t`\u5e93\u5e76\u521b\u5efa\u4e00\u4e2a`URLRequest`\u5bf9\u8c61\uff0c\u8bbe\u7f6e\u9700\u8981\u8bbf\u95ee\u7684\u7f51\u5740\u3002\u7136\u540e\u4f7f\u7528`loadRequest`\u65b9\u6cd5\u6765\u52a0\u8f7dURLRequest\u5bf9\u8c61\u6240\u6307\u5b9a\u7684\u7f51\u5740\u5185\u5bb9\u3002\u4f8b\u5982\uff1a<\/p>\n<p>   &#8220;`swift<\/p>\n<p>   import WebKit<\/p>\n<\/p>\n<p>   class ViewController: UIViewController, WKUIDelegate {<\/p>\n<p>       var webView: WKWebView!<\/p>\n<\/p>\n<p>       override func viewDidLoad() {<\/p>\n<p>           super.viewDidLoad()<\/p>\n<\/p>\n<p>           let webConfiguration = WKWebViewConfiguration()<\/p>\n<p>           webView = WKWebView(frame: .zero, configuration: webConfiguration)<\/p>\n<p>           webView.uiDelegate = self<\/p>\n<p>           view = webView<\/p>\n<\/p>\n<p>           let myURL = URL(string:&#8221;https:\/\/www.example.com&#8221;)<\/p>\n<p>           let myRequest = URLRequest(url: myURL!)<\/p>\n<p>           webView.load(myRequest)<\/p>\n<p>       }<\/p>\n<p>   }<\/p>\n<p>   &#8220;`<\/p>\n<p>   \u4ee5\u4e0a\u4ee3\u7801\u793a\u4f8b\u5c55\u793a\u4e86\u5728Swift\u4e2d\u4f7f\u7528WKWebView\u52a0\u8f7d\u7f51\u9875\u5185\u5bb9\u7684\u8fc7\u7a0b\u3002<\/p>\n<p>5. \u914d\u7f6eApp\u56fe\u6807\u548c\u542f\u52a8\u753b\u9762<\/p>\n<p>   \u4e3a\u4e86\u8ba9\u5c01\u88c5\u540e\u7684\u5e94\u7528\u770b\u8d77\u6765\u66f4\u50cf\u4e00\u4e2a\u539f\u751f\u5e94\u7528\uff0c\u53ef\u4ee5\u4e3a\u5e94\u7528\u914d\u7f6e\u4e00\u4e2aApp\u56fe\u6807\u548c\u4e00\u4e2a\u542f\u52a8\u753b\u9762\u3002\u5728\u9879\u76ee\u4e2d\u7684`Assets.xcassets`\u6587\u4ef6\u5939\u4e0b\uff0c\u4e3a\u5e94\u7528\u56fe\u6807\u6dfb\u52a0\u6240\u9700\u7684\u4e0d\u540c\u5c3a\u5bf8\u7684\u56fe\u7247\u3002\u540c\u6837\uff0c\u4e5f\u53ef\u4ee5\u4e3a\u542f\u52a8\u753b\u9762\u521b\u5efa\u4e00\u4e2a\u65b0\u7684`LaunchScreen.storyboard`\uff0c\u5e76\u5728\u5176\u4e2d\u8bbe\u8ba1\u4e00\u4e2a\u5f15\u4eba\u6ce8\u76ee\u7684\u542f\u52a8\u753b\u9762\u3002<\/p>\n<p>6. \u4fee\u6539\u5e94\u7528\u6743\u9650\u548c\u8bbe\u5907\u652f\u6301<\/p>\n<p>   \u5728\u9879\u76ee\u7684\u8bbe\u7f6e\uff08`Info.plist`\uff09\u4e2d\uff0c\u6839\u636e\u5b9e\u9645\u9700\u6c42\u4fee\u6539\u5e94\u7528\u6743\u9650\uff0c\u4f8b\u5982\u76f8\u673a\u3001\u9ea6\u514b\u98ce\u7b49\u3002\u540c\u65f6\uff0c\u53ef\u4ee5\u5728\u201cGeneral\u201d\u9009\u9879\u5361\u4e2d\u8bbe\u7f6e\u652f\u6301\u7684\u8bbe\u5907\u65b9\u5411\u4ee5\u53ca\u8981\u652f\u6301\u7684\u8bbe\u5907\u7c7b\u578b\uff08iPhone\u3001iPad\u6216Universal\uff09\u3002<\/p>\n<p>7. \u6d4b\u8bd5\u548c\u53d1\u5e03\u5e94\u7528<\/p>\n<p>   \u5728\u5b8c\u6210\u4ee5\u4e0a\u8bbe\u7f6e\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528Xcode\u6765\u7f16\u8bd1\u548c\u8fd0\u884c\u5e94\u7528\uff0c\u9a8c\u8bc1\u5e94\u7528\u7684\u529f\u80fd\u548c\u8868\u73b0\u3002\u4e3a\u4e86\u786e\u4fdd\u5e94\u7528\u5728\u4e0d\u540c\u8bbe\u5907\u548c\u7cfb\u7edf\u4e0a\u7684\u517c\u5bb9\u6027\u548c\u6027\u80fd\uff0c\u5efa\u8bae\u901a\u8fc7TestFlight\u8fdb\u884c\u6d4b\u8bd5\u3002<\/p>\n<p>   \u5f53\u5e94\u7528\u8fbe\u5230\u9884\u671f\u7684\u4f53\u9a8c\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7Xcode\u5c06\u5e94\u7528\u63d0\u4ea4\u81f3App Store\u5ba1\u6838\uff0c\u7b49\u5f85Apple\u5ba1\u6838\u901a\u8fc7\u540e\uff0c\u5e94\u7528\u5373\u53ef\u4e0a\u67b6\u3002<\/p>\n<p>\u603b\u7ed3\u8d77\u6765\uff0c\u5c01\u88c5\u7f51\u7ad9\u4e3a\u82f9\u679c\u5e94\u7528\u7684\u8fc7\u7a0b\u4e3b\u8981\u5305\u62ec\u521b\u5efaiOS\u9879\u76ee\uff0c\u5f15\u5165WebView\u7ec4\u4ef6\uff0c\u52a0\u8f7d\u7f51\u9875\u5185\u5bb9\uff0c\u914d\u7f6e\u5e94\u7528\u56fe\u6807\u548c\u542f\u52a8\u753b\u9762\u7b49\u6b65\u9aa4\u3002\u867d\u7136\u5b9e\u73b0\u539f\u7406\u7b80\u5355\uff0c\u4f46\u5c01\u88c5\u540e\u7684\u5e94\u7528\u4f9d\u7136\u53ef\u4ee5\u4e3a\u7528\u6237\u63d0\u4f9b\u66f4\u597d\u7684\u79fb\u52a8\u4f53\u9a8c\u3002\u5728\u5b9e\u9645\u64cd\u4f5c\u4e2d\uff0c\u8fd8\u9700\u8981\u8003\u8651\u7f51\u7ad9\u7684\u9002\u914d\u6027\u3001\u79bb\u7ebf\u8bbf\u95ee\u3001\u539f\u751f\u7279\u6027\u7b49\u65b9\u9762\u7684\u9700\u6c42\uff0c\u4ee5\u4fbf\u4e3a\u7528\u6237\u63d0\u4f9b\u6700\u4f73\u7684\u5e94\u7528\u4f53\u9a8c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u79fb\u52a8\u4e92\u8054\u7f51\u65f6\u4ee3\uff0c\u5e94\u7528\u7684\u5f00\u53d1\u548c\u53d1\u5e03\u5df2\u7ecf\u6210\u4e3a\u4e92\u8054\u7f51\u751f\u6001\u4e2d\u4e0d\u53ef\u6216\u7f3a\u7684\u4e00\u90e8\u5206\u3002\u968f\u7740Web\u6280\u672f\u7684\u98de\u901f\u8fdb\u6b65\uff0c\u8bb8\u591a\u7f51\u7ad9\u5f00\u59cb\u8f6c\u578b\u4e3a\u79fb\u52a8\u5e94\u7528\u3002\u5c24\u5176\u662f\u9488\u5bf9\u82f9\u679c\u8bbe\u5907\uff0c\u8bb8\u591a\u7f51\u7ad9\u5f00\u53d1\u8005\u5e0c\u671b\u5c06\u81ea\u5df1\u7684\u7f51\u7ad9\u5c01\u88c5\u6210\u4e3a\u4e00\u4e2a\u72ec\u7acb\u7684iO<\/p>\n","protected":false},"author":17,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[6768,83,16311,379,1220],"class_list":["post-31385","post","type-post","status-publish","format-standard","hentry","category-appkaifa","tag-6768","tag-83","tag-app","tag-379","tag-1220"],"_links":{"self":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/posts\/31385","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/comments?post=31385"}],"version-history":[{"count":1,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/posts\/31385\/revisions"}],"predecessor-version":[{"id":31461,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/posts\/31385\/revisions\/31461"}],"wp:attachment":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/media?parent=31385"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/categories?post=31385"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/tags?post=31385"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}