Skip to content

Zrzzzz/ZrMusic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ZrMusic

一些技术相关:https://zrzzzz.github.io/

ZrExtension

UIView.superView()

func superView<T: UIView>(of: T.Type) -> T? {
        for view in sequence(first: self.superview, next: { $0?.superview }) {
            if let father = view as? T {
                return father
            }
        }
        return nil
    }

用于寻找父View, 不过只能寻找到第一个就是了

UILabel.fontSuitToFrame()

func fontSuitToFrame() {
        let aView = self.sizeThatFits(CGRect.zero.size)
        guard aView.width * aView.height != 0 else { return }
        let rate1 = self.frame.width / aView.width
        let rate2 = self.frame.height / aView.height
        let rate = rate1 > rate2 ? rate2 : rate1
        self.font = .systemFont(ofSize: self.font.pointSize * rate)
    }

宽高哪个窄就铺满哪一个

DyColor(light: UIColor, dark: UIColor) -> UIColor

func DyColor(light: UIColor, dark: UIColor) -> UIColor {
    return UIColor(dynamicProvider: { (trait) -> UIColor in
        return trait.userInterfaceStyle != .dark ? light : dark
    })
}

Login

image-20200213140522029 image-20200213140748891

两种登录方式,输入不对或者密码错误时会弹窗

Mine

image-20200213140849662成功登录后会跳转到歌单页面,点击箭头实现收缩展开,点击添加图标添加新歌单。

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published