杨锴
2024-11-26 19e3fd5eecfa5fdf1b16b60e3462a5a61de1136e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//
//  CLImageHelper.swift
//  CLPlayer
//
//  Created by Chen JmoVxia on 2021/10/27.
//
 
import UIKit
 
public class CLImageHelper: NSObject {
    public static func imageWithName(_ name: String) -> UIImage? {
        let filePath = Bundle(for: classForCoder()).resourcePath! + "/CLPlayer.bundle"
        let bundle = Bundle(path: filePath)
        let scale = max(min(Int(UIScreen.main.scale), 2), 3)
        return .init(named: "\(name)@\(scale)x", in: bundle, compatibleWith: nil)
    }
}