CocoaPods trunk is moving to be read-only. Read more on the blog, there are 19 months to go.

Stringfication 1.0.0

Stringfication 1.0.0

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Apr 2017
SwiftSwift Version 3.1
SPMSupports SPM

Maintained by [younatics].



  • By
  • Seungyoun Yi

See Objectification if you want to get objects where string is contained in object

Updates

See CHANGELOG for details

Intoduction

🔨 Make all objects to String!

Requirements

Stringfication is written in Swift 3. Compatible with iOS 8.0+

Usage

Import Stringfication and inherit Stringfication what you want to make object to string

import Stringfication

struct Model: Stringfication {
    var anyProperty: Any?
    var arrayProperty: [[String]]?
    var intProperty: Int?
    var floatProperty: Float?
    var stringProperty: String?
}

I made some data sample in Model

var model = Model()
model.anyProperty = [["Developed","by","SeungyounYi"],[1,2,3]]
model.arrayProperty = [["This","is","Stringfication"],["Do","what","you","want"]]
model.intProperty = 777
model.floatProperty = 99.99
model.stringProperty = "younatics"

Get properties

print(model.stringfication.properties())
// -> ["anyProperty", "arrayProperty", "intProperty", "floatProperty", "stringProperty"]

Get values

print(model.stringfication.values())
// -> ["Developed", "by", "SeungyounYi", "1", "2", "3", "This", "is", "Stringfication", "Do", "what", "you", "want", "777", "99.9899979", "younatics"]

Get all

print(model.stringfication.all())
// -> ["anyProperty", "arrayProperty", "intProperty", "floatProperty", "stringProperty", "Developed", "by", "SeungyounYi", "1", "2", "3", "This", "is", "Stringfication", "Do", "what", "you", "want", "777", "99.9899979", "younatics"]

References

Please tell me or make pull request if you use this library in your application :)

Author

younatics 🇰🇷

License

Stringfication is available under the MIT license. See the LICENSE file for more info.