- Description
- Motivation
- Features
- Installation
- Platform and Version Support
- Usage
- Example Project
- Contribution
ScrollViewRTL is a custom SwiftUI ScrollView designed to support right-to-left (RTL) layouts.
ScrollViewRTL was created to address a common issue in SwiftUI applications where changing the language inside the app did not automatically flip the ScrollView to right-to-left (RTL) layout. This package provides an easy-to-use solution that seamlessly integrates RTL scrolling behavior, ensuring a consistent and user-friendly experience when switching between different languages within an application. If you've encountered challenges with ScrollView behavior during language changes in your SwiftUI app, ScrollViewRTL aims to simplify the implementation and make it accessible to other developers facing similar issues. Your contributions and feedback are welcome as we work together to enhance SwiftUI applications with improved RTL support.
- Easy integration of RTL scrolling behavior in SwiftUI applications.
- Supports both horizontal and vertical scrolling.
- Provides options to control scroll indicators.
To integrate ScrollViewRTL into your Xcode project, follow these steps:
- In Xcode, select File > Swift Packages > Add Package Dependency....
- Enter the following URL when prompted: [https://github.com/Muhammadbarznji/ScrollViewRTL.git]
- Follow the on-screen instructions to complete the integration.
ScrollViewRTL supports the following platforms and minimum versions:
- macOS: 10.14 and later
- iOS: 13.0 and later
- tvOS: 13.0 and later
To use ScrollViewRTL in your SwiftUI views, follow these steps:
-
Import ScrollViewRTL into your SwiftUI file:
import ScrollViewRTL
-
Initialize an instance of ScrollViewRTL by specifying the RowType:
ScrollViewRTL(type: .horizontal) { // Your content here }
Replace
.horizontal
with.vertical
as needed. -
Customize the ScrollViewRTL instance by adjusting the
showsIndicators
parameter:ScrollViewRTL(type: .vertical, showsIndicators: false) { // Your content here }
To help you get started quickly, an example project demonstrating the usage of ScrollViewRTL is included in the Example directory. The example project showcases a SwiftUI application with language-changing buttons and a ScrollViewRTL instance for both horizontal and vertical scrolling.
To run the example project:
- Navigate to the Example directory.
- Open the
ScrollViewRTLExample.xcodeproj
file in Xcode. - Build and run the project.
Feel free to explore the example project to see how ScrollViewRTL can be integrated into your SwiftUI applications.
Your contributions are highly welcome! If you encounter any issues, have feature requests, or want to contribute to the development of ScrollViewRTL, here's how you can get involved:
-
Issue Reporting:
- If you find a bug or have a general question, please open an issue to report it.
-
Feature Requests:
- If you have a feature request or would like to propose an enhancement, please open an issue to discuss it.
-
Pull Requests:
- Contributions through pull requests are highly appreciated.
- Fork the repository and create a new branch for your changes.
- Ensure your code adheres to the existing coding style and Swift conventions.
- Create a pull request, providing a clear description of your changes and the problem or feature they address.
-
Spread the Word:
- If ScrollViewRTL has been helpful to you, consider giving it a star on GitHub. This helps others discover the package.