杨锴
2024-08-28 4d776ec3b272c40c5d9058af875211811835793f
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)
    }
}