{"__v":0,"_id":"57cee52ead483e0e00890241","category":{"__v":0,"_id":"57b96d6b1d08500e00bf81d2","project":"54861bb654b3ce0b00367292","version":"57b96d6b1d08500e00bf81d1","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-03-22T15:19:16.310Z","from_sync":false,"order":0,"slug":"intigration","title":"iOS / Essentials KIt"},"parentDoc":null,"project":"54861bb654b3ce0b00367292","user":"54861b9f3681d914006992a4","version":{"__v":7,"_id":"57b96d6b1d08500e00bf81d1","project":"54861bb654b3ce0b00367292","createdAt":"2016-08-21T08:59:23.326Z","releaseDate":"2016-08-21T08:59:23.326Z","categories":["57b96d6b1d08500e00bf81d2","57b96d6b1d08500e00bf81d3","57b96d6b1d08500e00bf81d4","57b96d6b1d08500e00bf81d5","57b96d6b1d08500e00bf81d6","57b96d6b1d08500e00bf81d7","57b96d6b1d08500e00bf81d8","57b96d6b1d08500e00bf81d9","57b96d6b1d08500e00bf81da","57b96d6b1d08500e00bf81db","57b96d6b1d08500e00bf81dc","57b97748306b9b0e001dd53f","57d12c6c1227b40e0044908a","57d51ad68191880e008bb51b","57d52b5cf350090e00fe073e","57d5468a17b492170053a3f0","57df9df05927cb0e002bce1e"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":false,"codename":"","version_clean":"4.0.0","version":"4.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-09-06T15:47:58.275Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Actions\"\n}\n[/block]\nActions is the ability to extend functionality on clickable buttons in an experience, to lean more about actions, please visit knowledge base  <a href=\"http://helpdesk.elasticode.com/articles/3790-adding-call-to-action-element\" target=\"_blank\">here</a>\n\nHere is a way you can extend that with your own functionality\nIn order to add an action, simply create an ``ECOnBoardingAction`` object with the parameters:\n* Name - A string representation of your code block\n* Action Block - that gets a NSDictionary with context information you would like it to preserve ( state).\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"ECOnBoardingAction * ac = \\n  [ECOnBoardingAction createWithName::::at:::\\\"show video\\\" actionWithContext:^(NSDictionary *context) {}];\\n[ElastiCode setActions:@[ac]];\",\n      \"language\": \"objectivec\"\n    },\n    {\n      \"code\": \"ElastiCode .setActions([\\n  ECOnBoardingAction .createWithName(\\\"Show video\\\",\\n    action: { (dict) -> Void in\\n      // video showing logic\\n    }),\\n  ECOnBoardingAction .createWithName(\\\"Ask for premission\\\",\\n    action: { (dict) -> Void in\\n      // premission logic\\n    })\\n    ]\\n)\\n\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\nOnce you will ad this, this action will immediately populate as an option in the action option box:\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/1557b18-2323.png\",\n        \"2323.png\",\n        620,\n        365,\n        \"#34648e\"\n      ],\n      \"sizing\": \"80\",\n      \"border\": true\n    }\n  ]\n}\n[/block]","excerpt":"iOS / Essentials KIt: Extra setup / Actions","slug":"additional-kit","type":"basic","title":"Extra setup / Actions"}

Extra setup / Actions

iOS / Essentials KIt: Extra setup / Actions

[block:api-header] { "type": "basic", "title": "Actions" } [/block] Actions is the ability to extend functionality on clickable buttons in an experience, to lean more about actions, please visit knowledge base <a href="http://helpdesk.elasticode.com/articles/3790-adding-call-to-action-element" target="_blank">here</a> Here is a way you can extend that with your own functionality In order to add an action, simply create an ``ECOnBoardingAction`` object with the parameters: * Name - A string representation of your code block * Action Block - that gets a NSDictionary with context information you would like it to preserve ( state). [block:code] { "codes": [ { "code": "ECOnBoardingAction * ac = \n [ECOnBoardingAction createWithName:@\"show video\" actionWithContext:^(NSDictionary *context) {}];\n[ElastiCode setActions:@[ac]];", "language": "objectivec" }, { "code": "ElastiCode .setActions([\n ECOnBoardingAction .createWithName(\"Show video\",\n action: { (dict) -> Void in\n // video showing logic\n }),\n ECOnBoardingAction .createWithName(\"Ask for premission\",\n action: { (dict) -> Void in\n // premission logic\n })\n ]\n)\n", "language": "swift" } ] } [/block] Once you will ad this, this action will immediately populate as an option in the action option box: [block:image] { "images": [ { "image": [ "https://files.readme.io/1557b18-2323.png", "2323.png", 620, 365, "#34648e" ], "sizing": "80", "border": true } ] } [/block]