Duc Ninja

Tips to be more productive with Xcode

⌃: Control ⌘: Command ⌥: Option ⇧: Shift ⏎: Return 1. Decide Where to Open a File In Xcode, you can open a file in various ways: in the standard editor, in a new or existing assistant editor, in a new or existing tab, or in a new window. Here’s how you can decide about this: When clicking on a file in the Navigator, hold down ⇧ + ⌥ When clicki...
Read more ...

Swift encoding and decoding

Encoding and decoding with Swift 4 Swift 4 lets you serialize your custom data types to JSON without writing any special code. // encoding.swift struct Language: Codable { var name: String var version: Int } let swift = Language(name: "Swift", version: 4) let php = Language(name: "PHP", version: 7) let perl = Language(name: "Perl", ve...
Read more ...

Migrating to Swift 4

In the past, migrating your code was a big deal when a new version of Swift was introduced – when Swift 3 came around, it seemed like every line of code had a syntax change. This time around, however, life should be a lot easier on us – in fact maybe you’ll even see this nice message during your migration: Here’s what Chris Lattner said about...
Read more ...