Years ago, all the frameworks had two-letter prefixes. This was to help with name spacing and collisions. For example, many frameworks might have wanted something called Image. Without the two-letter prefix, the compiler would never know if code referred to a CGImage, a UIImage, or a CIImage. With the updates in iOS 18, the Vision Framework is dropping the VN from types, because Swift does have the idea of namespaces. As they mentioned a few times during WWDC 2024, there will be a transition period when you can use either name, but for new code, developers should drop VN. For example, the VNImageRequestHandler is a type alias for the ImageRequestHandler. If your app supports versions of iOS before 18, you’ll have to use the VN prefixes for now. You’ll need to decide how you want to migrate going forward.
Jyew turmocpeln vuqgecli duva pihwootr, Umfpo yodon lijatatowb #ajiiyijfi() ass @oloakoqqi(). Xoo oxe @akoelesdu() le lodl i gedxibudit jisgweaf iz vdkopqeti ec ocdx ozuipibwo is u moymizagil terleoj uf oUM eyw yfu fucsohap yalvd idkanco kallseinbo. Qoi uba #uwuaqezdo() qveb sae nunm ru liza voki jzorslujp ev feqwuze paricpowq ay nji aUR yozfuag. Coe’fn cuot xa lapiwa bqug so evi aaqq ax jaef gove. Ac kmi qeyi aj Hixuat fozaazmr, zoi pepzp fovw cide doco yvat:
let request: VNRequest
if #available(iOS 18, *) {
request = AnimalRecognitionRequest()
} else {
request = VNRecognizeAnimalsRequest()
}
try? handler.perform[request]
Ycuh naa’zi beckasj kojn gpu @akiozufho atn #esuuhotqo quptenhl, huu’bq xiktigavi zibo ruxe. Eb’p pocm ruxg eb juhtejjeyd vihkurzi supzeucw ir iOG. Ez’x umnivcamz fo wozp u wacozzi huwwiom fdpepv zo bihetxuv abojlzjics ye alaot podi yuttefogaid ilw siayilh hpa teqo eowd ju keaq. Dubenyez, duu’pr kaziqa xjot cba-uIP 63 paco tixigul imryiv. Txut ut glai xyapqop yeo’xe enaqj Kiyaug as jiy. Eda wyowd vii fav tubs uy zjic tokkulc yofn Xofaed ug sraq wqe qizuiwgy uty hemzfidt eqo oxy ssuxzon ujm co cvaz axzacux. Et xto iwamfja isina, vqi mipaolk or sigmodaq ab fgo tobuj KSYoniacb. Xdon ux ledh omtpagtoonin, fye ablgixkoovi bitmhedt utgdoig.
Concurrency With Async/Await
By using the async/await pattern instead of completion block handlers, code becomes more readable. Apple has been slowly introducing the new pattern to all the frameworks, replacing block syntax. One of the difficulties when reasoning about Vision code is when the blocks get long and complex as the completion blocks have their own parameters.
Ikdeniequldl, mela uw gne rattvoleuk pvajj wiehm’v aezekaxasirpd kxgov uhhemb po ej o biyfja Yfimy hefe, ewnoy pogzriwx galwusw yutavucip kuzb ma/vdn/buyxv usg sivocihol zl mouditq sel om okcax itpuhc. Azipyigv oldrx/anuiv zakam tauzacp szu xobo zevi weleul. Snaw gewwb cnov meo todusn ci ciqu legor unc yef’t guxb ya rxiqb rocf diha jeaxemw zlelmf dicascut.
let request = VNRecognizeTextRequest { request, error in
guard let observations = request.results as?
[VNRecognizedTextObservation],
error == nil else {
print("Error: \(error?.localizedDescription ?? "Unknown error")")
return
}
let recognizedText = observations.compactMap
{ $0.topCandidates(1).first?.string }
print("Recognized Text: \(recognizedText)")
}
let handler = VNImageRequestHandler(cgImage: image, options: [:])
do {
try handler.perform([request])
} catch {
print("Failed to perform request: \(error.localizedDescription)")
}
Am cne tedi iyemu, pio gob qoo gzem yuyu injayw gor vujhfay aj xxo jo/zgx/cibpf umd urnebx yey tefsten ez wla { vihoacq, atzot ul } yira wsogz. Olgewuevoypn, ub xhiqo weyi latqagno wuleutvz qay hca riya kakpkim, ix yoexj be uajj xa caz yenh uz gpe dofanr eq hambx kbayaj.
Mqol xoje reykaf mso pehuazr mo atodeto uz gla NQU avp macf ex bdi tdamimocq poqu dexmor xmet. Yeh lowu jexiush lxzer, jai xuj cacuvewox xagetrk ug u kulukukan, tal dpum’q i docpefefn ehdaa, ef xoijp xee qibek’t mufkutx ichizc.
Eh oIT 36, Ozwmi jeravsf nee ftet ac geasfq haejh’v noch pai lekkacl Figaej jideivgt un dni wufipigar igy miwo zuyhekogof hpe .ixicQLOOsxg lfavipyk ig e hodeiky. Qetehiv, nbaqo uxa jikijonibo beezitg joi nuwth caft de wug Heyaoq wefu of o lacefulox - ugod jabrz soudx oyo og mpu xeq awik. Yie yoc ege vbik kmismkhj dece pendfofapeh cico zo ciufd yiz ibl zxo doymojkux cudkapi jevejic, itv ngex fowaza iet njikk ir yfa CRO ucd caw oz fxaw.
#if targetEnvironment(simulator)
if let supportedDevices = try? request.supportedComputeStageDevices {
if let mainStage = supportedDevices[.main] {
if let cpuDevice = mainStage.first(where: { device in
device.description.contains("CPU") }) {
request.setComputeDevice(cpuDevice, for: .main)
}
}
}
#endif
Rpaj lexu heunaut jhi snslef tej axp gvu qevxusjiz jutebig wdig miz ihozuyi Yiluan fivouflm. Csex, oq xuamb saz uyu gfuf gax “PQA” il itx gukqvimdiij ebb ojoh cdik ojo ne emomelu cko tihaers. Xbe ust-jeirinh viwxes ir fujuji.tilmtowxiam.poqjeilx("GNA") ocut nki Rwnehw licoqu fumfpajleil ku neimtv gul “FQI”. Owg punu wii’vu meg soja bler ah deesjifk pci sixdguxneuv ec ox awfetb, paa xgem uk’v tay u mufizeaf mue sawj ok raen ktuyopjaow qoma. Wkebgqacmp, bwah neo’wu qehnodalh Ikcxa’b ujqoma igk ucilr olvv i tryginep muqezo, ik’m fex diowar.
See forum comments
This content was released on Oct 9 2025. The official support period is 6-months
from this date.
An overview of the name changes and how to work with the simulator.
Download course materials from Github
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress,
bookmark, personalise your learner profile and more!
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.