PauliusVindzigelskis / StarWarsTextView

Star Wars intro style Text View

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

StarWarsTextView

Version Platform Language GitHub license

Subclass of UITextView to present Star Wars style credits. Includes original Star Wars font (News Gothic) and animation API to crawl from top to bottom slowly.

Note: Suggested to setup through Xib/Storyboard as CALayer transformations will disrupt AutoLayout constrainted frames. IBDesginables might help adjust view in screen

Podfile (for use with Cocoapods)

pod 'StarWarsTextView'

API

Initilize via code or XIB/Storyboard

Delegate

protocol StarWarsTextViewDelegate : NSObjectProtocol
{
    optional func starWarsTextViewDidStartScrolling(_ textView:StarWarsTextView)
    optional func starWarsTextViewDidFinishScrolling(_ textView:StarWarsTextView)
}

Public Properties

public static func starWarsFont() -> UIFont

public weak var starWarsDelegate: StarWarsTextViewDelegate?
public var scrollingSpeed: CGFloat
public var animationStepsInterval: TimeInterval
public var inclinationRatio: CGFloat
public var xAngle: CGFloat
public var isCrawling: Bool

Public Functions

public func scrollToTop(animated: Bool = false)
public func startCrawlingAnimation()
public func stopCrawlingAnimation()

Demo

simulator screen shot - iphone se - 2018-02-20 at 12 02 43 simulator screen shot - iphone se - 2018-02-20 at 12 02 36

starwarsdemo2

About

Star Wars intro style Text View

License:MIT License


Languages

Language:Swift 88.4%Language:Ruby 11.6%