Skip to content

Commit

Permalink
KeyedEncoding: Add new string formatters, capitalized, lowercased, up…
Browse files Browse the repository at this point in the history
…percased

Some helpers to deal with converting auto-generated codable String values for instance variables to match some common XML key coding standards to the commonly used Swift camel casing

- capitalzied: convert first letter to uppercase
- uppercased: All letters uppercased
- lowercased: All letters lowercased

Support all types that conform to StringProtocol rather than just String
  • Loading branch information
JoeMatt committed Feb 19, 2019
1 parent 48b672a commit 20955d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/XMLCoder/Auxiliaries/String+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

extension StringProtocol where Self.Index == String.Index {
extension StringProtocol where Self.Index == String.Index {
func escape(_ characterSet: [(character: String, escapedCharacter: String)]) -> String {
var string = String(self)

Expand Down

0 comments on commit 20955d7

Please sign in to comment.