{"id":18490,"date":"2023-05-08T13:13:49","date_gmt":"2023-05-08T05:13:49","guid":{"rendered":"https:\/\/www.yimenapp.com\/kb-yimen\/?p=18490"},"modified":"2023-05-08T13:13:49","modified_gmt":"2023-05-08T05:13:49","slug":"ios%e5%85%8d%e7%ad%be%e5%b0%81%e8%a3%85%e5%90%8e%e5%8f%af%e4%bb%a5%e4%bf%ae%e6%94%b9%e9%93%be%e6%8e%a5%e5%98%9b%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/www.yimenapp.com\/kb-yimen\/18490\/","title":{"rendered":"ios\u514d\u7b7e\u5c01\u88c5\u540e\u53ef\u4ee5\u4fee\u6539\u94fe\u63a5\u561b\uff1f"},"content":{"rendered":"<p>\u5728\u672c\u6559\u7a0b\u4e2d\uff0c\u6211\u4eec\u5c06\u4f1a\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u5728 iOS \u4e0a\u5b9e\u73b0\u514d\u7b7e\u5c01\u88c5\u540e\u4fee\u6539<span class=\"wpcom_tag_link\"><a href=\"https:\/\/www.yimenapp.com\/kb-yimen\/tag\/%e9%93%be%e6%8e%a5\/\" title=\"\u94fe\u63a5\" target=\"_blank\">\u94fe\u63a5<\/a><\/span>\u3002\u5728 iOS \u5f00\u53d1\u573a\u666f\u4e2d\uff0c\u514d\u7b7e\u5c01\u88c5\u662f\u4e3a\u4e86\u8ba9 APP \u65e0\u9700\u7ecf\u8fc7\u82f9\u679c App Store \u5ba1\u6838\uff0c\u53ef\u4ee5\u76f4\u63a5\u5b89\u88c5\u5728\u7528\u6237\u7684\u8bbe\u5907\u4e0a\u3002\u901a\u5e38\uff0c\u6b64\u7c7b\u5e94\u7528\u7a0b\u5e8f\u91c7\u7528<span class=\"wpcom_tag_link\"><a href=\"https:\/\/www.yimenapp.com\/kb-yimen\/tag\/%e4%bc%81%e4%b8%9a\/\" title=\"\u4f01\u4e1a\" target=\"_blank\">\u4f01\u4e1a<\/a><\/span><span class=\"wpcom_tag_link\"><a href=\"https:\/\/www.yimenapp.com\/kb-yimen\/tag\/%e8%af%81%e4%b9%a6\/\" title=\"\u8bc1\u4e66\" target=\"_blank\">\u8bc1\u4e66<\/a><\/span>\u8fdb\u884c\u5206\u53d1\u3002\u5728\u4ee5\u4e0b\u5185\u5bb9\u4e2d\uff0c\u6211\u4eec\u5c06\u4e86\u89e3\u5230\u8fd9\u79cd\u65b9\u6cd5\u7684\u539f\u7406\u4ee5\u53ca\u5982\u4f55\u5b9e\u65bd\u3002<\/p>\n<p>#### \u514d\u7b7e\u5c01\u88c5\u539f\u7406\uff1a<\/p>\n<p>\u514d\u7b7e\u5c01\u88c5\u662f\u901a\u8fc7\u4f7f\u7528\u4f01\u4e1a\u8bc1\u4e66\uff0c\u5c06 Web \u5e94\u7528\u6216 H5 \u9875\u9762\u5c01\u88c5\u6210\u4e00\u4e2a\u72ec\u7acb\u7684 iOS APP\u3002\u7528\u6237\u53ef\u4ee5\u76f4\u63a5\u5728\u8bbe\u5907\u4e0a\u5b89\u88c5\uff0c\u5e76\u542f\u52a8 APP \u8bbf\u95ee\u5c01\u88c5\u7684\u7f51\u9875\u3002\u8fd9\u6837\u65e0\u9700\u5728\u5e94\u7528\u5546\u5e97\u7ecf\u8fc7\u5ba1\u67e5\uff0c\u53ef\u4ee5\u5b9e\u73b0\u5feb\u901f\u53d1\u5e03\u3002<\/p>\n<p>\u5728\u5c01\u88c5\u8fc7\u7a0b\u4e2d\uff0c\u4f7f\u7528 WebView \u63a7\u4ef6\u5c06\u7f51\u9875\u663e\u793a\u5728 APP \u5185\u90e8\uff0c\u8fd9\u4f7f\u5f97\u7528\u6237\u53ef\u4ee5\u50cf\u4f7f\u7528\u666e\u901a\u7684 APP \u4e00\u6837\u4f53\u9a8c\u5e94\u7528\u3002\u8fd9\u79cd\u65b9\u6cd5\u4e3b\u8981\u4f9d\u8d56\u4e8e iOS \u4e2d\u7684 UIWebView \u6216 WKWebVie<a href=\"https:\/\/iosmianqian.yimenapp.com\/webclip-1479.html\">\u514d\u8d39\u7684\u82f9\u679c\u7b7e\u540d\u8f6f\u4ef6\u54ea\u4e2a\u597d<\/a>w\uff0c\u7528\u6237\u4e0e\u7f51\u9875\u4e4b\u95f4\u7684\u4e92\u52a8\u90fd\u53d1\u751f\u5728\u8fd9\u4e2a WebView \u91cc\u3002<\/p>\n<p>#### \u4fee\u6539\u94fe\u63a5\u65b9\u6cd5\u548c\u8be6\u7ec6\u6b65\u9aa4\uff1a<\/p>\n<p>1. \u83b7\u53d6\u4f01\u4e1a\u8bc1\u4e66\uff1a\u9996\u5148\uff0c\u4f60\u9700\u8981\u62e5\u6709\u4e00\u4e2a\u4f01\u4e1a\u5f00\u53d1\u8005\u8bc1\u4e66\u3002\u53ef\u5728 Apple Developer \u7f51\u7ad9\u7533\u8bf7\uff0c<a href=\"https:\/\/iosmianqian.yimenapp.com\/webclip-714.html\">webclip\u4e0d\u53ef\u79fb\u9664\u548b\u529e<\/a>\u4ee5\u83b7\u5f97\u7528\u4e8e\u53d1\u5e03\u4f01\u4e1a\u5e94\u7528\u7684\u8bc1\u4e66\u3002<\/p>\n<p>2. \u521b\u5efa Xcode \u9879\u76ee\u53ca\u914d\u7f6e WebView\uff1a\u4f7f\u7528 Xcode \u7684\u65b0\u5efa\u9879\u76ee\u5411\u5bfc\u521b\u5efa\u4e00\u4e2a\u65b0\u7684 iOS \u9879\u76ee\uff0c\u6dfb\u52a0 `UIWebView` \u6216 `WKWebView` \u63a7\u4ef6\u81f3\u4e3b\u754c\u9762\uff08Main.storyboard\uff09\u5185\uff0c\u5e76\u8bbe\u7f6e\u76f8\u5173\u7ea6\u675f\uff0c\u4f7f\u63a7\u4ef6\u5360\u636e\u6574\u4e2a\u5c4f\u5e55\u3002<\/p>\n<p>3. \u4fee\u6539\u521d\u59cb\u94fe\u63a5\uff1a\u5728 ViewController \u7684\u4ee3\u7801\u6587\u4ef6\u4e2d\uff0c\u8bbe\u5b9a\u5305\u88c5\u7684\u7f51\u9875\u5730\u5740\uff1a\u901a\u8fc7\u4fee\u6539\u52a0\u8f7d WebView \u65f6\u4f20\u5165\u7684 URL\uff0c\u4f60\u53ef\u4ee5\u63a7\u5236 APP \u7684\u521d\u59cb\u94fe\u63a5\u3002\u4f8b\u5982\uff1a<\/p>\n<p>&#8220;`swift<\/p>\n<p>override func viewDidLoad() {<\/p>\n<p>    super.viewDidLoad()<\/p>\n<p>    \/\/ \u8bbe\u7f6e WebView<\/p>\n<p>    let webView = WKWebView(frame: self.view.bounds)<\/p>\n<p>    webView.autoresizingMask = [.flexibleWidth, .flexibleHeight]<\/p>\n<p>    self.view.addSubview(webView)<\/p>\n<p>    \/\/ \u4fee\u6539\u94fe\u63a5<\/p>\n<p>    let url = URL(string: &#8220;https:\/\/\u4f60\u7684\u7f51\u5740.com&#8221;)<\/p>\n<p>    let request = URLRequest(url: url!)<\/p>\n<p>    webView.load(request)<\/p>\n<p>}<\/p>\n<p>&#8220;`<\/p>\n<p>4. \u5f52\u6863\u53ca\u53d1\u5e03\uff1a\u5c06 APP \u6253\u5305\u6210 .ipa \u6587\u4ef6\u3002\u5728 Xcode \u4e2d\u7684\u751f\u6210\u83dc\u5355\u4e2d\u9009\u62e9\u5f52\u6863\uff08Archive\uff09\u9009\u9879\uff0c\u751f\u6210\u5f52\u6863\u6587\u4ef6\u3002\u7136\u540e\u7b7e\u540d\u5bfc\u51fa.ipa\u6587\u4ef6\u3002\u901a\u8fc7\u4f01\u4e1a\u5e94\u7528\u5206\u53d1\u83b7\u53d6\u4e0b\u8f7d\u5b89\u88c5\u94fe\u63a5\u3002<\/p>\n<p>\u73b0\u5728\uff0c\u4f60\u5df2\u7ecf\u6210\u529f\u5b8c\u6210\u4e86\u514d\u7b7e\u5c01\u88c5\u5e76\u76f4\u63a5\u5bf9\u5176\u8fdb\u884c\u4e86\u94fe\u63a5\u4fee\u6539\u3002\u53ef\u4ee5\u6309\u9700\u4fee\u6539\u94fe\u63a5\uff0c\u5e76\u91cd\u65b0\u751f\u6210\u5b89\u88c5\u5305\uff0c\u5b9e\u73b0\u5728 iOS \u8bbe\u5907\u4e2d\u65e0\u9700\u7ecf\u8fc7 App Store \u5ba1\u6838\u7684\u5e94\u7528\u53d1\u5e03\u3002\u6ce8\u610f\uff0c\u8fd9\u79cd\u65b9\u6cd5\u4e3b\u8981\u9002\u7528\u4e8e\u4f01\u4e1a\u5185\u90e8\u5e94\u7528\uff0c\u7531\u4e8e\u4e0d\u53d7 App Store \u5ba1\u6838\u548c\u9650\u5236\uff0c\u53ef\u80fd\u4e0d\u80fd\u8fbe\u5230\u6807\u51c6\u5e94\u7528\u7684\u529f\u80fd\u548c\u5b89\u5168\u6027\u8981\u6c42\u3002\u6240\u4ee5\u5728\u6b63\u5f0f\u5e94\u7528\u4e2d\uff0c\u4f9d\u7136\u5efa\u8bae\u901a\u8fc7 App Store \u8fdb\u884c\u5206\u53d1\u3002<\/p>\n<p><figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/i.cdn.yimenapp.com\/2023-03\/30\/17\/35721535319.jpg\" \/><\/figure><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u672c\u6559\u7a0b\u4e2d\uff0c\u6211\u4eec\u5c06\u4f1a\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u5728 iOS \u4e0a\u5b9e\u73b0\u514d\u7b7e\u5c01\u88c5\u540e\u4fee\u6539\u94fe\u63a5\u3002\u5728 iOS \u5f00\u53d1\u573a\u666f\u4e2d\uff0c\u514d\u7b7e\u5c01\u88c5\u662f\u4e3a\u4e86\u8ba9 APP \u65e0\u9700\u7ecf\u8fc7\u82f9\u679c App Store \u5ba1\u6838\uff0c\u53ef\u4ee5\u76f4\u63a5\u5b89\u88c5\u5728\u7528\u6237\u7684\u8bbe\u5907\u4e0a\u3002\u901a\u5e38\uff0c\u6b64\u7c7b<\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8654],"tags":[11236,1887,11235,3560,3295],"special":[],"attr":[],"class_list":["post-18490","post","type-post","status-publish","format-standard","hentry","category-pingguomianqian","tag-11236","tag-1887","tag-app","tag-3560","tag-3295","entry"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/posts\/18490","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/comments?post=18490"}],"version-history":[{"count":0,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/posts\/18490\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/media?parent=18490"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/categories?post=18490"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/tags?post=18490"},{"taxonomy":"special","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/special?post=18490"},{"taxonomy":"attr","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/attr?post=18490"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}