Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block kvaDrug

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
kvaDrug / Minimalistic (iOS).joboptions
Created Sep 10, 2019
Adobe Illustrator preset for exporting lightweight PDF files intended for use with Xcode as vector icons. Put it to /Users/Username/Library/Application Support/Adobe/Adobe PDF/Settings.
View Minimalistic (iOS).joboptions
/ASCII85EncodePages false
/AllowPSXObjects false
/AllowTransparency true
/AlwaysEmbed [
/AntiAliasColorImages false
/AntiAliasGrayImages false
/AntiAliasMonoImages false
kvaDrug / JSONHelpers.swift
Created Feb 20, 2019
A robust way to create JSON objects from JSONSerialization.
View JSONHelpers.swift
// 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:
kvaDrug / Unwrap.swift
Created Feb 20, 2019
Unwraps an optional and throws error if nil. The related blogpost:
View Unwrap.swift
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?
kvaDrug / StoryboardInstantiatableViewController.swift
Created Feb 20, 2019
A Swift protocol allowing to 1) shorten the code required to instantiate an UIViewController from a storyboard 2) store the storyboard id in the predictable place
View StoryboardInstantiatableViewController.swift
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:
protocol StoryboardInstantiatableViewController {
static var storyboardId: String { get }
You can’t perform that action at this time.