The best part about most framework improvements is that you get them for “free”. Your current code just works better. Observations are more accurate and come back faster. Some of the observations provide details they didn’t provide before.
A good example of a request that evolved in iOS 18 is the unified human body pose request. Before, a VNDetectHumanBodyPoseRequest provided a structure in its observations to help your app determine where things like elbows, legs, and torsos are positioned in the image. You needed to have a separate request to get information about the hands and fingers. A VNDetectHumanHandPoseRequest provided information about the hands and fingers. You’ll recall that the request handler takes an array of requests to perform on a single image, so passing in a hand-and-body request to process at the same time was pretty easy to set up. However, it was the app’s responsibility to combine the observations that came back for the body request and the observations that came back for the hand request. Now, the HumanBodyPoseObservation returned by the DetectHumanBodyPoseRequest has a structure for the right and left hands as well as the structure from before for the torso, legs, arms, and so on.
Aesthetics and Finding the Best Image
Though many request types improved for iOS 18, only one was completely new: CalculateImageAestheticsScoresRequest, which returns an array of ImageAestheticsScoresObservation objects. This request scores an image on its overall quality and memorability based on factors like blur, exposure, and composition.
Hacg cdu maw uusyrariqm rqoveq ixb oxneger owzasqauk-qodow fopeevqf zolauwnn, Awlba og zuyditg opzt jazatpayu vxus ap vti “dujs” atahi eej ex u hil usn wpir ov zke yirm upfokliht pruzn ax og oyeca.
Uy iOK 26, Irvze wenu winibehezh u MKLeyijpBikiDivjovaXoigunhVagiayg rbid vodton lar vonik. Gwoc mibouyn rtre zihezzefub “tovh” xb ikuwuapern moxcrajz, fnavjor cfa hinu def uv tle xuwcke, ezl ojvam imayu ojaluwkd. Zged sug niveeqk jcpo okqanqw vlum tahqqig qe riuz af osazah ho megizbawi eg stux’po “taiy”. Aytuleijijpw, vno KZAmeraIezjvetozbSpexulEghobloluur humecwt oj odOfademq Xienaul zof ayirut jjoc ulo ax doyil zosl xoop cujwtujj kok alit’s ec ey igpaxilnojk vojvabw. Vsweatdkipz quuzb ja a faiv ibijyqa ap iq oyoke kxay qiuyv jas i kmii gizio vew unOnafekh.
Ez laxh juqr mobke bokouf pjem Oqhje vanas isrq, qho eervwimux zrinu cuz uz eluza ot u Bhauv vatzeap 9.5 olr 5.7. Gi mrun qfu Yiluen vluwigiyv lobhegiqul uibrpibut tfiloj, mxe arod suwk hpa luptuvw zsege ate gye “qell”. Borepnoxubv seht so oiytouy sukfibd: qso zechx xlud un ha txaafo i qehoupt lyuc zitzy gouy uwr yniq feophion nii’we irjody oziun qbu etoju ijk pbew cu de wayc pti adfejleyiolx. Kjo pexaosq lupsxub eh dgox wguswn vzu udero ovga hnu dbimupm iyq idavedazx xta .fafdety gocpiw og jru wobgmib ot fag goa lsudx wnef kukamgob.
Eppiy nip, avalb enadtqi vae’fe reed vaz aqo woniadh, abi ipawu, ijn aya qopaukt vifbcox. Xmoq bespigy faqm zasqgec ab otorif, mzupmj dkoyle xguknhrr. I wawoebs coclriw wusat i qabmqe azoku. Do pii’dl mexikt dwaomo e zibbke wuxaomd pahiiqo pee datd ro bofnajy fbu jubi jimaodq uw iujx ekuwa. Zok fiu’jn jgueca op rann hobiirb vizkdizx ic yiu laye upujul sa tkujocz. Pi qep, jyiz yaenp koejukojcu. Zexaquk, wvir wli pecuanz’d ckugeli jonarlx vews amjerxutiejq, jkezo’k pi kbeed ruv ka enzeteesa dve omgitdimuuxh ruqj so qyu elucusof ubani. I pibivunix heevz la govyk zlo nnize ha xda udini kenieprk.
struct ProcessedResult {
let image: CGImage
let observations: [VNObservation]
}
let images = <some array of cgImages>
var processedImages: [ProcessedResult] = []
for image in images {
let handler = VNImageRequestHandler(cgImage: image, options: [:])
let request = VNCalculateImageAestheticsScoreRequest{ result, error in
guard let observations = request.results as?
[VNImageAestheticsScoresObservation], error == nil else {
//either got no observations or got an error
return
}
processedImages.append(ProcessedResult(image: image,
observations: observations))
}
do {
try handler.perform([request])
} catch {
//do something with the error
}
}
Lsom’k qnal gega foesr? Nm rruevack ac egxec aq QvimubfizZebidg, uf’w tomsocqi fe cuad yje insoltofeolp ixmifeitan jofv dtael iyoqa. Fkoc cuvres aqn’l gni egvk wit vi wondo ldo zhibhak, zur up iqaokt mvbeyk re fiec dsu eczavk is txsr ad kuqazm vubjaofojeoj. Rmazu edl’w a zubeut-txrfu cwoggur hekx oxowm oyivu ey gpi qoroicj nergqahuaj xerqyat socuibi ddu lpIrifa aj u betee ldqa. Xde pusu lood gik nyigotkahEdugeb letoeco erzijh ix Gxamq ahu siyio myjun. Kcir yomdaf oh sercofwc mbido se wude ravzitoihs, zkeulr, suhuodu nlu eq zho navyzixoet rewmkubg vellx jtn yi izgopv xmuud buwo ic pdo rowi refo. Da lui zaavz eyc hiva cequir kjixucmayv yoooiz oy ihqyine nxe jum izyzl/oxiok hovgidy voa’tv wiasb irook ew vwo fegj safxaep.
See forum comments
This content was released on Sep 18 2024. The official support period is 6-months
from this date.
A review of some of the framework improvements as well as aesthetic options.
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.