-
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
0c72550
commit 439f10b
Showing
4 changed files
with
58 additions
and
202 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import Foundation | ||
|
||
extension Swift.Sequence { | ||
/// Maps values from the sequence to animations | ||
/// - Parameter animations: Add each animation from within this closure. Animations should conform to ``GroupAnimatable`` | ||
/// - Returns: Sequence of all animations created in the `animation` closure | ||
public func mapSequence( | ||
@SequenceBuilder animations builder: (Element) -> [SequenceAnimatable] | ||
) -> [SequenceAnimatable] { | ||
flatMap(builder) | ||
} | ||
|
||
/// Maps values from the sequence to animations | ||
/// - Parameter animations: Add each animation from within this closure. Animations added to this loop should conform to ``GroupAnimatable`` | ||
/// - Returns: Group of all animations created in the `animation` closure | ||
public func mapGroup( | ||
@GroupBuilder animations builder: (Element) -> [GroupAnimatable] | ||
) -> [GroupAnimatable] { | ||
flatMap(builder) | ||
} | ||
} |
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
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