

{"id":120711,"date":"2023-12-05T18:00:22","date_gmt":"2023-12-05T12:30:22","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=120711"},"modified":"2023-12-05T18:19:19","modified_gmt":"2023-12-05T12:49:19","slug":"swift-properties-and-its-types","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/swift-properties-and-its-types\/","title":{"rendered":"Swift Properties and Its Types"},"content":{"rendered":"<p>We use properties in Swift to encapsulate and manage values that are associated with enumerations, structures and classes. We can store and compute properties in Swift. In this article, we\u2019ll learn about different kinds of properties in Swift. We\u2019ll understand when and how to use them with the help of examples.<\/p>\n<h3>Swift Stored Property<\/h3>\n<p>When we store a value as a constant or a variable as an instance in a class or structure, we call it a stored property. There can be 2 types, namely, variable stored property and constant stored property.<\/p>\n<ul>\n<li>Constant Stored Properties are the constants given a value in an instance of a structure or a class. These values are usually the same throughout the program.<\/li>\n<li>Variable Stored Properties are the variables given a value in an instance of a structure or a class. These values might change in the program.<\/li>\n<\/ul>\n<p><strong>For example,<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">struct Example{\r\n    var variableStoredProperty: String\r\n    var constantStoredProperty: String\r\n}\r\n\r\nvar example = Example(variableStoredProperty: \"DataFlair\", constantStoredProperty: \"DataFlair\")\r\n\r\nexample.variableStoredProperty = \"Properties\"\r\n\r\nprint(\"Variable Stored Property: \\(example.variableStoredProperty)\")\r\nprint(\"Constant Stored Property: \\(example.constantStoredProperty)\")<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><strong>Variable Stored Property:<\/strong> Properties<br \/>\n<strong>Constant Stored Property:<\/strong> DataFlair<\/p>\n<p>Note that if we declare the instance of a structure or class as a constant, then we cannot change the value of a variable stored property.<\/p>\n<h3>Swift Lazy Stored Property<\/h3>\n<p>The properties where we do not calculate initial values until we access them for the first time are called lazy stored properties in Swift. These do not occupy any memory until we access them for the first time. These can be useful when we have complex and expensive calculations.<\/p>\n<p>We also use them when the value of the property depends on other factors and are calculated when those factors are available. Note that we can declare a variable as a lazy property only. Since constant properties need to have a value before the initialization completes, we cannot declare it as lazy. We declare a property as lazy by writing the keyword lazy before the property declaration.<\/p>\n<p><strong>For example,<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">struct Circle{\r\n    let radius: Double\r\n    \/\/circumference property is declared as lazy stored property\r\n    lazy var circumference: Double = {\r\n        return 2 * Double.pi * self.radius\r\n    }()\r\n    \r\n    init(radius: Double){\r\n        self.radius = radius\r\n    }\r\n}\r\n\r\nvar circleExample = Circle(radius: 5.0)\r\n\/\/When we access the circumference property for the first time here, it is initialized.\r\nprint(\"Circumference: \\(circleExample.circumference)\")<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><strong>Circumference:<\/strong> 31.41592653589793<\/p>\n<p>Note that there is no guarantee that a property declared with the lazy modifier will only be initialized once if it is accessed by several threads at once while the property is not yet initialized.<\/p>\n<h3>Swift Computed Property<\/h3>\n<p>Computed properties are the properties that do not store any value. Instead, it has a getter and an optional setter that computes value when accessed.<\/p>\n<p><strong>For example,<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">struct Temperature{\r\n    var celsiusTemp: Double\r\n    \r\n    var fahrenheitTemp: Double{\r\n        get {\r\n            return (celsiusTemp * 9.0 \/ 5.0) + 32.0\r\n        } set {\r\n            celsiusTemp = (newValue - 32.0) * 5.0 \/ 9.0\r\n        }\r\n    }\r\n    \r\n    init(celsiusTemp: Double){\r\n        self.celsiusTemp = celsiusTemp\r\n    }\r\n}\r\nvar temperature = Temperature(celsiusTemp: 32.0)\r\nprint(\"Temperature in Celsius: \\(temperature.celsiusTemp).\")\r\n\/\/accessing the computed property using a getter\r\nprint(\"Temperature in Fahrenheit: \\(temperature.fahrenheitTemp).\")\r\n\/\/accessing the computed property using a setter\r\ntemperature.fahrenheitTemp = 98.0\r\nprint(\"Temperature in Fahrenheit: \\(temperature.fahrenheitTemp).\")\r\nprint(\"Temperature in Celsius: \\(temperature.celsiusTemp).\")<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><strong>Temperature in Celsius:<\/strong> 32.0.<br \/>\n<strong>The temperature in Fahrenheit<\/strong>\u00a089.6.<br \/>\n<strong>Temperature in Fahrenheit:<\/strong> 98.0.<br \/>\n<strong>The temperature in Celsius<\/strong> is 36.666666666666664.<\/p>\n<h4>Shorthand Getter Declaration<\/h4>\n<p>If the setter of a computed property doesn&#8217;t specify a name for the new value to be set, newValue is used by default. Omitting the return from a getter follows the same rules as followed by functions with implicit returns.<\/p>\n<h3>The distinction between Stored and Computed Property in Swift<\/h3>\n<table>\n<tbody>\n<tr>\n<td><b>Stored Property<\/b><\/td>\n<td><b>Computed Property<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">The value of the instance is stored.<\/span><\/td>\n<td><span style=\"font-weight: 400\">The value of the instance is calculated when accessed.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Supported by classes and structures only.<\/span><\/td>\n<td><span style=\"font-weight: 400\">Supported by classes, structures and enumerations<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Read-only Computed Property in Swift<\/h3>\n<p>A Read-only computed property is a property with a getter but no setter. It always returns a value. We can access it using the dot syntax. We cannot change (set) the property to a different value.<\/p>\n<p>As discussed above, the computed property can only be declared as a variable; the same applies here too. We use the var keyword to declare computed and read-only computed property.<\/p>\n<p><strong>For example,<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">struct Circle{\r\n    var radius: Double\r\n    \/\/area is a computer property\r\n    var area: Double {\r\n        return Double.pi * radius * radius\r\n    }\r\n}\r\n\r\nvar circleExample = Circle(radius: 6.0)\r\n\/\/calling the computed property, the value is calculated in real-time.\r\nprint(\"Area: \\(circleExample.area)\")<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><strong>Area:<\/strong> 113.09733552923255<\/p>\n<h3>Swift Property Observers<\/h3>\n<p>We can add property observers to check and notify if a property\u2019s value is changing. These are called every time a property\u2019s value is set. We can add property observers to stored properties and inherited stored and computed properties. We use overriding to add property observers to the inherited properties.<\/p>\n<p>We can define either or both of the following observers on a property.<\/p>\n<h4>willSet &#8211;<\/h4>\n<p>called just before we store a value.<\/p>\n<ul>\n<li>We can pass the new parameter value with a name within parentheses while implementing willSet.<\/li>\n<li>If we don\u2019t write a parameter name, then a default parameter name newValue is given by Swift.<\/li>\n<\/ul>\n<h4>didSet &#8211;<\/h4>\n<p>called immediately after we store a new value.<\/p>\n<p>We can pass the old value with a new parameter name or Swift provides a default parameter name oldValue.<\/p>\n<p><strong>The following example explains the usage of willSet and didSet.<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">class TemperatureMonitor {\r\n    var temperature: Double = 0.0 {\r\n        willSet(newTemperature) {\r\n            print(\"Temperature changing to \\(newTemperature)\u00b0C\")\r\n        }\r\n        didSet {\r\n            print(\"Temperature changed from \\(oldValue)\u00b0C to \\(temperature)\u00b0C\")\r\n        }\r\n    }\r\n}\r\n\r\nvar monitor = TemperatureMonitor()\r\nmonitor.temperature = 25.0\r\n\r\nmonitor.temperature = 32.0<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>Temperature changing to 25.0\u00b0C<br \/>\nTemperature changed from 0.0\u00b0C to 25.0\u00b0C<br \/>\nTemperature changing to 32.0\u00b0C<br \/>\nTemperature changed from 25.0\u00b0C to 32.0\u00b0C<\/p>\n<h3>Swift Property Wrappers<\/h3>\n<p>Property Wrappers in Swift add custom behavior to properties. It adds a layer between the code that manages the storing of a property and the code that defines the property. We write a management code while defining a wrapper, and then we reuse it by applying multiple properties to it. We can define these wrappers on a class, structure or enumeration, which defines a wrappedValue property.<\/p>\n<p><strong>We follow the following syntax to write a property wrapper.<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">@propertyWrapper\r\nstruct WrapperName{\r\n    var wrappedVal: dataType\r\n    init(wrappedVal: dataType){\r\n        self.wrappedVal = wrappedVal\r\n    }\r\n}<\/pre>\n<h4>Setting Initial Values for Wrapper Properties<\/h4>\n<ul>\n<li>The property wrapper needs to include an initializer in order to support initial value setting and other customization.<\/li>\n<li>When a wrapper is applied to a property without an initial value being specified, Swift sets up the wrapper using the init() initializer.<\/li>\n<li>We can specify the initial state of the property wrapper or pass other options when creating the wrapper by adding arguments to it. The most versatile way to use a property wrapper is with this syntax. We can give the attribute any arguments you require, and it will be passed on to the initializer.<\/li>\n<li>We can also use assignment operators to specify an initial value when including property wrapper arguments. Swift uses the initializer that accepts the arguments we include and treats the assignment like a wrappedValue argument.<\/li>\n<\/ul>\n<h4>Projecting a Value from a Property Wrappers<\/h4>\n<ul>\n<li>A property wrapper can expose additional functionality by defining a projected value in addition to the wrapped value.<\/li>\n<li>The projected value has the same name as the wrapped value, with the exception that it starts with a dollar sign ($). The projected value never interferes with the properties we define because our code cannot define properties that begin with $.<\/li>\n<li>As its projected value, a property wrapper may return a value of any type.<\/li>\n<li>If a wrapper needs to reveal more information, it can either return an instance of a different type or self to reveal the wrapper&#8217;s instance as its projected value.<\/li>\n<\/ul>\n<h3>Swift Type Properties<\/h3>\n<p>Type properties in Swift are the properties that are shared among all the instances of a class or a structure. Swift generates only one copy of the properties for all the instances of a type created. We create a type property by using the static keyword.<\/p>\n<h4>Querying &amp; Setting Type Properties<\/h4>\n<p>We use querying to get a value of the type property. We use the setting to set a value of the type property. We query and set the type property using the class name and dot syntax.<\/p>\n<p><strong>For example,<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">struct Company{\r\n    \/\/declaring a type property using the static keyword.\r\n    static var name = \"DataFlair\"\r\n    \r\n    static func greet() -&gt; String{\r\n        return \"Hello from \\(name)\"\r\n    }\r\n}\r\n\/\/Querying type property\r\nprint(\"Querying: \\(Company.greet())\")\r\n\/\/Setting type property\r\nCompany.name = \"DataFlair!!\"\r\nprint(\"Querying after setting: \\(Company.greet())\")<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><strong>Querying:<\/strong> Hello from DataFlair<br \/>\n<strong>Querying after setting:<\/strong> Hello from DataFlair!!<\/p>\n<h3>Global and local variables in Swift<\/h3>\n<ul>\n<li>We can access local variables within a fixed scope or a function.<\/li>\n<li>A global variable is accessible across the entire program.<\/li>\n<li>Computed Variables are the variables whose values are computed in real time.<\/li>\n<li>Lazy variables are the variables that compute values every time they are accessed.<\/li>\n<\/ul>\n<h3>Conclusion<\/h3>\n<p>Properties access stored or computed values that are part of an instance or type. In this article, we have discussed different kinds of swift properties, such as stored and computed properties. We have understood read-only computed properties along with property observers and wrappers. We have also seen querying and setting type properties.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We use properties in Swift to encapsulate and manage values that are associated with enumerations, structures and classes. We can store and compute properties in Swift. In this article, we\u2019ll learn about different kinds&#46;&#46;&#46;<\/p>\n","protected":false},"author":581,"featured_media":120713,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27789],"tags":[28799,28797,21771,28796,28798,28287],"class_list":["post-120711","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-swift-tutorials","tag-learn-swift","tag-properties-of-swift","tag-swift","tag-swift-properties","tag-swift-properties-and-its-types","tag-swift-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Swift Properties and Its Types - DataFlair<\/title>\n<meta name=\"description\" content=\"In this article, we have discussed different kinds of swift properties, such as stored and computed properties.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/swift-properties-and-its-types\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Swift Properties and Its Types - DataFlair\" \/>\n<meta property=\"og:description\" content=\"In this article, we have discussed different kinds of swift properties, such as stored and computed properties.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/swift-properties-and-its-types\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-12-05T12:30:22+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-05T12:49:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/swift-properties.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Swift Properties and Its Types - DataFlair","description":"In this article, we have discussed different kinds of swift properties, such as stored and computed properties.","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:\/\/data-flair.training\/blogs\/swift-properties-and-its-types\/","og_locale":"en_US","og_type":"article","og_title":"Swift Properties and Its Types - DataFlair","og_description":"In this article, we have discussed different kinds of swift properties, such as stored and computed properties.","og_url":"https:\/\/data-flair.training\/blogs\/swift-properties-and-its-types\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2023-12-05T12:30:22+00:00","article_modified_time":"2023-12-05T12:49:19+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/swift-properties.webp","type":"image\/webp"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/swift-properties-and-its-types\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/swift-properties-and-its-types\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/c187795dc82ab948373cca526df7c445"},"headline":"Swift Properties and Its Types","datePublished":"2023-12-05T12:30:22+00:00","dateModified":"2023-12-05T12:49:19+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/swift-properties-and-its-types\/"},"wordCount":1254,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/swift-properties-and-its-types\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/swift-properties.webp","keywords":["learn swift","properties of swift","Swift","swift properties","swift properties and its types","swift tutorials"],"articleSection":["Swift Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/swift-properties-and-its-types\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/swift-properties-and-its-types\/","url":"https:\/\/data-flair.training\/blogs\/swift-properties-and-its-types\/","name":"Swift Properties and Its Types - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/swift-properties-and-its-types\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/swift-properties-and-its-types\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/swift-properties.webp","datePublished":"2023-12-05T12:30:22+00:00","dateModified":"2023-12-05T12:49:19+00:00","description":"In this article, we have discussed different kinds of swift properties, such as stored and computed properties.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/swift-properties-and-its-types\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/swift-properties-and-its-types\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/swift-properties-and-its-types\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/swift-properties.webp","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/swift-properties.webp","width":1200,"height":628,"caption":"swift properties"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/swift-properties-and-its-types\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Swift Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/swift-tutorials\/"},{"@type":"ListItem","position":3,"name":"Swift Properties and Its Types"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/c187795dc82ab948373cca526df7c445","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/2302ebc438084d2f1f993edc1996a0aae01332e81f3227cba8df0c48ec010ca4?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/2302ebc438084d2f1f993edc1996a0aae01332e81f3227cba8df0c48ec010ca4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2302ebc438084d2f1f993edc1996a0aae01332e81f3227cba8df0c48ec010ca4?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team provides high-impact content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. We make complex concepts easy to grasp, helping learners of all levels succeed in their tech careers.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam6\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/120711","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/581"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=120711"}],"version-history":[{"count":6,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/120711\/revisions"}],"predecessor-version":[{"id":131729,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/120711\/revisions\/131729"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/120713"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=120711"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=120711"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=120711"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}