Home

Awesome

Stringfication

Version Carthage Compatible License: MIT Build Status Platform Swift 3.0

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! This library will be useful when you develop search function :)

Requirements

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

Installation

Cocoapods

Stringfication is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'Stringfication'

Carthage

github "younatics/Stringfication"

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.