/* 打印Json数据 */ LJDownLoadNetimage.request("GET",url: "http://Jsonplaceholder.typicode.com/users/1") { (data,respond,error) in data转String let str = String(data:data!,enCoding: String.EnCoding.utf8)! print(str) }
打印结果
{ "ID": 1,"name": "Leanne Graham","username": "Bret","email": "Sincere@april.biz","address": { "street": "Kulas light","suite": "Apt. 556","city": "Gwenborough","zipcode": "92998-3874","geo": { "lat": "-37.3159","lng": "81.1496" } },"phone": "1-770-736-8031 x56442","website": "hildegard.org","company": { "name": "Romaguera-Crona","catchPhrase": "multi-layered clIEnt-server neural-net","bs": "harness real-time e-markets" }}总结
以上是内存溢出为你收集整理的swift3.0 data转String 打印输出全部内容,希望文章能够帮你解决swift3.0 data转String 打印输出所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)