ContinuousScrollingView
is a custom UIView subclass designed to create a scrolling effect for text.
ContinuousScrollingView
provides a convenient way to display scrolling text within a UIView. It is useful for showcasing text content that exceeds the width of the view's bounds, allowing the text to continuously scroll horizontally. It can be used in any scroll view-type class (in a tableview/collectionview as a cell).
- Seamless integration with existing UIView-based layouts.
- Customizable text content, font, and text color.
- Smooth and continuous scrolling animation.
- Easy-to-use API for starting and configuring the scrolling behavior.
- Import the
ContinuousScrollingView
class into your project. - Create an instance of
ContinuousScrollingView
and add it to your view hierarchy. - Set the
textToScroll
,font
, andtextColor
properties to customize the appearance of the scrolling text. - Call the
startAnimations()
method to initiate the scrolling animation.
import UIKit
import ContinuousScrollingView
// Create an instance of ContinuousScrollingView
let scrollingView = ContinuousScrollingView()
// Customize the scrolling text
scrollingView.textToScroll = "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
scrollingView.font = UIFont.systemFont(ofSize: 16.0)
scrollingView.textColor = .black
// Add the scrolling view to your view hierarchy
view.addSubview(scrollingView)
// Start the scrolling animation
scrollingView.startAnimations()
- iOS 11.0+
- Swift 5.0+
You can use Swift Package Manager to integrate ContinuousScrollingView
into your Xcode project. Follow these steps:
- In Xcode, select File > Swift Packages > Add Package Dependency...
- Enter the URL of this repository: https://github.com/deniz-yuce/SwiftContinuousScrollingView.git
- Follow the prompts to specify the version and location for the package.
- Click Finish to add the package to your project.
ContinuousScrollingView
is available under the MIT license. See the LICENSE file for more information.