November 2018
Intermediate to advanced
404 pages
10h 16m
English
You can run the following commands on the Terminal to create your myJournal application from the Kitura boilerplate project:
$ mkdir myJournal$ cd myJournal$ kitura init$ swift run$ open ./myJournal.xcodeproj
Create a new directory, /Sources/Application/Models, and add a new Swift file, Entry.swift, to the directory:
import Foundationstruct Entry: Codable { var id: String var title: String? var content: String? init(id: String, title: String? = nil, content: String? = nil) { self.id = id self.title = title self.content = content }}
The implementation of the Entry data structure is similar to that in the myJournal Vapor project. While Kitura's Entry implements Codable protocol directly, Vapor's Entry implements Content ...
Read now
Unlock full access