Do-Try-Catch Get link Facebook X Pinterest Email Other Apps August 11, 2020 do { let responseModel = try JSONDecoder().decode(Model.self, from: data) } catch let error as NSError{ } Get link Facebook X Pinterest Email Other Apps Comments
SubString in Swift August 14, 2020 extension String { func index (from: Int ) -> Index { return self . index ( startIndex , offsetBy: from) } func substring (from: Int ) -> String { let fromIndex = index (from: from) return String ( self [fromIndex ... ]) } func substring (to: Int ) -> String { let toIndex = index (from: to) return String ( self [ ..< toIndex]) } func substring (with r: Range < Int >) -> String { let startIndex = index (from: r. lowerBound ) let endIndex = index (from: r. upperBound ) return String ( self [startIndex ..< endIndex]) } func subString (from index: Int , count: Int ) -> String... Read more
Comments
Post a Comment