-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3120ff4
commit 6a5c1da
Showing
1 changed file
with
3 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# Swift Lazy Patterns | ||
A few lazy patterns for Swift 4. Note that, if you are OK with the behavior of Swift's `lazy` keyword, you should use that. This is for [those who want very specific behaviors](https://stackoverflow.com/a/40847994/3939277): | ||
|
||
* [`Lazy`](https://github.com/BenLeggiero/Swift-Lazy-Patterns/blob/master/Lazy.swift#L28-L78): A non-resettable lazy pattern, to guarantee lazy behavior across Swift language versions | ||
* [`ResettableLazy`](https://github.com/BenLeggiero/Swift-Lazy-Patterns/blob/master/Lazy.swift#L82-L167): A resettable lazy pattern, whose value is generated and cached only when first needed, and can be destroyed when no longer needed. | ||
* [`FunctionalLazy`](https://github.com/BenLeggiero/Swift-Lazy-Patterns/blob/master/Lazy.swift#L171-L221): An idea about how to approach the lazy pattern by using functions instead of branches. | ||
* [`Lazy`](https://github.com/BenLeggiero/Swift-Lazy-Patterns/blob/master/Lazy.swift#L31-L84): A non-resettable lazy pattern, to guarantee lazy behavior across Swift language versions | ||
* [`ResettableLazy`](https://github.com/BenLeggiero/Swift-Lazy-Patterns/blob/master/Lazy.swift#L88-L171): A resettable lazy pattern, whose value is generated and cached only when first needed, and can be destroyed when no longer needed. | ||
* [`FunctionalLazy`](https://github.com/BenLeggiero/Swift-Lazy-Patterns/blob/master/Lazy.swift#L175-L225): An idea about how to approach the lazy pattern by using functions instead of branches. | ||
|