kst

KSTimeline

Simple custom timeline written in swift

Showing:

Popularity

Downloads/wk

0

GitHub Stars

160

Maintenance

Last Commit

4yrs ago

Contributors

1

Package

Dependencies

0

License

MIT

Categories

Readme

KSTimeline

KSTimeline, written in swift, is a simple and customizable view which supports showing a series of events in a vertically time-sorted structure.

Preview

Demo1

  • adjust the time scale by pinch gesture
  • display different time mode according to time scale

Demo2

  • play next event automatically
  • scroll to seek video
  • press > to next video
  • press < to previous video

Usage

Delegate

@objc public protocol KSTimelineDelegate: NSObjectProtocol {
    
    func timelineStartScroll(_ timeline: KSTimelineView)
    
    func timelineEndScroll(_ timeline: KSTimelineView)
    
    func timeline(_ timeline: KSTimelineView, didScrollTo date: Date)
    
}

Datasource

@objc public protocol KSTimelineDatasource: NSObjectProtocol {
    
    func numberOfEvents(_ timeline: KSTimelineView) -> Int
    
    func event(_ timeline: KSTimelineView, at index: Int) -> KSTimelineEvent
    
}

KSTimelineEvent

@objc public class KSTimelineEvent: NSObject {
    
    public var start: Date
    
    public var end: Date
    
    public var duration: Double
    
    public var videoURL: URL
    
    public init(start: Date, end: Date, duration: Double, videoURL: URL) {
        
        self.start = start
        
        self.end = end
        
        self.duration = duration
        
        self.videoURL = videoURL
        
        super.init()
        
    }
        
}

Installation

Cocoapods

KSTimeline can be added to your project using CocoaPods by adding the following line to your Podfile:

pod 'KSTimeline'

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100