All Projects → SwiftUIKit → Marquee

SwiftUIKit / Marquee

Licence: MIT license
A powerful implementation of Marquee(scrolling text or label) in SwiftUI, which supports any content view, including text(label), image, video, etc.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Marquee

Marqueeview
俗名:可垂直跑、可水平跑的跑马灯;学名:可垂直翻、可水平翻的翻页公告
Stars: ✭ 3,600 (+8081.82%)
Mutual labels:  marquee, marqueeview
react-native-lahk-marquee-label
A react-native marquee label component.
Stars: ✭ 49 (+11.36%)
Mutual labels:  marquee, marquee-label
Ptimagealbumviewcontroller
"Image Album" — or "Photo Album" if you like that better — View( Controller) for all crazy iOS developers out there...
Stars: ✭ 199 (+352.27%)
Mutual labels:  gallery
Weather-SwiftUI
A weather app that uses the Dark Sky API built using SwiftUI! Get the current weather for a particular location and check out the 5-day forecast!
Stars: ✭ 107 (+143.18%)
Mutual labels:  swiftui
Sphinx Gallery
Sphinx extension for automatic generation of an example gallery
Stars: ✭ 239 (+443.18%)
Mutual labels:  gallery
Googliser
a fast BASH multiple-image downloader
Stars: ✭ 202 (+359.09%)
Mutual labels:  gallery
D-KMP-sample
D-KMP Architecture official sample: it uses a shared KMP ViewModel and Navigation for Compose and SwiftUI apps.
Stars: ✭ 636 (+1345.45%)
Mutual labels:  swiftui
Gallery shell
📷 Bash Script to generate static responsive image web galleries.
Stars: ✭ 198 (+350%)
Mutual labels:  gallery
clouds
🌦 A weather app for iOS, written in SwiftUI.
Stars: ✭ 26 (-40.91%)
Mutual labels:  swiftui
React Image Gallery
React carousel image gallery component with thumbnail support 🖼
Stars: ✭ 2,946 (+6595.45%)
Mutual labels:  gallery
SSImagePicker
Easy to use and configurable library to Pick an image from the Gallery or Capture an image using a Camera... 📸
Stars: ✭ 227 (+415.91%)
Mutual labels:  gallery
React Animated Slider
Animated slider/carousel component for react
Stars: ✭ 229 (+420.45%)
Mutual labels:  gallery
Prosopopee
a static website generator to make beautiful customizable pictures galleries that tell a story
Stars: ✭ 207 (+370.45%)
Mutual labels:  gallery
vimeography
The easiest way to display beautiful video collections on your WordPress site.
Stars: ✭ 14 (-68.18%)
Mutual labels:  gallery
React Slideshow
A react component for slideshow supporting slide, fade and zoom
Stars: ✭ 201 (+356.82%)
Mutual labels:  gallery
UrbanVillageProjectScreens
Pretty iOS mobile screens + AVPlayer video view – made in SwiftUI
Stars: ✭ 23 (-47.73%)
Mutual labels:  swiftui
Qml Creative Controls
QML controls for creative applications and creative coding
Stars: ✭ 199 (+352.27%)
Mutual labels:  gallery
Ownphotos
Self hosted alternative to Google Photos
Stars: ✭ 2,587 (+5779.55%)
Mutual labels:  gallery
Tikz
Galley of Tikz drawings.
Stars: ✭ 251 (+470.45%)
Mutual labels:  gallery
PineappleTimer
Pomodoro timer with 🍍 theme, an independent watchOS 6 app
Stars: ✭ 34 (-22.73%)
Mutual labels:  swiftui

Marquee

A powerful implementation of Marquee(scrolling text or label) in SwiftUI, which supports any content view, including text(label), image, video, etc.

Blog SwiftUI: How to create a powerful Marquee?

Features

  • Supports any content view powered by ViewBuilder.
  • Supports autoreverses.
  • Supports custom duration.
  • Supports custom direction.
    • left2right
    • right2left
  • Marquee when content view not fit.

Installation

Swift Package Manager

In Xcode go to File -> Swift Packages -> Add Package Dependency and paste in the repo's url: https://github.com/SwiftUIKit/Marquee.

Usage

Any Content View

Text(Label)

import SwiftUI
import Marquee

struct ContentView: View {
    var body: some View {
        Marquee {
            Text("Hello World!")
                .fontWeight(.bold)
                .font(.system(size: 40))
        }
    }
}

Image

import SwiftUI
import Marquee

struct ContentView: View {
    var body: some View {
        Marquee {
            Image("test")
        }
    }
}

AttributedText

import SwiftUI
import Marquee

struct ContentView: View {
    var body: some View {
        Marquee {
            Text("Bold")
                .fontWeight(.bold)
                .font(.custom("SFUIDisplay-Light", size: 40))
                +
                Text(" Underlined")
                .font(.system(size: 30))
                .underline()
                .foregroundColor(.red)
                + Text(" Color")
                .foregroundColor(.blue)
        }
    }
}

Animation Options

  • duration

Specially, when duration is equal to 0 or Double.infinity, the animation will stop and the view stays at the initial position.

  • autoreverses

  • direction

  • whenNotFit

import SwiftUI
import Marquee

struct ContentView: View {
    @State var duration: Double = 3.0
    @State var autoreverses: Bool = false
    @State var direction: MarqueeDirection = .right2left
    @State var whenNotFit: Bool = false

    var body: some View {
        VStack {
            Marquee {
                VStack {
                    Text("Bold")
                        .fontWeight(.bold)
                        .font(.custom("SFUIDisplay-Light", size: 40))
                        +
                        Text(" Underlined")
                        .font(.system(size: 30))
                        .underline()
                        .foregroundColor(.red)
                        + Text(" Color cccccccccccccccc")
                        .foregroundColor(.blue)
                }
            }.background(Color.white)
            .marqueeDuration(duration)
            .marqueeAutoreverses(autoreverses)
            .marqueeDirection(direction)
            .marqueeWhenNotFit(whenNotFit)
            .marqueeIdleAlignment(.leading)

            Spacer()

            HStack {
                Button(action: {
                    self.duration = (duration == 3.0) ? 1.0 : 3.0
                }, label: {
                    Text("duration")
                })

                Button(action: {
                    self.autoreverses.toggle()
                }, label: {
                    Text("autoreverses")
                })

                Button(action: {
                    self.direction = (direction == .left2right) ? .right2left : .left2right
                }, label: {
                    Text("direction")
                })
                
                Button(action: {
                    self.whenNotFit.toggle()
                }, label: {
                    Text("whenNotFit")
                })

            }.frame(height: 100)
        }.ignoresSafeArea()
    }
}

ChangeLog

v0.3.0

  • add idle alignment.

v0.2.1

  • fix vertical alignment.

v0.2.0

  • add marquee when content view not fit.

v0.1.0

  • add marquee.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].