Skip to content

dmm-com/loopcore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LoopCore

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.

Sample


Components

1. LoopingTabBar

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 LoopingPager so that tapping a tab moves the carousel to the corresponding page.

2. LoopingPager

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 LoopingTabBar so that the tab row controls the carousel and keeps them in sync.

How They Work Together

While each component is fully functional on its own, the real strength of the package is when you use both together:

  • The LoopingTabBar provides a visual index or navigation bar for the items in the carousel.
  • The LoopingPager presents 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.


Installation

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 LoopCore

Example Usage

Please check the sample app in the Example directory.


When to Use

  • Use LoopingTabBar when you need a horizontally scrollable, looping tab navigation.
  • Use LoopingPager when 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.

License

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.

About

A Swift package offering reusable SwiftUI components — LoopingTabBar and LoopingPager — to build infinitely looping, scrollable tab bars and carousels that work seamlessly together or independently.

Resources

License

Stars

Watchers

Forks

Contributors

Languages