Search
 
SCRIPT & CODE EXAMPLE
 

SWIFT

swift convert dictionary to json

let dic = ["2": "B", "1": "A", "3": "C"]
let encoder = JSONEncoder()
if let jsonData = try? encoder.encode(dic) {
    if let jsonString = String(data: jsonData, encoding: .utf8) {
        print(jsonString)
    }
}
Comment

PREVIOUS NEXT
Code Example
Swift :: Assign values to enum variables Swift 
Swift :: Swift Modify Tuple Element 
Swift :: uicolor gray 
Swift :: Memberwise Initializer Swift 
Swift :: How to Hide Password in Text field Swift 
Swift :: AndroidManifest.xml:5: Error: Class referenced in the manifest flutter build 
Swift :: library not found for -lalan-sdk-react-native 
Swift :: swift get all cases starting with 
Swift :: jar not declared js 
Swift :: page view controller disable swipe 
Swift :: how to do corner radius from button image in swift 
Swift :: uialertcontroller example objective Code Answer 
Ruby :: How to find database name in rails console 
Ruby :: ruby lowercase 
Ruby :: rails hidden field 
Ruby :: array ruby taking 3 last value 
Ruby :: ruby check if block given 
Ruby :: rails on_delete cascade not working 
Ruby :: ruby 2 decimal 
Ruby :: rails remove column 
Ruby :: conditional operator in ruby 
Ruby :: generate csv ruby 
Ruby :: iterate through values of an object rails 
Ruby :: rails check if a URL is valid 
Ruby :: rails transactions 
Ruby :: ruby push array 
Ruby :: how works httparty ruby 
Ruby :: ruby check if path is a directory 
Ruby :: ruby function arguments 
Ruby :: httparty headers 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =