Skip to content

Commit

Permalink
(iOS) lifecycle: updates
Browse files Browse the repository at this point in the history
  • Loading branch information
SensehacK committed Mar 7, 2024
1 parent e4f38c2 commit e9aa966
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ios/lifecycle/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

You can defined your own documentation while coding for your functions to be properly documented with the parameter types, information of what it would return with different type of conditions. I believe that in most of the projects were we already can inspect the codebase of a function to better understand, it doesn’t matter but for quick glance to get the bird eye view of the calling method is great. Also it is more future proof in terms of less work ahead if you wanted to make the whole class in a package library type of scenario.

## Headers
## Headers | Annotations

// MARK:

Expand All @@ -11,6 +11,7 @@ You can defined your own documentation while coding for your functions to be pro
// FIXME:


Good article about organizing your swift project with [this article](https://cocoacasts.com/organize-your-swift-project-with-annotations-todos-and-fixmes)

### Old Headers

Expand Down
6 changes: 6 additions & 0 deletions ios/lifecycle/localization.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,9 @@ private enum Texts: String {
}
```

## Third party

Lokalise - translation management system for end user clients.
Automation around localization and QA process towards supporting various languages or regions.

[dev | ios sdk](https://developers.lokalise.com/docs/ios-sdk)
7 changes: 7 additions & 0 deletions ios/lifecycle/protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ My reasoning:
This is keeping up with good approach on test-ability of this feature for unit tests and support dependency injection in future.
It also could be used as a TODO: marker when you have protocols with functions definition defined which needs to be implemented.

> what made you make this a protocol? b/c we could easily made this a function, just your thought process around it.
- Having protocol makes it easier for the implementer to not introduce more things than necessary. So you start with what is the MVP of that same class, function or properties.
- It also kinda helps in dependency injection and creating mocks in unit tests.
- It helps us to also easily allow us to pass protocol as a type for future generics using Protocols with associated types
- It helps the conforming object/instance of the protocol to have default implementation via `protocol extensions`. Thus guaranteeing default behavior like an optional default nil `let unwrappedValue = optionalValue ?? defaultValue`

## Combining Protocols

```swift
Expand Down

0 comments on commit e9aa966

Please sign in to comment.