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
<< | |
/ASCII85EncodePages false | |
/AllowPSXObjects false | |
/AllowTransparency true | |
/AlwaysEmbed [ | |
true | |
] | |
/AntiAliasColorImages false | |
/AntiAliasGrayImages false | |
/AntiAliasMonoImages false |
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
// | |
// Created by Vladimir Kelin on 2/8/19. | |
// Copyright © 2019 Systematix Infotech. All rights reserved. | |
// | |
/* | |
A more robust way to create JSON objects from JSONSerialization. | |
Why more robust? See the explanation: | |
http://kelindev.blogspot.com/2018/01/safer-parsing-with-jsonserialization-in.html | |
*/ |
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 unwrap<T>(_ optional: T?) throws -> T { | |
if let real = optional { | |
return real | |
} else { | |
throw UnwrapError(optional: optional) | |
} | |
} | |
struct UnwrapError<T>: Error, CustomStringConvertible { | |
let optional: T? |
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 UIKit | |
/** | |
This protocol along with the extension provides some syntactic sugar and solves two common problems: | |
- Shortens the instantiation | |
- Answers, where to store the storyboard id | |
Blog post: https://kelindev.blogspot.com/2018/10/uikit-protocol-of-month.html | |
*/ | |
protocol StoryboardInstantiatableViewController { | |
static var storyboardId: String { get } |