[{"data":1,"prerenderedAt":1273},["ShallowReactive",2],{"Categories":3,"NavIndexCategoriesCountFooter":206,"content-\u002F2020\u002F03\u002F03\u002Fscanning-qr-codes-with-swiftui":207},[4,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,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,68,70,71,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,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205],{"category":5},"System Administration",{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":27},"Software Development",{"category":5},{"category":5},{"category":5},{"category":5},{"category":27},{"category":27},{"category":5},{"category":5},{"category":5},{"category":27},{"category":5},{"category":5},{"category":5},{"category":27},{"category":27},{"category":27},{"category":27},{"category":5},{"category":5},{"category":5},{"category":27},{"category":27},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":27},{"category":5},{"category":5},{"category":27},{"category":27},{"category":27},{"category":27},{"category":5},{"category":27},{"category":27},{"category":67},"Drones & RC",{"category":69},"DIY Projects",{"category":67},{"category":72},"Photography",{"category":69},{"category":69},{"category":69},{"category":67},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":67},{"category":69},{"category":69},{"category":67},{"category":67},{"category":72},{"category":72},{"category":72},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":5},{"category":5},{"category":72},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":5},{"category":67},{"category":67},{"category":72},{"category":72},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":72},{"category":67},{"category":138},"3D Printing - Laser Cutting - CNC",{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":5},{"category":138},{"category":27},{"category":27},{"category":138},{"category":138},{"category":72},{"category":158},"Photography,3D Printing - Laser Cutting - CNC",{"category":27},{"category":27},{"category":69},{"category":27},{"category":27},{"category":27},{"category":27},{"category":5},{"category":67},{"category":5},{"category":5},{"category":27},{"category":27},{"category":27},{"category":27},{"category":27},{"category":69},{"category":27},{"category":27},{"category":27},{"category":27},{"category":181},"Home Assistant",{"category":181},{"category":72},{"category":27},{"category":27},{"category":72},{"category":138},{"category":5},{"category":72},{"category":72},{"category":138},{"category":27},{"category":181},{"category":5},{"category":181},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},{"category":27},194,{"id":208,"title":209,"body":210,"category":27,"date":1259,"description":231,"embedImage":1260,"extension":1261,"image":513,"intro":221,"meta":1262,"navigation":930,"path":1263,"seo":1264,"series":1265,"sitemap":1266,"stem":1267,"tags":1268,"__hash__":1272},"content\u002F2020\u002F03\u002F03\u002Fscanning-qr-codes-with-swiftui.md","Scanning QR codes with SwiftUI",{"type":211,"value":212,"toc":1250},"minimark",[213,218,222,225,304,307,310,377,380,439,442,446,452,459,462,475,504,507,514,516,520,523,533,538,541,544,547,550,575,578,585,684,687,717,720,838,841,848,856,859,861,865,868,871,874,1006,1009,1012,1228,1230,1234,1237,1239,1246],[214,215,217],"h2",{"id":216},"model","Model",[219,220,221],"p",{},"So the first thing we want to do is to have a way to scan a QR code to get the relevant IDs for the app.",[219,223,224],{},"We will use a simple JSON format:",[226,227,232],"pre",{"className":228,"code":229,"language":230,"meta":231,"style":231},"language-json shiki shiki-themes github-dark","{\n  \"clientId\": \"application id from S'banken (applikasjonsnøkkel)\",\n  \"clientSecret\": \"application password from S'banken\",\n  \"userId\": \"national identity number (fødselsnummer)\",\n  \"accountNr\": \"bank account number\"\n}\n","json","",[233,234,235,244,261,274,287,298],"code",{"__ignoreMap":231},[236,237,240],"span",{"class":238,"line":239},"line",1,[236,241,243],{"class":242},"s95oV","{\n",[236,245,247,251,254,258],{"class":238,"line":246},2,[236,248,250],{"class":249},"sDLfK","  \"clientId\"",[236,252,253],{"class":242},": ",[236,255,257],{"class":256},"sU2Wk","\"application id from S'banken (applikasjonsnøkkel)\"",[236,259,260],{"class":242},",\n",[236,262,264,267,269,272],{"class":238,"line":263},3,[236,265,266],{"class":249},"  \"clientSecret\"",[236,268,253],{"class":242},[236,270,271],{"class":256},"\"application password from S'banken\"",[236,273,260],{"class":242},[236,275,277,280,282,285],{"class":238,"line":276},4,[236,278,279],{"class":249},"  \"userId\"",[236,281,253],{"class":242},[236,283,284],{"class":256},"\"national identity number (fødselsnummer)\"",[236,286,260],{"class":242},[236,288,290,293,295],{"class":238,"line":289},5,[236,291,292],{"class":249},"  \"accountNr\"",[236,294,253],{"class":242},[236,296,297],{"class":256},"\"bank account number\"\n",[236,299,301],{"class":238,"line":300},6,[236,302,303],{"class":242},"}\n",[219,305,306],{},"For this we will need a model class - and we need to be able to convert between the json and the class instance.",[219,308,309],{},"Add a swift file to the project - Config.swift - and create a class Config that conforms to the Codable protocol.",[226,311,315],{"className":312,"code":313,"language":314,"meta":231,"style":231},"language-swift shiki shiki-themes github-dark","class Config : Codable {\n    let clientId: String\n    let clientSecret: String\n    let userId: String\n    let accountNr: String\n}\n","swift",[233,316,317,335,346,355,364,373],{"__ignoreMap":231},[236,318,319,323,327,330,333],{"class":238,"line":239},[236,320,322],{"class":321},"snl16","class",[236,324,326],{"class":325},"svObZ"," Config",[236,328,329],{"class":242}," : ",[236,331,332],{"class":325},"Codable ",[236,334,243],{"class":242},[236,336,337,340,343],{"class":238,"line":246},[236,338,339],{"class":321},"    let",[236,341,342],{"class":242}," clientId: ",[236,344,345],{"class":249},"String\n",[236,347,348,350,353],{"class":238,"line":263},[236,349,339],{"class":321},[236,351,352],{"class":242}," clientSecret: ",[236,354,345],{"class":249},[236,356,357,359,362],{"class":238,"line":276},[236,358,339],{"class":321},[236,360,361],{"class":242}," userId: ",[236,363,345],{"class":249},[236,365,366,368,371],{"class":238,"line":289},[236,367,339],{"class":321},[236,369,370],{"class":242}," accountNr: ",[236,372,345],{"class":249},[236,374,375],{"class":238,"line":300},[236,376,303],{"class":242},[219,378,379],{},"This will not compile yet - since we need to actually conform to Codable - so add the following enum to the class:",[226,381,383],{"className":312,"code":382,"language":314,"meta":231,"style":231},"enum CodingKeys: String, CodingKey {\n    case clientId\n    case clientSecret\n    case userId\n    case accountNr\n}\n",[233,384,385,406,414,421,428,435],{"__ignoreMap":231},[236,386,387,390,393,395,398,401,404],{"class":238,"line":239},[236,388,389],{"class":321},"enum",[236,391,392],{"class":325}," CodingKeys",[236,394,253],{"class":242},[236,396,397],{"class":249},"String",[236,399,400],{"class":242},", ",[236,402,403],{"class":325},"CodingKey ",[236,405,243],{"class":242},[236,407,408,411],{"class":238,"line":246},[236,409,410],{"class":321},"    case",[236,412,413],{"class":249}," clientId\n",[236,415,416,418],{"class":238,"line":263},[236,417,410],{"class":321},[236,419,420],{"class":249}," clientSecret\n",[236,422,423,425],{"class":238,"line":276},[236,424,410],{"class":321},[236,426,427],{"class":249}," userId\n",[236,429,430,432],{"class":238,"line":289},[236,431,410],{"class":321},[236,433,434],{"class":249}," accountNr\n",[236,436,437],{"class":238,"line":300},[236,438,303],{"class":242},[440,441],"hr",{},[214,443,445],{"id":444},"qr-code-generation","QR Code Generation",[219,447,448],{},[449,450,451],"strong",{},"Important: The JSON and the QR code contain keys and IDs and should not be shared or made publically available.",[219,453,454,455,458],{},"We'll start by creating a file ",[233,456,457],{},"config.json"," that matches the format above but with the values filled out.",[219,460,461],{},"Now we need to create a QR code image for this file. We really don't want to use an online generator for this - since it has our secrets inside.",[219,463,464,465],{},"I will be using a command line application called ",[466,467,474],"a",{"href":468,"rel":469,"target":473},"https:\u002F\u002Fgithub.com\u002Ffukuchi\u002Flibqrencode",[470,471,472],"nofollow","noopener","noreferer","_blank","qrencode",[226,476,480],{"className":477,"code":478,"language":479,"meta":231,"style":231},"language-shell shiki shiki-themes github-dark","qrencode -l H -o config.png \u003C config.json\n","shell",[233,481,482],{"__ignoreMap":231},[236,483,484,486,489,492,495,498,501],{"class":238,"line":239},[236,485,474],{"class":325},[236,487,488],{"class":249}," -l",[236,490,491],{"class":256}," H",[236,493,494],{"class":249}," -o",[236,496,497],{"class":256}," config.png",[236,499,500],{"class":321}," \u003C",[236,502,503],{"class":256}," config.json\n",[219,505,506],{},"Here we ask for high error correction (we want to be sure that the code is correct). The command should generate a PNG image of the QR code in config.png.",[219,508,509],{},[510,511],"img",{"alt":512,"src":513},"title","\u002Fimages\u002Fposts\u002F2020\u002F03\u002Fconfig.png",[440,515],{},[214,517,519],{"id":518},"qr-code-scanner","QR Code Scanner",[219,521,522],{},"We need to do two things:",[524,525,526,530],"ul",{},[527,528,529],"li",{},"Handling showing\u002Fhiding the scanner",[527,531,532],{},"Handling the scan data received",[534,535,537],"h3",{"id":536},"scanner-sheet","Scanner Sheet",[219,539,540],{},"We will show the scanner in a sheet view. We'll start by working in the main ContentView.",[219,542,543],{},"We need to add an import to CodeScanner at the top - then we need to add a sheet.",[219,545,546],{},"The sheet will need a controlling state variable to handle show\u002Fhide.",[219,548,549],{},"Add the following variable to the view:",[226,551,553],{"className":312,"code":552,"language":314,"meta":231,"style":231},"@State private var showingScanner = false\n",[233,554,555],{"__ignoreMap":231},[236,556,557,560,563,566,569,572],{"class":238,"line":239},[236,558,559],{"class":321},"@State",[236,561,562],{"class":321}," private",[236,564,565],{"class":321}," var",[236,567,568],{"class":242}," showingScanner ",[236,570,571],{"class":321},"=",[236,573,574],{"class":249}," false\n",[219,576,577],{},"Now we need a button to trigger showing scanning - so let's add a simple button using the system image for QR code.",[219,579,580,581,584],{},"Replace the ",[233,582,583],{},"Text(\"Hello World\")"," with the following:",[226,586,588],{"className":312,"code":587,"language":314,"meta":231,"style":231},"Button(action: {\n    self.showingScanner = true\n}) {\n    Image(systemName: \"qrcode\")\n        .resizable()\n        .frame(width: 32, height: 32)\n}\n",[233,589,590,604,617,622,640,651,679],{"__ignoreMap":231},[236,591,592,595,598,601],{"class":238,"line":239},[236,593,594],{"class":249},"Button",[236,596,597],{"class":242},"(",[236,599,600],{"class":249},"action",[236,602,603],{"class":242},": {\n",[236,605,606,609,612,614],{"class":238,"line":246},[236,607,608],{"class":249},"    self",[236,610,611],{"class":242},".showingScanner ",[236,613,571],{"class":321},[236,615,616],{"class":249}," true\n",[236,618,619],{"class":238,"line":263},[236,620,621],{"class":242},"}) {\n",[236,623,624,627,629,632,634,637],{"class":238,"line":276},[236,625,626],{"class":249},"    Image",[236,628,597],{"class":242},[236,630,631],{"class":249},"systemName",[236,633,253],{"class":242},[236,635,636],{"class":256},"\"qrcode\"",[236,638,639],{"class":242},")\n",[236,641,642,645,648],{"class":238,"line":289},[236,643,644],{"class":242},"        .",[236,646,647],{"class":249},"resizable",[236,649,650],{"class":242},"()\n",[236,652,653,655,658,660,663,665,668,670,673,675,677],{"class":238,"line":300},[236,654,644],{"class":242},[236,656,657],{"class":249},"frame",[236,659,597],{"class":242},[236,661,662],{"class":249},"width",[236,664,253],{"class":242},[236,666,667],{"class":249},"32",[236,669,400],{"class":242},[236,671,672],{"class":249},"height",[236,674,253],{"class":242},[236,676,667],{"class":249},[236,678,639],{"class":242},[236,680,682],{"class":238,"line":681},7,[236,683,303],{"class":242},[219,685,686],{},"Now - we need to attach a sheet to this view - we can add that to the button:",[226,688,690],{"className":312,"code":689,"language":314,"meta":231,"style":231},".sheet(isPresented: $showingScanner) {\n    ...\n}\n",[233,691,692,708,713],{"__ignoreMap":231},[236,693,694,697,700,702,705],{"class":238,"line":239},[236,695,696],{"class":242},".",[236,698,699],{"class":249},"sheet",[236,701,597],{"class":242},[236,703,704],{"class":249},"isPresented",[236,706,707],{"class":242},": $showingScanner) {\n",[236,709,710],{"class":238,"line":246},[236,711,712],{"class":321},"    ...\n",[236,714,715],{"class":238,"line":263},[236,716,303],{"class":242},[219,718,719],{},"Then in the sheet we need our CodeScanner:",[226,721,723],{"className":312,"code":722,"language":314,"meta":231,"style":231}," CodeScannerView(codeTypes: [.qr], simulatedData: \"-\") { result in\n     switch result {\n     case .success(let code):\n         print(code)\n     case .failure(let error):\n         print(error)\n     }\n     self.showingScanner = false\n }\n",[233,724,725,752,760,782,790,808,815,820,832],{"__ignoreMap":231},[236,726,727,730,732,735,738,741,743,746,749],{"class":238,"line":239},[236,728,729],{"class":249}," CodeScannerView",[236,731,597],{"class":242},[236,733,734],{"class":249},"codeTypes",[236,736,737],{"class":242},": [.qr], ",[236,739,740],{"class":249},"simulatedData",[236,742,253],{"class":242},[236,744,745],{"class":256},"\"-\"",[236,747,748],{"class":242},") { result ",[236,750,751],{"class":321},"in\n",[236,753,754,757],{"class":238,"line":246},[236,755,756],{"class":321},"     switch",[236,758,759],{"class":242}," result {\n",[236,761,762,765,768,771,773,776,779],{"class":238,"line":263},[236,763,764],{"class":321},"     case",[236,766,767],{"class":242}," .",[236,769,770],{"class":249},"success",[236,772,597],{"class":242},[236,774,775],{"class":321},"let",[236,777,778],{"class":242}," code)",[236,780,781],{"class":321},":\n",[236,783,784,787],{"class":238,"line":276},[236,785,786],{"class":249},"         print",[236,788,789],{"class":242},"(code)\n",[236,791,792,794,796,799,801,803,806],{"class":238,"line":289},[236,793,764],{"class":321},[236,795,767],{"class":242},[236,797,798],{"class":249},"failure",[236,800,597],{"class":242},[236,802,775],{"class":321},[236,804,805],{"class":242}," error)",[236,807,781],{"class":321},[236,809,810,812],{"class":238,"line":300},[236,811,786],{"class":249},[236,813,814],{"class":242},"(error)\n",[236,816,817],{"class":238,"line":681},[236,818,819],{"class":242},"     }\n",[236,821,823,826,828,830],{"class":238,"line":822},8,[236,824,825],{"class":249},"     self",[236,827,611],{"class":242},[236,829,571],{"class":321},[236,831,574],{"class":249},[236,833,835],{"class":238,"line":834},9,[236,836,837],{"class":242}," }\n",[219,839,840],{},"This just prints either the scanned data or the error message and sets the state so that the view closes. Note that the simulator has no camera access - so you need to set the simulatedData value to something for testingin the simulator.",[219,842,843,844,847],{},"Finally - we need to do one more thing - we need to have permission to use the camera. In the application's ",[233,845,846],{},"Info.plist"," add a new entry to the dictionary:",[226,849,854],{"className":850,"code":852,"language":853},[851],"language-text","\"Privacy - Camera Usage Description\" - \"Used to scan QR codes\"\n","text",[233,855,852],{"__ignoreMap":231},[219,857,858],{},"Let's try - run it from Xcode on a device and scan the example QR code above - you should see the contents in the Xcode console.",[440,860],{},[214,862,864],{"id":863},"parsing","Parsing",[219,866,867],{},"So - we can now get the contents of the QR code as a json string.",[219,869,870],{},"The next step is to convert it to our Config model object.",[219,872,873],{},"We will use the swift JsonDecoder for this. We'll add this to the success block:",[226,875,877],{"className":312,"code":876,"language":314,"meta":231,"style":231},"if let data = code.data(using: .utf8) {\n    let decoder = JSONDecoder()\n\n    if let config = try? decoder.decode(Config.self, from: data) {\n        print(config.clientId)\n        print(config.clientSecret)\n        print(config.userId)\n        print(config.accountNr)\n    }\n}\n",[233,878,879,912,926,932,967,975,982,989,996,1001],{"__ignoreMap":231},[236,880,881,884,887,890,892,895,898,900,903,906,909],{"class":238,"line":239},[236,882,883],{"class":321},"if",[236,885,886],{"class":321}," let",[236,888,889],{"class":242}," data ",[236,891,571],{"class":321},[236,893,894],{"class":242}," code.",[236,896,897],{"class":249},"data",[236,899,597],{"class":242},[236,901,902],{"class":249},"using",[236,904,905],{"class":242},": .",[236,907,908],{"class":249},"utf8",[236,910,911],{"class":242},") {\n",[236,913,914,916,919,921,924],{"class":238,"line":246},[236,915,339],{"class":321},[236,917,918],{"class":242}," decoder ",[236,920,571],{"class":321},[236,922,923],{"class":249}," JSONDecoder",[236,925,650],{"class":242},[236,927,928],{"class":238,"line":263},[236,929,931],{"emptyLinePlaceholder":930},true,"\n",[236,933,934,937,939,942,944,947,950,953,956,959,961,964],{"class":238,"line":276},[236,935,936],{"class":321},"    if",[236,938,886],{"class":321},[236,940,941],{"class":242}," config ",[236,943,571],{"class":321},[236,945,946],{"class":321}," try?",[236,948,949],{"class":242}," decoder.",[236,951,952],{"class":249},"decode",[236,954,955],{"class":242},"(Config.",[236,957,958],{"class":321},"self",[236,960,400],{"class":242},[236,962,963],{"class":249},"from",[236,965,966],{"class":242},": data) {\n",[236,968,969,972],{"class":238,"line":289},[236,970,971],{"class":249},"        print",[236,973,974],{"class":242},"(config.clientId)\n",[236,976,977,979],{"class":238,"line":300},[236,978,971],{"class":249},[236,980,981],{"class":242},"(config.clientSecret)\n",[236,983,984,986],{"class":238,"line":681},[236,985,971],{"class":249},[236,987,988],{"class":242},"(config.userId)\n",[236,990,991,993],{"class":238,"line":822},[236,992,971],{"class":249},[236,994,995],{"class":242},"(config.accountNr)\n",[236,997,998],{"class":238,"line":834},[236,999,1000],{"class":242},"    }\n",[236,1002,1004],{"class":238,"line":1003},10,[236,1005,303],{"class":242},[219,1007,1008],{},"Try scanning again and you should see each field in the Xcode console.",[219,1010,1011],{},"The CodeScannerView now looks like this:",[226,1013,1015],{"className":312,"code":1014,"language":314,"meta":231,"style":231}," CodeScannerView(codeTypes: [.qr], simulatedData: \"-\") { result in\n     switch result {\n     case .success(let code):\n         print(code)\n\n         if let data = code.data(using: .utf8) {\n             let decoder = JSONDecoder()\n\n             if let config = try? decoder.decode(Config.self, from: data) {\n                 print(config.clientId)\n                 print(config.clientSecret)\n                 print(config.userId)\n                 print(config.accountNr)\n             }\n         }\n\n     case .failure(let error):\n         print(error)\n     }\n     self.showingScanner = false\n }\n",[233,1016,1017,1037,1043,1059,1065,1069,1094,1107,1111,1138,1145,1152,1159,1166,1172,1178,1183,1200,1207,1212,1223],{"__ignoreMap":231},[236,1018,1019,1021,1023,1025,1027,1029,1031,1033,1035],{"class":238,"line":239},[236,1020,729],{"class":249},[236,1022,597],{"class":242},[236,1024,734],{"class":249},[236,1026,737],{"class":242},[236,1028,740],{"class":249},[236,1030,253],{"class":242},[236,1032,745],{"class":256},[236,1034,748],{"class":242},[236,1036,751],{"class":321},[236,1038,1039,1041],{"class":238,"line":246},[236,1040,756],{"class":321},[236,1042,759],{"class":242},[236,1044,1045,1047,1049,1051,1053,1055,1057],{"class":238,"line":263},[236,1046,764],{"class":321},[236,1048,767],{"class":242},[236,1050,770],{"class":249},[236,1052,597],{"class":242},[236,1054,775],{"class":321},[236,1056,778],{"class":242},[236,1058,781],{"class":321},[236,1060,1061,1063],{"class":238,"line":276},[236,1062,786],{"class":249},[236,1064,789],{"class":242},[236,1066,1067],{"class":238,"line":289},[236,1068,931],{"emptyLinePlaceholder":930},[236,1070,1071,1074,1076,1078,1080,1082,1084,1086,1088,1090,1092],{"class":238,"line":300},[236,1072,1073],{"class":321},"         if",[236,1075,886],{"class":321},[236,1077,889],{"class":242},[236,1079,571],{"class":321},[236,1081,894],{"class":242},[236,1083,897],{"class":249},[236,1085,597],{"class":242},[236,1087,902],{"class":249},[236,1089,905],{"class":242},[236,1091,908],{"class":249},[236,1093,911],{"class":242},[236,1095,1096,1099,1101,1103,1105],{"class":238,"line":681},[236,1097,1098],{"class":321},"             let",[236,1100,918],{"class":242},[236,1102,571],{"class":321},[236,1104,923],{"class":249},[236,1106,650],{"class":242},[236,1108,1109],{"class":238,"line":822},[236,1110,931],{"emptyLinePlaceholder":930},[236,1112,1113,1116,1118,1120,1122,1124,1126,1128,1130,1132,1134,1136],{"class":238,"line":834},[236,1114,1115],{"class":321},"             if",[236,1117,886],{"class":321},[236,1119,941],{"class":242},[236,1121,571],{"class":321},[236,1123,946],{"class":321},[236,1125,949],{"class":242},[236,1127,952],{"class":249},[236,1129,955],{"class":242},[236,1131,958],{"class":321},[236,1133,400],{"class":242},[236,1135,963],{"class":249},[236,1137,966],{"class":242},[236,1139,1140,1143],{"class":238,"line":1003},[236,1141,1142],{"class":249},"                 print",[236,1144,974],{"class":242},[236,1146,1148,1150],{"class":238,"line":1147},11,[236,1149,1142],{"class":249},[236,1151,981],{"class":242},[236,1153,1155,1157],{"class":238,"line":1154},12,[236,1156,1142],{"class":249},[236,1158,988],{"class":242},[236,1160,1162,1164],{"class":238,"line":1161},13,[236,1163,1142],{"class":249},[236,1165,995],{"class":242},[236,1167,1169],{"class":238,"line":1168},14,[236,1170,1171],{"class":242},"             }\n",[236,1173,1175],{"class":238,"line":1174},15,[236,1176,1177],{"class":242},"         }\n",[236,1179,1181],{"class":238,"line":1180},16,[236,1182,931],{"emptyLinePlaceholder":930},[236,1184,1186,1188,1190,1192,1194,1196,1198],{"class":238,"line":1185},17,[236,1187,764],{"class":321},[236,1189,767],{"class":242},[236,1191,798],{"class":249},[236,1193,597],{"class":242},[236,1195,775],{"class":321},[236,1197,805],{"class":242},[236,1199,781],{"class":321},[236,1201,1203,1205],{"class":238,"line":1202},18,[236,1204,786],{"class":249},[236,1206,814],{"class":242},[236,1208,1210],{"class":238,"line":1209},19,[236,1211,819],{"class":242},[236,1213,1215,1217,1219,1221],{"class":238,"line":1214},20,[236,1216,825],{"class":249},[236,1218,611],{"class":242},[236,1220,571],{"class":321},[236,1222,574],{"class":249},[236,1224,1226],{"class":238,"line":1225},21,[236,1227,837],{"class":242},[440,1229],{},[214,1231,1233],{"id":1232},"summary","Summary",[219,1235,1236],{},"So - we can now get the configuration from a QR code - the next step will be to tidy the code a little, give the user a way to cancel the scan dialog and to persist the configuration.",[440,1238],{},[219,1240,1241],{},[466,1242,1245],{"href":1243,"rel":1244,"target":473},"https:\u002F\u002Fgithub.com\u002Fchrissearle\u002Flommepenger-swiftui",[470,471,472],"GitHub Repository",[1247,1248,1249],"style",{},"html pre.shiki code .s95oV, html code.shiki .s95oV{--shiki-default:#E1E4E8}html pre.shiki code .sDLfK, html code.shiki .sDLfK{--shiki-default:#79B8FF}html pre.shiki code .sU2Wk, html code.shiki .sU2Wk{--shiki-default:#9ECBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .svObZ, html code.shiki .svObZ{--shiki-default:#B392F0}html pre.shiki code .snl16, html code.shiki .snl16{--shiki-default:#F97583}",{"title":231,"searchDepth":246,"depth":246,"links":1251},[1252,1253,1254,1257,1258],{"id":216,"depth":246,"text":217},{"id":444,"depth":246,"text":445},{"id":518,"depth":246,"text":519,"children":1255},[1256],{"id":536,"depth":263,"text":537},{"id":863,"depth":246,"text":864},{"id":1232,"depth":246,"text":1233},"2020-03-03 11:28 +0100",null,"md",{},"\u002F2020\u002F03\u002F03\u002Fscanning-qr-codes-with-swiftui",{"title":209,"description":231},"Revisiting the Sbanken API with SwiftUI",{"loc":1263},"2020\u002F03\u002F03\u002Fscanning-qr-codes-with-swiftui",[1269,314,1270,1271],"ios","swiftui","xcode","LMf7oS_yHbcJVRPwqyuXfT9-fRiwhdNSQlcWp0yL2i4",1780932430665]