November 2018
Intermediate to advanced
404 pages
10h 16m
English
As a starter, use the following commands in the Terminal to create a new application myJournal from Vapor's boilerplate project:
$ vapor new myJournal$ cd myJournal$ vapor xcode
Create a new directory, /Sources/App/Models, in Xcode, and add a new Swift file, Entry.swift, to the newly created directory:
// Entry.swiftimport Vaporstruct Entry { var id: String // [1] var title: String? var content: String? init(id: String, title: String? = nil, content: String? = nil) { self.id = id self.title = title self.content = content }}
Entry is a simple structure representing a journal entry. It has three fields and an initializer. The id string field is a Universal Unique Identifier (UUID) that will uniquely identify ...
Read now
Unlock full access