Tusker/Pachyderm/Extensions/Data.swift

17 lines
348 B
Swift

//
// Data.swift
// Pachyderm
//
// Created by Shadowfacts on 9/8/18.
// Copyright © 2018 Shadowfacts. All rights reserved.
//
import Foundation
extension Data {
mutating func append(_ string: String, encoding: String.Encoding = .utf8) {
guard let data = string.data(using: encoding) else { return }
append(data)
}
}