Swiftpack.co - std-swift/BidirectionalIterator as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by std-swift.
std-swift/BidirectionalIterator 1.0.0
Iterate over BidirectionalCollections
⭐️ 0
🕓 3 years ago
.package(url: "https://github.com/std-swift/BidirectionalIterator.git", from: "1.0.0")

BidirectionalIterator

Provides a BidirectionalIterator for BidirectionalCollection types

Importing

import BidirectionalIterator
dependencies: [
	.package(url: "https://github.com/std-swift/BidirectionalIterator.git",
	         from: "1.0.0")
],
targets: [
	.target(
		name: "",
		dependencies: [
			"BidirectionalIterator"
		]),
]

Using

let animals = ["Antelope", "Butterfly", "Camel", "Dolphin"]
var animalIterator = animals.makeBidirectionalIterator()
animalIterator.next()     // .some("Antelope")
animalIterator.next()     // .some("Butterfly")
animalIterator.previous() // .some("Butterfly")
animalIterator.next()     // .some("Butterfly")

GitHub

link
Stars: 0
Last commit: 3 years ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics