StringModel.swift 6.84 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197
//
//	StringModel.swift
//	Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport

import Foundation


class StringModel : NSObject, NSCoding{

	var cameraButtonText : String!
	var cameraText : String!
	var cameraText1 : String!
	var completeButtonText : String!
	var completeText : String!
	var completeText2 : String!
	var homeButtonText : String!
	var homeText1 : String!
	var homeText2 : String!
	var homeText3 : String!
	var homeTitle : String!
	var lactationModeText : String!
	var lyingGesture : StringLyingGesture!
	var lyingGestureIntroduce : StringLyingGestureIntroduce!
	var sittingGesture : StringLyingGesture!
	var sittingGestureIntroduce : StringSittingGestureIntroduce!


	/**
	 * Instantiate the instance using the passed dictionary values to set the properties values
	 */
	init(fromDictionary dictionary: [String:Any]){
		cameraButtonText = dictionary["cameraButtonText"] as? String
		cameraText = dictionary["cameraText"] as? String
		cameraText1 = dictionary["cameraText1"] as? String
		completeButtonText = dictionary["completeButtonText"] as? String
		completeText = dictionary["completeText"] as? String
		completeText2 = dictionary["completeText2"] as? String
		homeButtonText = dictionary["homeButtonText"] as? String
		homeText1 = dictionary["homeText1"] as? String
		homeText2 = dictionary["homeText2"] as? String
		homeText3 = dictionary["homeText3"] as? String
		homeTitle = dictionary["homeTitle"] as? String
		lactationModeText = dictionary["lactationModeText"] as? String
		if let lyingGestureData = dictionary["lyingGesture"] as? [String:Any]{
			lyingGesture = StringLyingGesture(fromDictionary: lyingGestureData)
		}
		if let lyingGestureIntroduceData = dictionary["lyingGestureIntroduce"] as? [String:Any]{
			lyingGestureIntroduce = StringLyingGestureIntroduce(fromDictionary: lyingGestureIntroduceData)
		}
		if let sittingGestureData = dictionary["sittingGesture"] as? [String:Any]{
			sittingGesture = StringLyingGesture(fromDictionary: sittingGestureData)
		}
		if let sittingGestureIntroduceData = dictionary["sittingGestureIntroduce"] as? [String:Any]{
			sittingGestureIntroduce = StringSittingGestureIntroduce(fromDictionary: sittingGestureIntroduceData)
		}
	}

	/**
	 * Returns all the available property values in the form of [String:Any] object where the key is the approperiate json key and the value is the value of the corresponding property
	 */
	func toDictionary() -> [String:Any]
	{
		var dictionary = [String:Any]()
		if cameraButtonText != nil{
			dictionary["cameraButtonText"] = cameraButtonText
		}
		if cameraText != nil{
			dictionary["cameraText"] = cameraText
		}
		if cameraText1 != nil{
			dictionary["cameraText1"] = cameraText1
		}
		if completeButtonText != nil{
			dictionary["completeButtonText"] = completeButtonText
		}
		if completeText != nil{
			dictionary["completeText"] = completeText
		}
		if completeText2 != nil{
			dictionary["completeText2"] = completeText2
		}
		if homeButtonText != nil{
			dictionary["homeButtonText"] = homeButtonText
		}
		if homeText1 != nil{
			dictionary["homeText1"] = homeText1
		}
		if homeText2 != nil{
			dictionary["homeText2"] = homeText2
		}
		if homeText3 != nil{
			dictionary["homeText3"] = homeText3
		}
		if homeTitle != nil{
			dictionary["homeTitle"] = homeTitle
		}
		if lactationModeText != nil{
			dictionary["lactationModeText"] = lactationModeText
		}
		if lyingGesture != nil{
			dictionary["lyingGesture"] = lyingGesture.toDictionary()
		}
		if lyingGestureIntroduce != nil{
			dictionary["lyingGestureIntroduce"] = lyingGestureIntroduce.toDictionary()
		}
		if sittingGesture != nil{
			dictionary["sittingGesture"] = sittingGesture.toDictionary()
		}
		if sittingGestureIntroduce != nil{
			dictionary["sittingGestureIntroduce"] = sittingGestureIntroduce.toDictionary()
		}
		return dictionary
	}

    /**
    * NSCoding required initializer.
    * Fills the data from the passed decoder
    */
    @objc required init(coder aDecoder: NSCoder)
	{
         cameraButtonText = aDecoder.decodeObject(forKey: "cameraButtonText") as? String
         cameraText = aDecoder.decodeObject(forKey: "cameraText") as? String
         cameraText1 = aDecoder.decodeObject(forKey: "cameraText1") as? String
         completeButtonText = aDecoder.decodeObject(forKey: "completeButtonText") as? String
         completeText = aDecoder.decodeObject(forKey: "completeText") as? String
         completeText2 = aDecoder.decodeObject(forKey: "completeText2") as? String
         homeButtonText = aDecoder.decodeObject(forKey: "homeButtonText") as? String
         homeText1 = aDecoder.decodeObject(forKey: "homeText1") as? String
         homeText2 = aDecoder.decodeObject(forKey: "homeText2") as? String
         homeText3 = aDecoder.decodeObject(forKey: "homeText3") as? String
         homeTitle = aDecoder.decodeObject(forKey: "homeTitle") as? String
         lactationModeText = aDecoder.decodeObject(forKey: "lactationModeText") as? String
         lyingGesture = aDecoder.decodeObject(forKey: "lyingGesture") as? StringLyingGesture
         lyingGestureIntroduce = aDecoder.decodeObject(forKey: "lyingGestureIntroduce") as? StringLyingGestureIntroduce
         sittingGesture = aDecoder.decodeObject(forKey: "sittingGesture") as? StringLyingGesture
         sittingGestureIntroduce = aDecoder.decodeObject(forKey: "sittingGestureIntroduce") as? StringSittingGestureIntroduce

	}

    /**
    * NSCoding required method.
    * Encodes mode properties into the decoder
    */
    @objc func encode(with aCoder: NSCoder)
	{
		if cameraButtonText != nil{
			aCoder.encode(cameraButtonText, forKey: "cameraButtonText")
		}
		if cameraText != nil{
			aCoder.encode(cameraText, forKey: "cameraText")
		}
		if cameraText1 != nil{
			aCoder.encode(cameraText1, forKey: "cameraText1")
		}
		if completeButtonText != nil{
			aCoder.encode(completeButtonText, forKey: "completeButtonText")
		}
		if completeText != nil{
			aCoder.encode(completeText, forKey: "completeText")
		}
		if completeText2 != nil{
			aCoder.encode(completeText2, forKey: "completeText2")
		}
		if homeButtonText != nil{
			aCoder.encode(homeButtonText, forKey: "homeButtonText")
		}
		if homeText1 != nil{
			aCoder.encode(homeText1, forKey: "homeText1")
		}
		if homeText2 != nil{
			aCoder.encode(homeText2, forKey: "homeText2")
		}
		if homeText3 != nil{
			aCoder.encode(homeText3, forKey: "homeText3")
		}
		if homeTitle != nil{
			aCoder.encode(homeTitle, forKey: "homeTitle")
		}
		if lactationModeText != nil{
			aCoder.encode(lactationModeText, forKey: "lactationModeText")
		}
		if lyingGesture != nil{
			aCoder.encode(lyingGesture, forKey: "lyingGesture")
		}
		if lyingGestureIntroduce != nil{
			aCoder.encode(lyingGestureIntroduce, forKey: "lyingGestureIntroduce")
		}
		if sittingGesture != nil{
			aCoder.encode(sittingGesture, forKey: "sittingGesture")
		}
		if sittingGestureIntroduce != nil{
			aCoder.encode(sittingGestureIntroduce, forKey: "sittingGestureIntroduce")
		}

	}

}