Skip to content

Commit

Permalink
Fix/update documentation 2.0 (#850)
Browse files Browse the repository at this point in the history
* Updates using beagle React

Signed-off-by: Hector Custódio <hector.custodio@zup.com.br>

* Updates async custom action ios

Signed-off-by: Hector Custódio <hector.custodio@zup.com.br>

* Updates ios custom actions index

Signed-off-by: Hector Custódio <hector.custodio@zup.com.br>

* Adds dependencies folder

Signed-off-by: Hector Custódio <hector.custodio@zup.com.br>

* Updates paths

Signed-off-by: Hector Custódio <hector.custodio@zup.com.br>

* Updates dependencies files

Signed-off-by: Hector Custódio <hector.custodio@zup.com.br>

* Updates link paths

Signed-off-by: Hector Custódio <hector.custodio@zup.com.br>

* Adds overview to dependencies folder

Signed-off-by: Hector Custódio <hector.custodio@zup.com.br>

* Fixes typo

Signed-off-by: Hector Custódio <hector.custodio@zup.com.br>

* Fixes link path typo

Signed-off-by: Hector Custódio <hector.custodio@zup.com.br>

* Fixes link path typo

Signed-off-by: Hector Custódio <hector.custodio@zup.com.br>

* Updates code snippet for nav controller

Signed-off-by: Hector Custódio <hector.custodio@zup.com.br>

* Updates global context path file

Signed-off-by: Hector Custódio <hector.custodio@zup.com.br>

* Fixes path typo

Signed-off-by: Hector Custódio <hector.custodio@zup.com.br>
  • Loading branch information
hectorcustodiozup committed Mar 3, 2022
1 parent d50077b commit e9a0a2f
Show file tree
Hide file tree
Showing 17 changed files with 258 additions and 279 deletions.
2 changes: 1 addition & 1 deletion content/en/api/context/global-context.md
Expand Up @@ -170,7 +170,7 @@ beagleService?.globalContext.set(value, path)
{{% /tab %}}

{{% tab name="iOS" %}}
In iOS the Global Context is a [**Beagle Dependencies**]({{< ref path="/ios/customization/beagles-dependencies" lang="en" >}}) attribute.
In iOS the Global Context is a [**Beagle Dependencies**]({{< ref path="/ios/customization/dependencies/overview.md" lang="en" >}}) attribute.

To use it in anywhere of your application you must to use the `BeagleDependencies` instance of your project as the example below:

Expand Down
258 changes: 0 additions & 258 deletions content/en/ios/customization/beagles-dependencies.md

This file was deleted.

2 changes: 1 addition & 1 deletion content/en/ios/customization/custom-actions/_index.md
@@ -1,5 +1,5 @@
---
title: Custom Action
title: Custom Actions
weight: 141
description: >-
In this section, you will find the description on how to create a custom action and
Expand Down
Expand Up @@ -23,6 +23,7 @@ After creating an action, you must implement the `AsyncAction` interface. It wil
```swift
struct CustomAction: AsyncAction {

@AutoCodable
var onFinish: [Action]?

func execute(controller: BeagleController, origin: UIView) {
Expand All @@ -34,20 +35,21 @@ struct CustomAction: AsyncAction {
Now you **MUST** notify when its execution is completed by triggering the `onFinish` action.

```swift
controller.execute(actions: self.onFinish, origin: origin)
controller.execute(actions: self.onFinish, origin: origin)
```

Follow the Asynchronous Custom Action example below:

```swift
struct CustomAction: AsyncAction {

@AutoCodable
var onFinish: [Action]?

func execute(controller: BeagleController, origin: UIView) {
print("Custom action was called")
print("Custom action was called")

controller.execute(actions: self.onFinish, origin: origin)
controller.execute(actions: self.onFinish, origin: origin)
}
}
```
Expand Down
Expand Up @@ -152,11 +152,11 @@ class CustomBeagleNavigationController: BeagleNavigationController {

```swift
let dependencies = BeagleDependencies()
dependencies.navigation.registerNavigationController(
dependencies.navigator.registerNavigationController(
builder: CustomBeagleNavigationController.init,
forId: "CustomBeagleNavigation"
)
Beagle.dependencies = dependencies
BeagleConfigurator.setup(dependencies: dependencies)
```

{{% alert color="info" %}}
Expand Down
8 changes: 8 additions & 0 deletions content/en/ios/customization/dependencies/_index.md
@@ -0,0 +1,8 @@
---
title: Beagle dependencies
weight: 159
description: >-
In this section you will learn about Beagles' dependencies and their properties for iOS environment.
---

---
Expand Up @@ -43,7 +43,7 @@ In addition, the function can return a **RequestToken** so that the request can

In Beagle iOS, we have a class called **ImageDownloaderDefault** that performs the requests for images according to your network layer.

In its `fetchImage` method, this class calls **RequestDispatcher** with type `.fetchImage` and maps the result of that request according to the implementation of your network layer. You can see how to configure a network layer in [**here**]({{< ref path="/ios/customization/network-layer" lang="en" >}}).
In its `fetchImage` method, this class calls **RequestDispatcher** with type `.fetchImage` and maps the result of that request according to the implementation of your network layer. You can see how to configure a network layer in [**here**]({{< ref path="/ios/customization/dependencies/network-layer" lang="en" >}}).

## **Replacing the default implementation**

Expand Down
File renamed without changes.

0 comments on commit e9a0a2f

Please sign in to comment.