{"id":5538,"date":"2023-03-16T00:00:00","date_gmt":"2023-03-16T00:00:00","guid":{"rendered":"https:\/\/hedgehoglab.com\/how-to-get-started-with-uicollectionviewcompositional-layout\/"},"modified":"2023-11-06T09:54:18","modified_gmt":"2023-11-06T08:54:18","slug":"how-to-get-started-with-uicollectionviewcompositional-layout","status":"publish","type":"post","link":"https:\/\/hedgehoglab.com\/how-to-get-started-with-uicollectionviewcompositional-layout\/","title":{"rendered":"How to get started with UICollectionViewCompositional Layout"},"content":{"rendered":"\n

If you\u2019re looking for a faster and simpler way to create dynamic and flexible layouts for your iOS app\u2019s collection views\u201a then UICollectionViewCompositionalLayout might be just what you need. With its declarative API and powerful features\u201a this layout system allows you to easily create complex and customisable layouts in just a few lines of code. In this blog post\u201a I\u2019ll be going through a quick-start guide to help you get started with UICollectionViewCompositionalLayout by creating a simple paging layout. So let\u2019s dive in and get started!<\/p>\n\n\n\n

The Problem<\/h3>\n\n\n\n

The objective was to design and develop a user-friendly vertical scrolling list of paging layouts\u201a which should allow users to navigate through the list by scrolling horizontally. The design should provide an easy-to-use interface that allows users to easily identify the next and previous items in the list\u201a which should be partially visible even when they are not currently in focus. It had to be both efficient and responsive\u201a allowing for a seamless user experience across all devices. We had decided to start the project using SwiftUI and wanted to keep components as SwiftUI native as possible and reduce the use of UIKit.<\/p>\n\n\n\n

We decided to use an HStack with DragGesture<\/b><\/a> to mimic the effect that a UICollectionView\u2019s horizontal layout provides. This worked fine standalone but we needed 3 of the horizontal layouts stacked vertically in a ScrollView. However\u201a When we start dragging within the HStack\u201a the drag gesture seems to capture the touch events and prevent them from propagating up to the ScrollView. This caused the ScrollView to stop scrolling and make it difficult to scroll across the content especially when dragged along the angles(orthogonal) in both directions. Now\u201a it would have worked fine in case we only needed to show one carousel outside a ScrollView.<\/p>\n\n\n\n

\"[object<\/figure>\n\n\n\n

What is UICollectionViewCompositionalLayout?<\/h3>\n\n\n\n

We couldn\u2019t move forward with the gesture issues in SwiftUI ScrollView\u201a so we explored using UICollectionView.<\/p>\n\n\n\n

At WWDC 2019<\/b><\/a>\u201a Apple introduced a simple and powerful API for building complex layouts. UICollectionViewCompositionalLayout<\/b><\/a> was made to simplify the collection view layouts using a declarative way without the need for nested collection views to maximise customization. I\u2019m not going to talk about UICollectionView in detail\u201a but here are some helpful links:<\/p>\n\n\n\n

https:\/\/developer.apple.com\/documentation\/uikit\/uicollectionview<\/a>https:\/\/www.kodeco.com\/18895088-uicollectionview-tutorial-getting-started<\/a><\/p>\n\n\n\n

To build a similar layout using a CollectionView\u201a we would have had vertical scrolling sections with a horizontal UICollectionView in each section. Here\u2019s the interesting part the UICollectionViewCompositionalLayout<\/b><\/a> lets you build the layout without adding nested UICollectionViews. It does that by introducing Groups.<\/p>\n\n\n\n

What is a Group?<\/h3>\n\n\n\n

NSCollectionLayoutGroup<\/b><\/a> is an additional layer between sections and items. It determines how the items in a collection view lay out in relation to each other Horizontal\u201a vertical or custom.Each group specifies its own size in terms of a width dimension and a height dimension. Groups can express their dimensions relative to their container\u201a as an absolute value\u201a or as an estimated value that might change at runtime\u201a like in response to a change in system font size.Because a group is a subclass of NSCollectionLayoutItem<\/b><\/a>\u201a it behaves like an item. You can combine a group with other items and groups into more complex layouts.<\/p>\n\n\n\n

\"[object<\/figure>\n\n\n\n

Implementation<\/h3>\n\n\n\n

Enough of the theoretical part\u201a let\u2019s see how we can achieve the behaviour we want with the help of the layout.<\/p>\n\n\n\n

Let\u2019s define our item\u201a we want our item to have same width and height as the containing Group. So we provide it as .fractionalWidth(1.0)<\/i><\/b> <\/b>and .fractionalHeight(1.0)<\/i><\/b>. You can also provide the absolute<\/b><\/a> or estimated<\/b><\/a> size of the item.<\/p>\n\n\n\n

let itemSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0)\u201a\t\t\t\t heightDimension: .fractionalHeight(1.0))let item = NSCollectionLayoutItem(layoutSize: itemSize)<\/code><\/p>\n\n\n\n

Next\u201a we define a Group Size. For the width of the group we provide it as a fraction value of 0.90 with respect to the section. Since we want the item to fill 90% of the width of the section so it makes the last and next item slightly visible the item inside the group will fill the group completely so we don\u2019t have to make any changes there.We provide an absolute height for the group\u201a it can be anything but we\u2019d like the item to have a square appearance so provided it with height equal to the screen width minus the left and right margins.<\/p>\n\n\n\n

let groupSize = NSCollectionLayoutSize( widthDimension: .fractionalWidth(0.92)\u201a heightDimension: .absolute(UIScreen.main.bounds.width - \/* left and right margins *\/))<\/code><\/p>\n\n\n\n

To define a group we use horizontal(layoutSize:repeatingSubitem:count:)<\/b><\/a>\u201a<\/b> pretty straightforward\u201a we want our group to be horizontal and it will have one item.<\/p>\n\n\n\n


\n\n\n\n

let group = NSCollectionLayoutGroup.horizontal( layoutSize: groupSize\u201a repeatingSubitem: item\u201a count: 1)<\/code><\/p>\n\n\n\n

Next we create our section with the group and initialise our layout with the section<\/p>\n\n\n\n

let section = NSCollectionLayoutSection(group: group)let layout = UICollectionViewCompositionalLayout(section: section)<\/code><\/p>\n\n\n\n

Now that we know how sections and groups work\u201a let\u2019s go ahead and put it together. We\u2019ll create a static var in extension of UICollectionViewCompositionalLayout\u201a horizontalPagingLayout<\/b><\/p>\n\n\n\n

extension UICollectionViewCompositionalLayout { static var horizontalPagingLayout: UICollectionViewCompositionalLayout { let itemSize = NSCollectionLayoutSize( widthDimension: .fractionalWidth(1.0)\u201a heightDimension: .fractionalHeight(1.0)) let item = NSCollectionLayoutItem(layoutSize: itemSize) let side = UIScreen.main.bounds.width - \/* left and right margins *\/) let groupFractionalWidth = 0.92 let groupSize = NSCollectionLayoutSize( widthDimension: .fractionalWidth(groupFractionalWidth)\u201a heightDimension: .absolute(side)) let group = NSCollectionLayoutGroup.horizontal( layoutSize: groupSize\u201a repeatingSubitem: item\u201a count: 1) let section = NSCollectionLayoutSection(group: group) let layout = UICollectionViewCompositionalLayout(section: section) return layout }}<\/code><\/p>\n\n\n\n

Let\u2019s setup our model\u201a we\u2019re going to use images from our asset library and will put that in a Section class and make an array of Section objects. Also\u201a going to create a custom UICollectionViewCell that has an imageView and property named image which when set will set the image of UIImageView.<\/p>\n\n\n\n

let someCatImages: [String] = (0\u20267).map { \"cat($0)\" }class Section { var images: [String] init(images: [String]) { self.images = images }}extension Section { static var allSections: [Section] = [ Section(images: someCatImages)\u201a Section(images: someCatImages)\u201a Section(images: someCatImages) ]}<\/code><\/p>\n\n\n\n

class ImageCollectionViewCell: UICollectionViewCell { @IBOutlet weak var contentImageView: UIImageView! var image: String? { didSet { if let image = image { self.contentImageView.image = UIImage(named: image) } } }}<\/code><\/p>\n\n\n\n

After that we\u2019ll setup our ViewController with a collectionView.<\/p>\n\n\n\n

import UIKitclass CompositionalLayoutViewController: UIViewController { @IBOutlet weak var collectionView: UICollectionView! let sections = Section.allSections override func viewDidLoad() { super.viewDidLoad() collectionView.showsVerticalScrollIndicator = false collectionView.collectionViewLayout = UICollectionViewCompositionalLayout.horizontalPagingLayout }}extension CompositionalLayoutViewController: UICollectionViewDataSource { func numberOfSections(in collectionView: UICollectionView) -> Int { sections.count } func collectionView(_ collectionView: UICollectionView\u201a numberOfItemsInSection section: Int) -> Int { sections[section].images.count } func collectionView(_ collectionView: UICollectionView\u201a cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let cell = collectionView.dequeueReusableCell(withReuseIdentifier: \"ImageCollectionViewCell\"\u201a for: indexPath) as! ImageCollectionViewCell cell.image = sections[indexPath.section].images[indexPath.item] return cell }}<\/code><\/p>\n\n\n\n

We\u2019re almost done\u201a let\u2019s see how it looks.<\/p>\n\n\n\n

\"[object<\/figure>\n\n\n\n

It loads all the items but all items are appearing vertically. To change that we need set the property of section orthogonalScrollingBehaviour<\/b><\/a> to .groupPagingCentered<\/i><\/b> which will make the items in section scroll perpendicular to the scroll direction of CollectionView and its going to centre the element in the middle of screen. It looks much better now. Let\u2019s set some spacings on group and section so there\u2019s spacing between them.We\u2019re going to use contentInsets property on group and section to get the spacing.<\/p>\n\n\n\n

section.contentInsets = NSDirectionalEdgeInsets(top: 10.0\u201a leading: 0.0\u201a bottom: 0.0\u201a trailing: 0.0)group.contentInsets = NSDirectionalEdgeInsets(top: 0\u201a leading: 8.0\u201a bottom: 0\u201a trailing: 8.0)<\/code><\/p>\n\n\n\n

Voila!! we have our desired behaviour.<\/p>\n\n\n\n

\"[object<\/figure>\n\n\n\n

Wait\u201a the most interesting part \ud83d\ude42<\/h3>\n\n\n\n

We can use our section\u2019s visibleItemsInvalidationHandler property and some math (borrowed from StackOverflow) to get some nice animation. We\u2019ll calculate the horizontal distance of each visible item from the center and set the scaling so that when an item is not in focus its smaller and goes to original size when it is in the center of the container.<\/p>\n\n\n\n

section.visibleItemsInvalidationHandler = { (items\u201a offset\u201a environment) in items.forEach { item in let distanceFromCenter = abs((item.frame.midX - offset.x) - environment.container.contentSize.width \/ 2.0) let minScale: CGFloat = 0.7 let maxScale: CGFloat = 1.0 let scale = max(maxScale - (distanceFromCenter \/ environment.container.contentSize.width)\u201a minScale) item.transform = CGAffineTransform(scaleX: scale\u201a y: scale) } }<\/code><\/p>\n\n\n\n

And the final result…<\/p>\n\n\n\n

\"[object<\/figure>\n\n\n\n

What\u2019s next<\/h3>\n\n\n\n

That concludes an introduction to UICollectionViewCompositionalLayout. In later articles of the series I’ll be looking at other APIs we can use to improve the code. I’ll be pairing the layout up with UICollectionViewDiffableDataSource<\/b><\/a> to add items to the CollectionView with less code and some nice benefits it provides. I\u2019ll also be looking at how we can use CollectionView with Compositional layout in SwiftUI.<\/p>\n","protected":false},"excerpt":{"rendered":"

If you\u2019re looking for a faster and simpler way to create dynamic and flexible layouts for your iOS app\u2019s collection views\u201a then UICollectionViewCompositionalLayout might be just what you need. With its declarative API and powerful features\u201a this layout system allows you to easily create complex and customisable layouts in just a few lines of code. […]<\/p>\n","protected":false},"author":2,"featured_media":2845,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","inline_featured_image":false,"footnotes":""},"categories":[146],"tags":[149],"acf":[],"yoast_head":"\nHow to get started with UICollectionViewCompositional Layout | hedgehog lab<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/hedgehoglab.com\/how-to-get-started-with-uicollectionviewcompositional-layout\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to get started with UICollectionViewCompositional Layout | hedgehog lab\" \/>\n<meta property=\"og:description\" content=\"If you\u2019re looking for a faster and simpler way to create dynamic and flexible layouts for your iOS app\u2019s collection views\u201a then UICollectionViewCompositionalLayout might be just what you need. With its declarative API and powerful features\u201a this layout system allows you to easily create complex and customisable layouts in just a few lines of code. […]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/hedgehoglab.com\/how-to-get-started-with-uicollectionviewcompositional-layout\/\" \/>\n<meta property=\"og:site_name\" content=\"hedgehog lab\" \/>\n<meta property=\"article:published_time\" content=\"2023-03-16T00:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-11-06T08:54:18+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/hedgehoglab.com\/wp-content\/uploads\/2023\/08\/Blog-post-images__1_.png\" \/>\n\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t<meta property=\"og:image:height\" content=\"450\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Antonia Hayianni\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Antonia Hayianni\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/hedgehoglab.com\/how-to-get-started-with-uicollectionviewcompositional-layout\/\",\"url\":\"https:\/\/hedgehoglab.com\/how-to-get-started-with-uicollectionviewcompositional-layout\/\",\"name\":\"How to get started with UICollectionViewCompositional Layout | hedgehog lab\",\"isPartOf\":{\"@id\":\"https:\/\/hedgehoglab.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/hedgehoglab.com\/how-to-get-started-with-uicollectionviewcompositional-layout\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/hedgehoglab.com\/how-to-get-started-with-uicollectionviewcompositional-layout\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/hedgehoglab.com\/wp-content\/uploads\/2023\/08\/Blog-post-images__1_.png\",\"datePublished\":\"2023-03-16T00:00:00+00:00\",\"dateModified\":\"2023-11-06T08:54:18+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/hedgehoglab.com\/how-to-get-started-with-uicollectionviewcompositional-layout\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/hedgehoglab.com\/how-to-get-started-with-uicollectionviewcompositional-layout\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/hedgehoglab.com\/how-to-get-started-with-uicollectionviewcompositional-layout\/#primaryimage\",\"url\":\"https:\/\/hedgehoglab.com\/wp-content\/uploads\/2023\/08\/Blog-post-images__1_.png\",\"contentUrl\":\"https:\/\/hedgehoglab.com\/wp-content\/uploads\/2023\/08\/Blog-post-images__1_.png\",\"width\":800,\"height\":450},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/hedgehoglab.com\/how-to-get-started-with-uicollectionviewcompositional-layout\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/hedgehoglab.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to get started with UICollectionViewCompositional Layout\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/hedgehoglab.com\/#website\",\"url\":\"https:\/\/hedgehoglab.com\/\",\"name\":\"hedgehog lab\",\"description\":\"Mobile App Developer in UK & USA\",\"publisher\":{\"@id\":\"https:\/\/hedgehoglab.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/hedgehoglab.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/hedgehoglab.com\/#organization\",\"name\":\"hedgehog lab\",\"url\":\"https:\/\/hedgehoglab.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/hedgehoglab.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/hedgehoglab.com\/wp-content\/uploads\/2023\/06\/Vector-3.svg\",\"contentUrl\":\"https:\/\/hedgehoglab.com\/wp-content\/uploads\/2023\/06\/Vector-3.svg\",\"width\":179,\"height\":149,\"caption\":\"hedgehog lab\"},\"image\":{\"@id\":\"https:\/\/hedgehoglab.com\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to get started with UICollectionViewCompositional Layout | hedgehog lab","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/hedgehoglab.com\/how-to-get-started-with-uicollectionviewcompositional-layout\/","og_locale":"en_GB","og_type":"article","og_title":"How to get started with UICollectionViewCompositional Layout | hedgehog lab","og_description":"If you\u2019re looking for a faster and simpler way to create dynamic and flexible layouts for your iOS app\u2019s collection views\u201a then UICollectionViewCompositionalLayout might be just what you need. With its declarative API and powerful features\u201a this layout system allows you to easily create complex and customisable layouts in just a few lines of code. […]","og_url":"https:\/\/hedgehoglab.com\/how-to-get-started-with-uicollectionviewcompositional-layout\/","og_site_name":"hedgehog lab","article_published_time":"2023-03-16T00:00:00+00:00","article_modified_time":"2023-11-06T08:54:18+00:00","og_image":[{"width":800,"height":450,"url":"https:\/\/hedgehoglab.com\/wp-content\/uploads\/2023\/08\/Blog-post-images__1_.png","type":"image\/png"}],"author":"Antonia Hayianni","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Antonia Hayianni","Estimated reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/hedgehoglab.com\/how-to-get-started-with-uicollectionviewcompositional-layout\/","url":"https:\/\/hedgehoglab.com\/how-to-get-started-with-uicollectionviewcompositional-layout\/","name":"How to get started with UICollectionViewCompositional Layout | hedgehog lab","isPartOf":{"@id":"https:\/\/hedgehoglab.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/hedgehoglab.com\/how-to-get-started-with-uicollectionviewcompositional-layout\/#primaryimage"},"image":{"@id":"https:\/\/hedgehoglab.com\/how-to-get-started-with-uicollectionviewcompositional-layout\/#primaryimage"},"thumbnailUrl":"https:\/\/hedgehoglab.com\/wp-content\/uploads\/2023\/08\/Blog-post-images__1_.png","datePublished":"2023-03-16T00:00:00+00:00","dateModified":"2023-11-06T08:54:18+00:00","breadcrumb":{"@id":"https:\/\/hedgehoglab.com\/how-to-get-started-with-uicollectionviewcompositional-layout\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/hedgehoglab.com\/how-to-get-started-with-uicollectionviewcompositional-layout\/"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/hedgehoglab.com\/how-to-get-started-with-uicollectionviewcompositional-layout\/#primaryimage","url":"https:\/\/hedgehoglab.com\/wp-content\/uploads\/2023\/08\/Blog-post-images__1_.png","contentUrl":"https:\/\/hedgehoglab.com\/wp-content\/uploads\/2023\/08\/Blog-post-images__1_.png","width":800,"height":450},{"@type":"BreadcrumbList","@id":"https:\/\/hedgehoglab.com\/how-to-get-started-with-uicollectionviewcompositional-layout\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/hedgehoglab.com\/"},{"@type":"ListItem","position":2,"name":"How to get started with UICollectionViewCompositional Layout"}]},{"@type":"WebSite","@id":"https:\/\/hedgehoglab.com\/#website","url":"https:\/\/hedgehoglab.com\/","name":"hedgehog lab","description":"Mobile App Developer in UK & USA","publisher":{"@id":"https:\/\/hedgehoglab.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/hedgehoglab.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-GB"},{"@type":"Organization","@id":"https:\/\/hedgehoglab.com\/#organization","name":"hedgehog lab","url":"https:\/\/hedgehoglab.com\/","logo":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/hedgehoglab.com\/#\/schema\/logo\/image\/","url":"https:\/\/hedgehoglab.com\/wp-content\/uploads\/2023\/06\/Vector-3.svg","contentUrl":"https:\/\/hedgehoglab.com\/wp-content\/uploads\/2023\/06\/Vector-3.svg","width":179,"height":149,"caption":"hedgehog lab"},"image":{"@id":"https:\/\/hedgehoglab.com\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/hedgehoglab.com\/wp-json\/wp\/v2\/posts\/5538"}],"collection":[{"href":"https:\/\/hedgehoglab.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hedgehoglab.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hedgehoglab.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hedgehoglab.com\/wp-json\/wp\/v2\/comments?post=5538"}],"version-history":[{"count":1,"href":"https:\/\/hedgehoglab.com\/wp-json\/wp\/v2\/posts\/5538\/revisions"}],"predecessor-version":[{"id":6133,"href":"https:\/\/hedgehoglab.com\/wp-json\/wp\/v2\/posts\/5538\/revisions\/6133"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hedgehoglab.com\/wp-json\/wp\/v2\/media\/2845"}],"wp:attachment":[{"href":"https:\/\/hedgehoglab.com\/wp-json\/wp\/v2\/media?parent=5538"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hedgehoglab.com\/wp-json\/wp\/v2\/categories?post=5538"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hedgehoglab.com\/wp-json\/wp\/v2\/tags?post=5538"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}