{"id":14349,"date":"2023-09-08T15:43:25","date_gmt":"2023-09-08T07:43:25","guid":{"rendered":"https:\/\/app.applebyme.cn\/cloud\/?p=14349"},"modified":"2023-09-08T15:43:25","modified_gmt":"2023-09-08T07:43:25","slug":"%e4%b8%80%e6%ac%be%e8%8b%b9%e6%9e%9c%e7%bd%91%e7%ab%99%e6%94%b9app%e8%a6%81%e6%80%8e%e4%b9%88%e6%93%8d%e4%bd%9c%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/app.applebyme.cn\/cloud\/appkaifa\/14349.html","title":{"rendered":"\u4e00\u6b3e\u82f9\u679c\u7f51\u7ad9\u6539app\u8981\u600e\u4e48\u64cd\u4f5c\uff1f"},"content":{"rendered":"<p>\u4e00\u6b3e\u82f9\u679c\u7f51\u7ad9\u6539app\u6559\u7a0b\uff1a\u5c06\u73b0\u6709\u7684\u7f51\u7ad9\u5185\u5bb9\u8f7b\u677e\u6253\u9020\u4e3aiOS App<\/p>\n<p>\u82f9\u679c\u516c\u53f8\u7684App Store\u5145\u6ee1\u4e86\u5404\u79cd\u5404\u6837\u7684\u5e94\u7528\uff0c\u4e3a\u7528\u6237\u63d0\u4f9b\u4f17\u591a\u6709\u8da3\u7684\u529f\u80fd\u3002\u4f60\u662f\u5426\u6709\u8fc7\u5c06\u81ea\u5df1\u7684\u7f51\u7ad9\u5185\u5bb9\u5feb\u901f\u5236\u4f5c\u6210\u4e00\u4e2aiOS App\u7684\u60f3\u6cd5\uff1f\u6216\u8005\u5e0c\u671b\u8ba9\u7f51\u7ad9\u7528\u6237\u80fd\u66f4\u4fbf\u6377\u5730\u901a\u8fc7\u79fb\u52a8\u8bbe\u5907\u8bbf\u95ee\u7f51\u7ad9\u5185\u5bb9\uff1f\u8fd9\u7bc7\u6587\u7ae0\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u4e00\u6b3e\u82f9\u679c\u7f51\u7ad9\u6539app\u7684\u5236\u4f5c\u8fc7\u7a0b\uff0c\u8ba9\u4f60\u80fd\u591f\u7528\u7b80\u5355\u7684\u65b9\u5f0f\u5c06\u81ea\u5df1\u7684\u7f51\u7ad9\u5236\u4f5c\u6210\u4e00\u4e2a\u4e13\u5c5e\u5e94\u7528\uff0c\u5e76\u53d1\u5e03\u5230App Store\u3002<\/p>\n<p>1. \u5236\u4f5c\u539f\u7406<\/p>\n<p>\u5728\u8fdb\u884c\u5236\u4f5c\u4e4b\u524d\uff0c\u6211\u4eec\u5148\u4e86\u89e3\u4e00\u4e0b\u5c06\u7f51\u7ad9\u6539\u4e3a\u79fb\u52a8\u5e94\u7528\u7684\u57fa\u672c\u539f\u7406\u3002\u82f9\u679ciOS\u5e94\u7528\u7531\u591a\u79cd\u8f6f\u4ef6\u5f00\u53d1\u5de5\u5177\u5236\u4f5c\uff0c\u5176\u4e2d\u6700\u5e38\u89c1\u7684\u662f\u4f7f\u7528Swift\u6216Objective<a href=\"https:\/\/appfengzhuang.yimenapp.com\/app-1014.html\">apk\u548capp<\/a>-C\u7f16\u7a0b\u8bed\u8a00\u3002\u6211\u4eec\u5c06\u91c7\u7528\u7684\u65b9\u6cd5\u662f\u5c06\u7f51\u7ad9\u5185\u5bb9\u5d4c\u5165\u5230iOS\u5e94\u7528\u7684\u4e00\u4e2aWebView\u63a7\u4ef6\u4e2d\uff0c\u4f7f\u5e94\u7528\u5177\u5907\u5448\u73b0\u7f51\u7ad9\u5185\u5bb9\u7684\u80fd\u529b\u3002\u8fd9\u79cd\u65b9\u6cd5\u65e2\u7701\u65f6\u7701\u529b\uff0c\u53c8\u80fd\u4fdd\u8bc1\u539f\u6709\u7f51\u7ad9\u5185\u5bb9\u5728App\u4e2d\u987a\u7545\u8fd0\u884c\u3002<\/p>\n<p>2. \u5f00\u53d1\u73af\u5883\u51c6\u5907<\/p>\n<p>&#8211; macOS\u7cfb\u7edf\u7684\u8ba1\u7b97\u673a\u3002<\/p>\n<p>&#8211; \u5b89\u88c5Xcode\uff0c\u8fd9\u662f\u82f9\u679c\u516c\u53f8\u63d0\u4f9b\u7684\u5b98\u65b9\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08\u514d\u8d39\uff09\u3002<\/p>\n<p>3. App\u5236\u4f5c\u6b65\u9aa4<\/p>\n<p>### \u6b65\u9aa4\u4e00\uff1a\u521b\u5efa\u9879\u76ee<\/p>\n<p>\u542f\u52a8Xcode\uff0c\u9009\u62e9`Create a new Xcode project`\uff0c\u63a5\u7740\u9009\u62e9`App`\u6a21\u677f\uff0c\u7136\u540e\u70b9\u51fb`Next`\u3002<\/p>\n<p>### \u6b65\u9aa4\u4e8c\uff1a\u8bbe\u7f6e\u9879\u76ee\u4fe1\u606f<\/p>\n<p>\u8f93\u5165\u9879\u76ee\u540d\u79f0\uff0c\u4f8b\u5982\u201cMyWebsiteApp\u201d\u3002\u9009\u62e9\u5f00\u53d1\u56e2\u961f\uff0c\u63a5\u7740\u9009\u62e9`Storyboard`\u4e3a\u754c\u9762\u6784\u5efa\u65b9\u5f0f\u3002\u9009\u62e9\u76f8\u5e94\u7684\u8bed\u8a00\uff08\u63a8\u8350\u4f7f\u7528Swift\uff09\uff0c\u6700\u540e\u70b9\u51fb`Next`\u3002<\/p>\n<p>### \u6b65\u9aa4\u4e09\uff1a\u8bbe\u8ba1\u754c\u9762<\/p>\n<p>\u6253\u5f00`Mai<a href=\"https:\/\/appfengzhuang.yimenapp.com\/app-961.html\">app\u5f00\u53d1\u5e73\u53f0<\/a>n.storyboard`\u6587\u4ef6\uff0c\u5728\u4e2d\u95f4\u7684\u89c6\u56fe\u63a7\u5236\u5668\u4e2d\uff0c\u4ece\u53f3\u4fa7\u7684\u5de5\u5177\u680f\u62d6\u52a8\u4e00\u4e2a`WebView`\u63a7\u4ef6\u5230\u89c6\u56fe\u5f53\u4e2d\uff0c\u4f7f\u5176\u5145\u6ee1\u6574\u4e2a\u5c4f\u5e55\uff0c\u7136\u540e\u6dfb\u52a0\u7ea6\u675f\uff0c\u786e\u4fdd\u5b83\u5728\u4e0d\u540c\u5c4f\u5e55\u4e0a\u80fd\u81ea\u52a8\u8c03\u6574\u3002<\/p>\n<p>### \u6b65\u9aa4\u56db\uff1a\u7f16\u5199\u4ee3\u7801<\/p>\n<p>\u70b9\u51fb\u9879\u76ee\u540d\u79f0\uff0c\u7136\u540e\u9009\u62e9`ViewController.swift`\u6587\u4ef6\u3002\u5f15\u5165WebKit\u6846\u67b6\uff0c\u5c06\u4ee5\u4e0b\u4ee3\u7801\u6dfb\u52a0\u5230import UIKit\u884c\u7684\u4e0b\u65b9\uff1a<\/p>\n<p>&#8220;`swift<\/p>\n<p>import WebKit<\/p>\n<p>&#8220;`<\/p>\n<p>\u7136\u540e\uff0c\u5728`class ViewController`\u4e2d\u6dfb\u52a0\u6d4f\u89c8<\/p>\n<p><figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/i.cdn.yimenapp.com\/2023-04\/03\/15\/24728503264.jpg\" \/><\/figure>\n<\/p>\n<p>\u5668\u5c5e\u6027\uff0c\u5982\u4e0b\uff1a<\/p>\n<p>&#8220;`swift<\/p>\n<p>@IBOutlet weak var webView: WKWebView!<\/p>\n<p>&#8220;`<\/p>\n<p>\u5728`viewDidLoad()`\u65b9\u6cd5\u4e2d\uff0c\u6dfb\u52a0\u5982\u4e0b\u4ee3\u7801\uff1a<\/p>\n<p>&#8220;`swift<\/p>\n<p>let url = URL(string: &#8220;https:\/\/www.example.com&#8221;)!<\/p>\n<p>let request = URLRequest(url: url)<\/p>\n<p>webView.load(request)<\/p>\n<p>&#8220;`<\/p>\n<p>\u5c06\u201chttps:\/\/www.example.com\u201d\u66ff\u6362\u6210\u4f60\u7684\u7f51\u7ad9\u5730\u5740\u3002<\/p>\n<p>### \u6b65\u9aa4\u4e94\uff1a\u94fe\u63a5\u5c5e\u6027<\/p>\n<p>\u56de\u5230`Main.storyboard`\u6587\u4ef6\uff0c\u9009\u62e9 `WebView` \u63a7\u4ef6\uff0c\u6309\u4f4f`control`\u952e\u540c\u65f6\u5c06\u63a7\u4ef6\u62d6\u52a8\u5230`viewController`\u4ee3\u8868\u7684\u9ec4\u8272\u56fe\u6807\u4e0a\uff0c\u9009\u62e9\u521a\u624d\u6dfb\u52a0\u7684`webView`\u5c5e\u6027\uff0c\u4ee5\u5efa\u7acb\u8fde\u63a5\u3002<\/p>\n<p>4. \u8fd0\u884c\u548c\u8c03\u8bd5<\/p>\n<p>\u8fde\u63a5iOS\u8bbe\u5907\u6216\u9009\u62e9\u6a21\u62df\u5668\uff0c\u70b9\u51fbXcode\u9876\u90e8\u7684\u201c\u8fd0\u884c\u201d\u6309\u94ae\uff0c\u67e5\u770b\u548c\u6d4b\u8bd5\u4f60\u7684\u5e94\u7528\u3002\u5bf9\u4e8e\u6709\u4efb\u4f55\u95ee\u9898\u7684\u5730\u65b9\uff0c\u8bf7\u68c0\u67e5\u4ee3\u7801\u548c\u5c5e\u6027\u8fde\u63a5\u662f\u5426\u6b63\u786e\u3002<\/p>\n<p>5. App Store\u53d1\u5e03<\/p>\n<p>\u5982\u679c\u4f60\u5bf9\u5e94\u7528\u7684\u6548\u679c\u6ee1\u610f\uff0c\u5c31\u53ef\u4ee5\u8003\u8651\u5c06\u5b83\u53d1\u5e03\u5230App Store\u3002\u5728Xcode\u4e2d\uff0c\u70b9\u51fb`Product` &gt; `Archive`\u5c06\u9879\u76ee\u6253\u5305\uff0c\u7136\u540e\u6309\u7167\u63d0\u4ea4\u5e94\u7528\u7684\u6d41\u7a0b\u64cd\u4f5c\u3002<\/p>\n<p>\u4f60\u73b0\u5728\u5df2\u7ecf\u6210\u529f\u5c06\u81ea\u5df1\u7684\u7f51\u7ad9\u5236\u4f5c\u6210\u4e86\u4e00\u4e2a\u7b80\u6d01\u7684iOS\u5e94\u7528\uff0c\u5e76\u4e86\u89e3\u4e86\u5176\u4e2d\u7684\u539f\u7406\u548c\u57fa\u672c\u64cd\u4f5c\u3002\u5e0c\u671b\u8fd9\u7bc7\u6587\u7ae0\u80fd\u5bf9\u4f60\u6709\u6240\u5e2e\u52a9\uff0c\u795d\u4f60\u5728\u82f9\u679ciOS\u5f00\u53d1\u7684\u4e16\u754c\u91cc\u80fd\u63a2\u7d22\u51fa\u66f4\u591a\u7cbe\u5f69\u5185\u5bb9\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u6b3e\u82f9\u679c\u7f51\u7ad9\u6539app\u6559\u7a0b\uff1a\u5c06\u73b0\u6709\u7684\u7f51\u7ad9\u5185\u5bb9\u8f7b\u677e\u6253\u9020\u4e3aiOS App\u82f9\u679c\u516c\u53f8\u7684App Store\u5145\u6ee1\u4e86\u5404\u79cd\u5404\u6837\u7684\u5e94\u7528\uff0c\u4e3a\u7528\u6237\u63d0\u4f9b\u4f17\u591a\u6709\u8da3\u7684\u529f\u80fd\u3002\u4f60\u662f\u5426\u6709\u8fc7\u5c06\u81ea\u5df1\u7684\u7f51\u7ad9\u5185\u5bb9\u5feb\u901f\u5236\u4f5c\u6210\u4e00\u4e2aiOS App\u7684<\/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":[15877,17761,3770,83,848],"class_list":{"0":"post-14349","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-appkaifa","7":"tag-app","9":"tag-3770","10":"tag-83","11":"tag-848"},"_links":{"self":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/posts\/14349","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=14349"}],"version-history":[{"count":0,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/posts\/14349\/revisions"}],"wp:attachment":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/media?parent=14349"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/categories?post=14349"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/tags?post=14349"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}