這幾天在研究 macos 應(yīng)用律姨,打算做一個給大家好好用用形用,其實之前做過 VB 和 C# 的 webform 和 winform 編程计福,再來 研究 c++ 的qt5豌鹤, python的 pyqt5, swift 的 ios 和macos 編程 其實都是一樣的蝉绷,拖拉控件鸭廷,對控件的操作 什么點擊 鏈接 響應(yīng)等等,macOS 的研究 看國內(nèi)還是很缺少教程的熔吗。大家都去整 ios 了辆床,其實整過ios 再整 macOS也是非常容易遷移完成的。
這里有比較完善的mac的tutorial 建議大家翻翻看看
https://github.com/CSharpHai/macOS_Development_Tutorials_translation
swift 按道理來說是一門面向未來的語言磁滚,不只是做控件佛吓,swift 完全是可以 全棧的,說道全棧 必須整整后端垂攘,swift 后端 由一個比較強(qiáng)大的 框架 perfect 來完成
perfect 的tutorial 參考
https://github.com/PerfectlySoft/PerfectDocs
https://segmentfault.com/a/1190000007436220
https://github.com/PerfectlySoft/Perfect
https://github.com/Swift-AI/NeuralNet-Handwriting-iOS/blob/master/Handwriting/NeuralNet.swift
https://www.cnblogs.com/ludashi/p/6165418.html
https://github.com/apple/swift-package-manager
https://blog.csdn.net/woaizijiheni/article/details/50614062
https://blog.csdn.net/u014220518/article/details/79217903
https://www.cnblogs.com/ludashi/p/6145344.html
https://blog.csdn.net/loveqcx123/article/details/70240829?locationNum=6&fps=1
http://www.reibang.com/p/46c59c647b6e?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation
perfect 好像和java的 spring 维雇,scala的 play ,python的 Django 還要強(qiáng)大些晒他,支持的wrap 組件 還是非常豐富的吱型,mysql kafka zookeeper 甚至 tensorflow
另外 swift 也在去年發(fā)布了 自己的包管理器 spm ,遲到的總要來的陨仅,一個沒有自己包管理器的語言 要么被淘汰 要么被替代津滞。不過spm 很搞笑也會撿現(xiàn)成的,直接使用的是github的鏈接做依賴灼伤,社會 社會
在使用spm 触徐,在使用swift 寫后端,真的有一種 身輕如燕狐赡,逃離枷鎖的感覺撞鹉。
另外 swift 還有自己的 機(jī)器學(xué)習(xí)包
https://github.com/Swift-AI/Swift-AI
https://github.com/Swift-AI
在使用spm 我們有一個 樣例參考
http://www.reibang.com/p/4caecb22c4bd
這個講的很清楚
$ mkdir SPMDemo // 創(chuàng)建文件夾
$ cd SPMDemo // 進(jìn)入文件夾
$ swift package init --type executable // 初始化為可執(zhí)行項目
Creating executable package: SPMDemo
Creating Package.swift
Creating .gitignore
Creating Sources/
Creating Sources/main.swift
Creating Tests/
$ swift package generate-xcodeproj //生成Xcode工程,可用Xcode打開
generated: ./SPMDemo.xcodeproj
$ swift build // swift 編譯并生成可執(zhí)行文件
Compile Swift Module 'SPMDemo' (1 sources)
Linking ./.build/debug/SPMDemo
$ ./.build/debug/SPMDemo // 執(zhí)行生成的文件
Hello, world!
我嘗試了一下,運行是正常的鸟雏,不過中間有個小插曲享郊,我的swift version 是 4.0.1
xcode version 是 9
在 swift package generate-xcodeproj //生成Xcode工程 是報錯
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Deve
其實是 swift 找不到 xcode 去執(zhí)行,原因是可能 xcode的環(huán)境變量有問題,或者是 一臺電腦安裝了多個版本的xcode孝鹊。
如何操作呢
su root # 切換到 root 用戶
sh-3.2# xcode-select --switch /Applications/Xcode.app/Contents/Developer/
執(zhí)行即可
完事就可以了
另外一些 干貨在這
http://www.reibang.com/p/46c59c647b6e?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation
還有就是一個swift的一個后端項目