资源算法SpotlightLyrics

SpotlightLyrics

2020-01-08 | |  29 |   0 |   0

图片.png


CocoaPods Compatible

中文说明请点击这里

Introducing

SpotlightLyrics is an open-source library which helps developers in parsing & displaying LRC files, it is completely developed under Swift 4.2 and designed for both iPhone and iPad platforms.

图片.png

Getting Started

Cocoapods

pod 'SpotlightLyrics'

Manually

  • Download or clone the repository and then compile it to obtain SpotlightLyrics.framework,

  • Copy SpotlightLyrics.framework from frameworks folder to the your project,

  • Open your project in XCode and navigate to General - Linked Frameworks and Libraries to add the component into you project

How To Use

To start using SpotlightLyrics in your files, just do the following:

import SpotlightLyrics

LyricaParser

If you only parse LRC files, you can use the class LyricsParser, here's an example for it:

import SpotlightLyrics// ... Load the LRC string from local or remote// Pass your lyrics string to create an instancelet parser = LyricsParser(lyrics: lyricsString)// Now you get everything about the lyricsprint(parser.header.title)print(parser.header.author)print(parser.header.album)for lyric in parser.lyrics {  print(lyric.text)  print(lyric.time)
}

LyricsView

SpotlightLyrics provids an LRC displaying component for showing lyrics and scrolling like most of the music apps do:

import SpotlightLyrics// ... Load the LRC string from local or remote// Create an instance and add it to your UIlet lyricsView = LyricsView()
lyricsView.frame = self.view.boundsself.view.addSubView(lyricsView)// Pass the LRC string and style the LyricsViewlyricsView.lyrics = lyricsString
lyricsView.font = UIFont.systemFont(ofSize: 13)
lyricsView.textColor = UIColor.blacklyricsView.highlightedFont = UIFont.systemFont(ofSize: 13)
lyricsView.highlightedTextColor = UIColor.lightGray// PlaylyricsView.timer.play()// PauselyricsView.timer.pause()// Seek to an eplased timelyricsView.timer.seek(toTime: 20.0)// Start it overlyricsView.timer.seek(toTime: 0)
lyricsView.timer.play()

Also, please check the Demo

Stylish

LyricsView supports the following properties to allow you to make it up.

Property NameTypeDefault ValueDescription
lyricTextColorUIColorLightGrayThe color of the unhighlighted lyrics
lyricHighlightedTextColorUIColorBlackThe color of the highlighted lyrics
lyricFontUIFontSystem 16The font of the unhighlighted lyrics
lyricHighlightedFontUIFontSystem 16 BoldThe font color of the highlighted lyrics
lineSpacingCGFloat16The spacing of each lyric lines

Objective-C compatibility

This respository hasn't been tested under Objective-C environment in any way.

Contributing

Any contribution is welcomed, please post PR or report issue if you have any good idea or encounter any problem. Thank you!

License

MIT licensed.


上一篇:Spotlight

下一篇:Spotlight-Desktop

用户评价
全部评价

热门资源

  • seetafaceJNI

    项目介绍 基于中科院seetaface2进行封装的JAVA...

  • spark-corenlp

    This package wraps Stanford CoreNLP annotators ...

  • Keras-ResNeXt

    Keras ResNeXt Implementation of ResNeXt models...

  • capsnet-with-caps...

    CapsNet with capsule-wise convolution Project ...

  • shih-styletransfer

    shih-styletransfer Code from Style Transfer ...