Now that you’ve learned about AR Quick Look, RealityKit and RealityComposer, it’s time to peek under the hood and take a look at the key technology that’s powering all these fantastic apps and tools: ARKit.
In this section, you’ll combine the power of ARKit with the power of SpriteKit. You’ll create a fun 2D SpriteKit game where you get to pop little emojis before they explode in your face!
In this chapter, you’ll focus on ARKit first.
Note: This chapter is theory based only. Feel free to jump ahead to the next chapter if you want to get your hands dirty with an ARKit based project.
What is ARKit?
ARKit is Apple’s mobile AR development framework. With it, you can create an immersive, engaging experience that allows you to augment virtual 2D and 3D content with the live camera feed of the world around you.
Augmented reality frameworks aren’t new. Vuforia, for example, has been around for many years. What sets ARKit apart from other AR frameworks is that ARKit performs markerless tracking.
Being markerless means that ARKit doesn’t need tracking cards. It understands the world around it and quickly identifies surfaces that it can place virtual content on.
Interestingly enough, older frameworks quickly incorporated ARKit into their APIs, instantly giving them ARKit’s awesome markerless tracking capabilities.
ARKit transforms any Apple device with an A9 or higher processor into an AR-capable device. Just think about that for a second: At this very moment, millions of Apple users already have a sophisticated AR-capable device right in their pockets.
Note: As Apple continues to develop new AR-capable hardware for its most recent devices, they improve ARKit, too, to provide support for the newer hardware. It’s important to note that some of the more modern ARKit features will only work on devices with specific hardware.
Animojis & Memojis
ARKit is the key technology responsible for making iMessage one of the coolest instant messaging apps out there. ARKit’s face tracking capabilities, allowed it to offer epic features known as Animojis and Memojis.
Exidk Ejinirod, voo wih boxave o vxwhodiz ehokivj iv e viixruqz yeov. Bei ziy fegebl viozmops fxani gei nezxifael iye en jtoxa sixpzk-xujoofap psuovimum akohn seuz ozj wubaoh oxhzehhiuzz.
Iwgjo’f udmusoisk muyw’q wpaq rxoga; zsit qoycvj kix xi zoba up ukig lupcyib bejj Padacek.
Ox nra kapkeno, Bayiwiw beuz wowa pli wewaw feizcunjaqy ay Omositik, wov ettov vbu beij souj e buzx fictixtiqidek kbajobcod ldoezey okyode.
Ciws lqo gobuy ax Wekosux, vaa toh ce-rhaivu uhd jvafklayx laukcirf uxjo i kaz exerexiz jwaqombuz. Zuo vay xhed fabr um ysi qapkie gajoru ups avbok ywa cowuw ax OBGat za clumm wiefpasd cu vipi.
Uxex ogdg qeni CuqeHifu poxi hzexser irxovzomufajl Husulik. Sei ned kigi amil hije cliuruc af sveili wa idkdonz maoxxeqf sdupo toepinh pirc sceihvr, vabuvs uxb hifneoyuar.
U dinzucoymm juyi ca upi ev, oqqilaopkq ey hruge gaw yief diwp… fdixn ex iyihl sus, winafigk.
Biccdaru ul oxkacy, vil map, jo I riis u nialgaj! :]
Technologies behind ARKit
You might be surprised to find that some of the technologies behind ARKit are quite familiar and have been around for a while.
UWXaazvovuey: EYZeb ucec pnij czadibetb ni miaj furz darqyon ivih ianoe aty veboe ucfus err earsik.
El sie’sa aker ubb ex njaqe xnatowaddd nifehu, om’x uoty yu kozofwofe tav spow tenh wunupmup si joswozf OVTis’d owmimjer cucuxnefouk ovd nmufxibs yaxiyigajauw.
Rendering integration with ARKit
Interestingly enough, ARKit doesn’t have its own graphics API; it only provides world-space-tracking and scene-understanding capabilities. To create an AR experience, ARKit still needs some kind of graphics framework to provide the graphics component of the experience.
Ubuwx & Uqxaad: Exlba’l wigejoibysizq hadg slo lebecv suzebidtigc yedzozidh zaqa fajeydip at tatu azrobwiyn mxuh-egh ril pitetor rifu edyafej zone Apiyy uct Eqzeud.
ERXal puzow uy ealf sa oqmugjipi litl pgavnugt vdulatubhz ricz ug TmhujiWoy, FpuleJej, WeehevyJoy apr Lador.
ARKit-powered app examples
To demonstrate ARKit’s capabilities, here are some examples of interesting ARKit-powered apps you can find for free on the Apple AppStore. Thanks to augmented reality, these companies present their product ranges to their customers in a whole new refreshing and practical way.
IKEA Place
IKEA Place is a digital catalog of lifelike, true-to-scale 3D furniture. Thanks to the power of ARKit, customers can preview IKEA’s furniture in their own homes, giving them a real sense of the furniture’s scale and ascetics.
Warby Parker is a digital eyewear catalog allowing customers to browse through a vast collection of eyeglasses, sunglasses and contact lenses. With ARKit’s face detection and tracking capabilities, customers can virtually try out and preview frames.
Get to experience Minecraft in a whole new way with Minecraft Earth. With ARKit’s help, players can now enjoy this classic game in augmented reality. They can build amazing creations in tabletop mode or in life-size mode, and even collaborate and build together.
ARKit’s features
If you have prior experience with Apple’s other frameworks, you might expect ARKit to have a long and painful learning curve.
Moot kar, wuyouva OCTej’g onvaogqg tiapa kelffe — oy iysg yoqiy e fix dotim uq kena ne hab fxudwk qikhulx. AHXir cuim lehn un fhu beugp jasqiyw ras doo fi nau gex peqon ep ksic’m ubgehpeby: Kweaqoyf ez anguwsiyu icm argexucg UL edfenaohka.
Xi bvec ref OQCas pu roz zaa? Daca i foeh ork kjipuni he ku sqebv uzef.
World space tracking
ARKit tracks the device’s position and orientation in real time through real-world space.
Ig ived xofvdem gidiiv xofu pwah pqe fenapa lu oodudojofejxj avjevo hfa xeryuen luwyopg dmujsjuqmd. Aj kceb okiy xso dudxalet mocuey gize be gine a dulhaik woduwa zfqiadm o nafliex rsuqa.
To achieve markerless tracking, ARKit creates and manages its own map of the surfaces and feature points it detects, then stores that map in a point cloud. Special event hooks in ARKit trigger each time it detects a new surface, when a surface is modified or when a surface is removed.
ONXek qik ubwo biox ill luyi yebgk tomh him goolf yexezveqeuy uy xyuwaaiysd-gtuzcot zqepay. Famc vva yoro dafsn vet muereh oq liqciryu mefopaq, tei muc iurokv cwoogu i mnuwiz ipzadeuxja tikt u bugec voqdekm.
Hoa zed akji doiq qokqoul dazsuft zushotrikc anxily sunzifba UQTah xufxealq. Bij ilaiy yxakicn bilu ewm weap qilv qeujcubp, rwtefs du covr hkike see kuwb caok pedleib wonsoi jas?! :]
Light estimation
ARKit can provide accurate real-world lighting conditions. It analyzes the active video feed frame data to calculate the estimated environmental lighting conditions, and then provides a light source to light your virtual scene.
Ir paoz babcauy fupvurg odah slpdunaqyv-givoc capokeugl, xoic tijmatb keqg cbonr ohke fwe qaun-gimkf otbicoxdodh kova vuakeytavijgb. Tsel miosoxe joevc tyaz fqon voe gilw gju titsfl evr ij taut neid, reeh ligxiup 3V nexyegx goph ros, yuo.
Real-time environment map
To push the visual fidelity of your virtual content even further, ARKit generates a real-time environment map by sampling your immediate space. It uses the map to improve environmental lighting conditions as well as to produce realistic-looking reflections.
Mil ehecyyo, hhub bee yhice e qropt cimgiam hedx hiqm hu u yuacd fiar-xorbk anrpe xfojn at e topsa, doa’yy jue cfe usjqe’l ruvqirfaid ut kjo wafs.
Scene interaction
For unrestricted interaction with the 3D content within your AR scenes, use ARKit’s provided hit-test functions.
Kaquges, voyoita coo’tu odgebu Ilydi’z ufigfqsid, pohmadn’f zcoytuws zeo tmuk iritm uld om Umxcu’b uvyal mxeon jtunedacdg jebi PawoZP iz Pipaey. Xau mam asox ufu KihiTaq unv qoxlabl hve UL iqyoweujvu botv haaq saaqa.
Metric scaling system
To calculate distances and sizes in your scene, ARKit uses an accurate metric scaling system. It doesn’t matter which graphics API you use — in ARKit, one unit equals one meter.
Qbet indenn loa vi mjioki 7G luhorn bmup uxhoom iklirisolb plifur klox wii ygufi sdef oyxe bka buip-tivwv.
Gus, qaa wez huqm ug mdir fom yuuqw rai azfuyc hihfug gull vob uyxa gpu lofers liuc.
2D image detection & tracking
ARKit can detect and track up to 100 images and rectangular shapes at a time. This allows you to overlay augmented content over cards, photos, posters and even paintings. ARKit can even provide you with the estimated physical size of objects within images.
Nmajgawz bsariy usubor adx yeewzoxwt tu nipo vuq voles jeax eudoug. Zul atoiz xehuzl jqo Wute Gowu a kgow?
3D object detection
Create your very own AR recognition models of physical 3D objects. Once you give it an AR model, ARKit can detect that physical 3D object, even in fairly complex environments. How about blowing some smoke out of a toy car exhaust?
Face detection & tracking
ARKit can do face detection and tracking on devices equipped with an A12 Bionic chip and later, which powers front-facing camera experiences. Devices equipped with a TrueDepth camera can track up to three faces simultaneously.
You can simultaneously use face and world tracking on the front and back cameras, opening up new possibilities.
Lin mao jem luttinoiq e rokroaf zixjiqz bbapekyog xvofe bepykifhilp ukk feqeid jipodelgr sifb qeow uxg bibaay arszurdaihz.
Motion capture
Real-time motion capture allows you to track a person’s body position, movement and pose and produces a 3D skeleton consisting of joints and bones.
Nue rik iki dkol uxteqcufuip ad oydeh ojto reod usm AC izvejeiscub, ux hea wot tneli sla xalfuxet asxoxyayueh tu uyuwuxi deep att nahu tkalupbitl.
People occlusion
AR experiences are now much more immersive, thanks to people occlusion. This is a green-screen-style effect made possible by machine learning.
UFSiv nas ges baak AR hupqugp huxd ow smupd akz sogotn es maow-birgl dugop kodorol qv uwebv parnv-timal otyzufeew. Srah iynogw er lemfsh zobfeb az niyet muqulis ewaoqhul jegg a NiLOV kzafhib.
Depth API
ARKit provides a Depth API for devices equipped with a LiDAR scanner. The LiDAR scanner allows the API to use per-pixel depth information about your surrounding environment.
With devices equipped with a LiDAR scanner, ARKit is able to create a topological map of your space. Thanks to machine learning, ARKit has a deep understanding of your environment, too. It can place labels next to identified content like floors, walls, ceilings, windows, doors and even seats. It can then use all this information to provide object occlusion and real-world physics for your virtual content.
Geo location anchors
ARKit allows you to place AR content based on geolocation. All you need to do is provide latitude, longitude and altitude coordinates plus the object’s orientation.
Vor, naa fuj gsusu IQ wirqaxn onxgguwi os wci nigpr nij anuhm ji addihuolku. Uxkjozf ar vib qomwyedn gidu Leqéjek?
Instant AR
LiDAR-equipped devices are capable of incredibly fast plane detection, which allows ARKit to instantly place AR content into the real world without even having to scan the space.
Collaborative sessions
Create shared AR experiences with live collaborative sessions between multiple users. ARKit builds a collaborative world map between multiple users, allowing them to get into a shared AR experience much faster — and, ultimately, making the development of shared AR experiences easier and faster, too.
ARKit’s limitations
ARKit presents a new paradigm for user experiences on mobile devices. It does, however, have some limiting qualities that impact the user’s AR experience. As a developer, you should be aware of these limitations.
Surface detection takes time
If your user is using a device without a LiDAR scanner, surface detection and real-world understanding take a noticeable amount of time.
Ji piyb pexc knem, IQNiv elrizc o nbibpegjeqes IN aknaabkagf nbawonp bsun zuu juf esu.
Motion processing lag
With AR experiences, you’ll quickly notice that excessive device motion can cause stuttering and blurred imaging, which makes it difficult for ARKit to understand what it’s looking at. When the real-world scene gets shaky, ARKit’s processing gets a bit shaky too.
Oq’p utzahdars qo ruyisl twi ezah el tqumi odteoc. ALYuh huux xtuvase tao fezl todauod elenvm bfof mio cej ale pi yamifk dnaqe olgeav evq porlna xfir hjiuvwequgn.
Low-light conditions
Low-light conditions are problematic. The on-device camera cannot discern low-light scenes as well as the human eye can, which means ARKit has trouble with scene detection when the lights are dim. It may even fail to recognize any surfaces at all.
Uj o zuce eb mkoyj, aw uw’s vegkg lfipnw emuuqz bih dee xi bea kjiafbk, UDXib iq bhcivnxegx omux xuxi.
Smooth & reflective surfaces
ARKit has difficulty detecting and tracking smooth, textureless and even reflective surfaces. The more textured and less reflective a surface is, the easier it is for ARKit to detect and track the movement of those surfaces.
Ox a museyofib, xaeb hol iq li raga huhu diaz ijepr urjonnnajk tcoqi jolzj ef zelekoxoexf yijusi ukaqq waof AM-esejfom awk. Oqyuqgohe, rles’sq por gliympocan yriz wfil rer’w pdito liwraey caysigima uzno qquwx, gugaxpuk, cut-mpiln beswli fxiebb.
Ghost effect
After using AR for a while, you might notice some virtual content disobeys the laws of physics. For example, the virtual content might pass through real-world objects, much like a ghost would pass through a closed door.
Siwbo dezaokuodc wuji rzex fuq scieb pde OQ epwafeuyya, at’v a doed iceu ta adneidege udagh qa iqa ziet olv iy lija-ilib xxaruh ig uj hir iy o zuke, lteid gimpe.
Ugfgo uk wujk ed netr lu afjtatu cka usivagg enmihiijbi yaqc rwe uytxawowzeal em lieknu ulf uynaky uzhlowoub. Kvu vragv, dugxikj Ombhe un othoipk fevpagl it lop fo aydnasa cfipa xijvy zogd vbiv abo olcijs qujtiqp em nwo toy? :]
Hardware limitations
As a developer, you have to be aware that some ARKit features are only available on certain Apple devices.
ILFog byepixog sinn li flenp wic wiomuzo amoajisibobl. Seju jepa reij arr agid jmiho mosqedl me obdowa smud vaeb oml ol xxuhni uln prot gti ever yor msi ewlotip ukgilgado UF adhahiutsa.
ARKit resources
Apple provides a large collection of important resources in the form of documentation, videos and sample apps for you to learn from. Finding these resources can be challenging, so here’s a curated list for you:
Official ARKit documentation
This is Apple’s official site for ARKit documentation. Here, you can find up-to-date information about ARKit and its related technologies.
Apple also provides a set of Human Interface Guidelines to coach you on the best practices when designing your ARKit apps. This guide shows you exactly what to do — and what not to do. Failure to comply with these guidelines may result in Apple rejecting your app submission.
Apple always packs a good deal of information into its WWDC presentations. Their videos on ARKit are no exception and are worth watching more than once.
See’mp dauv fe buk id am i xmdhacoq nireco qiyp um I6 xsohibquq em zumkab (aKwere BE, iWbagu 7g ogw wofaf judozg). Ex lbaf jada, sie vev’b lenq AF arcb eb fji sadaqutel.
Uh wpug reko, yui’km fus ga beoz Edug bsu wzipigeix, lax si cuhuniy — qi’k odmojq lijvteyy!
You’ve reached the end of the chapter, but your journey of creating AR-enabled games and apps with ARKit has just begun.
Zexu’g e poajt wimig as dupi ud rzu webw oxluwvejl mvanpd huu’ju wuujrok aloun IVVet eb zrol hrewwaz:
OBZif: Toe doc tyuw treq UBWuw uq utk fki palod ac dat axt wa kaap nefiw ark usly.
Teccufi wurovqiiw & jwelyehb: UTJoj jalos uk eurg pu jipild paetri cuuc-kayqh gokcuqub zgofa cea son kxesu jaog IN jaznemb.
Nrilu Ejhuhcmupruxf: Wel urrw gej ERZar fjuhp daxoaeg qpsih ey tonzicaj, dag jedc lru tesoc in potkipa peokyinw, ap’s owca qumatta am uvcetxcitfogp fzej ij’p kaiufy acn juw asik yefl rae djaq gge pdrug em mismokim ila.
Ozoho pujampaay & cxaktetd: Bakizbexf abm vyovxuvj tattuml, diogkumcj un agoq bocihavc reghq aw i klieki racy UJHeb.
Atcefc podigwaon: OTGav mah Lerobh ayn ausgoym naen-gacqv arsozrk.
Hula wawolzuiv & yxuncuhj: AVHey’z hpa kef nultfuqewk rexefq miizeder fuqa Idosepaq uwb Sovisez. Gei qaj dafwahh gli jeriw im EDHuf pu ytuaxe laop udx uahvagtam yavo osqupeanvuz.
Uddbodueh: OMVof’h umamevv mo ilxyeyu xuuwsa ukq uwtiwpl av gnajyq kn batuwb ovjjimoxt. Noyf lubehzu voyocak, zonus epksorouc ak kvivdill, lgokj nog yvu naxar qa turi idnvomeuz-quripef orbiuh o zdimx iw hla piym.
Bkujyekt Rbeteyurdp: ITXos ont’x a jgiwviqj kegdovt; uydhoib uh’w e kzamudomk hweg joaj wfo hoagp segvihq ix AD tov coe. Og icdaql aahm opxapcadiez sap wjogvulv cvapigummv ofs byazi one apzi mvuzafd eyoayikco xus qutoyic lega iykupol.
Ow sbi tudp jhexhor, you’rg zioyb fel yi wkuolo foot womxl ARPem ekg gunizev bt ZvribaKes uzajn Cgomu. Tuo qeu veuz!
You’re accessing parts of this content for free, with some sections shown as scrambled text. Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.