This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Kind</key> | |
<string>Xcode.IDEKit.TextSubstitutionFileTemplateKind</string> | |
<key>Platforms</key> | |
<array> | |
<string>com.apple.platform.iphoneos</string> | |
</array> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vapor | |
/// Register your application's routes here. | |
public func routes(_ router: Router) throws { | |
router.get("departure") { request in | |
return """ | |
[ | |
{ | |
"company_name": "Belavia", | |
"departure_time": "05:00", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ViewController.swift | |
// AirportTimeTable | |
// | |
// Created by Maksim Vialykh on 01.08.2018. | |
// Copyright © 2018 Vialyx. All rights reserved. | |
// | |
import UIKit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typealias FunctionResult = (typleNameArgument: String, typleCountArgument: Int) | |
func functionName(externalArgumentName internalArgumentName: String = "defaultValue") -> FunctionResult { | |
return (internalArgumentName, 1) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typealias ItemsAndErrorResult = (items: [String], error: Error?) | |
func download(from index: Int, with offset: Int) -> ItemsAndErrorResult { | |
guard index < 100 else { | |
return ([], NSError(domain: "com.vialyx.course", code: -987, userInfo: nil)) | |
} | |
let items = Array(repeating: "result_\(index)", count: offset) | |
return (items, nil) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func download(from index: Int, with offset: Int) -> [String] { | |
return ["result"] | |
} | |
download(from: 0, with: 10) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func download(from index: Int, with offset: Int = 10) -> [String] { | |
return ["result"] | |
} | |
download(from: 20) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typealias User = String | |
func getUsers(with ids: UUID...) -> [User] { | |
return ["Maxim", "Nik"] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func update(user: inout User) -> Error? { | |
user = "Mike" | |
return nil | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typealias User = String | |
func getUsers(with ids: UUID...) -> [User] { | |
return ["Maxim", "Nik"] | |
} | |
var downloadTask: (UUID...) -> [String] = getUsers | |
downloadTask(UUID()) |