LevitateView is a framework
designed to enhance your iOS applications with an interactive view element at the bottom of the screen when you scroll down. This view allows users to quickly scroll back to the top of the view when tapped, improving navigation and user experience.
Scroll-to-Top Button: A view that appears when scrolling down, enabling users to quickly return to the top of the view with a single tap.
Customizable Design: Easily customize the appearance of the scroll-to-top button, including colors, icons, and animations.
Smooth Animations: Provides a smooth scrolling experience with customizable animation options.
iOS 14.0+
Swift 5.0+
Here's an example of how to use LevitateView in your project:
import SwiftUI
import LevitateView
struct ContentView: View {
private let dataModel = LevitatingViewModel(image: Image(systemName: "arrow.up"),
levitateBottomPadding:20,
levitateScrollOffset:250,
colorBackground: .red,
colorForeground:.white)
var body: some View {
LevitatingView(content: MockVerticalListView(),
dataModel: dataModel)
}
}
#Preview {
ContentView()
}
You can customize the appearance and behavior of the scroll-to-top button by modifying the properties of the LevitatingViewModel:
image: The image/icon displayed on the button.
colorForeground: The color of the icon.
colorBackground: The background color of the button.
levitateBottomPadding: The padding from the bottom of the screen.
levitateScrollOffset: The offset threshold at which the button appears.
Here are video demonstrations of LevitateView in action, showing both dark mode and light mode:
Light Mode
Dark Mode
LevitateView is released under the MIT license. See LICENSE for details.
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
For any questions or suggestions, feel free to contact me at [email protected].