A simple Swift Package providing two highly reusable SwiftUI view components for creating looping, scrollable interfaces: LoopingTabBar and LoopingPager. They’re designed to work seamlessly together — but each can also be used entirely on its own.
This component displays a horizontal row of tabs (or items) that loop infinitely. Users can scroll through the items continuously, and once the end is reached it seamlessly continues back at the start, giving the “looping” effect. Typical usage patterns:
- Use it to display a series of categories, sections or keys.
- Link it with
LoopingPagerso that tapping a tab moves the carousel to the corresponding page.
This component presents a horizontally scrolling carousel of views (cards, pages, images, etc.) that loops infinitely. Users can swipe through and once they reach the last item, the carousel wraps around to the first — and vice-versa. Typical usage patterns:
- Use it to showcase featured content, slides, or paged views.
- Combine with
LoopingTabBarso that the tab row controls the carousel and keeps them in sync.
While each component is fully functional on its own, the real strength of the package is when you use both together:
- The
LoopingTabBarprovides a visual index or navigation bar for the items in the carousel. - The
LoopingPagerpresents the actual content pages corresponding to each tab. - By connecting them (for example, binding selected index state between them), you create a smooth UI where selecting a tab scrolls the carousel, and swiping the carousel updates the tab selection — all while maintaining the infinite-loop behavior on both ends.
Because they share the same looping logic and index management, they align beautifully when used in tandem — but you’re free to pick just one if your design only needs a looping tab row or a looping carousel by itself.
Add this package via Swift Package Manager by pointing to the repository:
https://github.com/dmm-com/LoopCore.git
Then import in your SwiftUI view files:
import LoopCorePlease check the sample app in the Example directory.
- Use
LoopingTabBarwhen you need a horizontally scrollable, looping tab navigation. - Use
LoopingPagerwhen you want a looping, paged carousel of views or cards. - Use both together when you need a synchronized tab–carousel system with infinite looping behavior.
This package is released under the Apache License, Version 2.0.
Thank you for using this package! If you encounter any issues or have suggestions, please open an issue on the GitHub repository.
