{"id":175135,"date":"2020-04-11T08:25:32","date_gmt":"2020-04-11T00:25:32","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=175135"},"modified":"2020-03-24T12:26:13","modified_gmt":"2020-03-24T04:26:13","slug":"swift-variable-explanation","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/swift-variable-explanation.html","title":{"rendered":"Swift \u53d8\u91cf\u8bb2\u89e3"},"content":{"rendered":"
\u5bfc\u8bfb<\/td>\n | Swift \u662f\u4e00\u79cd\u652f\u6301\u591a\u7f16\u7a0b\u8303\u5f0f\u548c\u7f16\u8bd1\u5f0f\u7684\u5f00\u6e90\u7f16\u7a0b\u8bed\u8a00,\u82f9\u679c\u4e8e2014\u5e74WWDC\uff08\u82f9\u679c\u5f00\u53d1\u8005\u5927\u4f1a\uff09\u53d1\u5e03\uff0c\u7528\u4e8e\u5f00\u53d1 iOS\uff0cOS X \u548c watchOS \u5e94\u7528\u7a0b\u5e8f\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
Swift \u6bcf\u4e2a\u53d8\u91cf\u90fd\u6307\u5b9a\u4e86\u7279\u5b9a\u7684\u7c7b\u578b\uff0c\u8be5\u7c7b\u578b\u51b3\u5b9a\u4e86\u53d8\u91cf\u5360\u7528\u5185\u5b58\u7684\u5927\u5c0f\uff0c\u4e0d\u540c\u7684\u6570\u636e\u7c7b\u578b\u4e5f\u51b3\u5b9a\u53ef\u5b58\u50a8\u503c\u7684\u8303\u56f4\u3002<\/p>\n \u4e0a\u4e00\u7ae0\u8282\u6211\u4eec\u5df2\u7ecf\u4e3a\u5927\u5bb6\u4ecb\u7ecd\u4e86\u57fa\u672c\u7684\u6570\u636e\u7c7b\u578b\uff0c\u5305\u62ec\u6574\u5f62Int\u3001\u6d6e\u70b9\u6570Double\u548cFloat\u3001\u5e03\u5c14\u7c7b\u578bBool\u4ee5\u53ca\u5b57\u7b26\u4e32\u7c7b\u578bString\u3002\u6b64\u5916\uff0cSwift\u8fd8\u63d0\u4f9b\u4e86\u5176\u4ed6\u66f4\u5f3a\u5927\u6570\u636e\u7c7b\u578b\uff0c Optional, Array, Dictionary, Struct, \u548c Class \u7b49\u3002<\/p>\n \u63a5\u4e0b\u6765\u6211\u4eec\u5c06\u4e3a\u5927\u5bb6\u4ecb\u7ecd\u5982\u4f55\u5728 Swift \u7a0b\u5e8f\u4e2d\u58f0\u660e\u548c\u4f7f\u7528\u53d8\u91cf\u3002<\/p>\n \u53d8\u91cf\u58f0\u660e<\/strong><\/div>\n \u53d8\u91cf\u58f0\u660e\u610f\u601d\u662f\u544a\u8bc9\u7f16\u8bd1\u5668\u5728\u5185\u5b58\u4e2d\u7684\u54ea\u4e2a\u4f4d\u7f6e\u4e0a\u4e3a\u53d8\u91cf\u521b\u5efa\u591a\u5927\u7684\u5b58\u50a8\u7a7a\u95f4\u3002 var variableName = (initial value)<\/pre>\n |