 //
 
 import UIKit
+
 
 /// 应用版本号 Build 字段格式
 ///

    {
        return Bundle.main.path(forResource: name, ofType: ext)
    }
    
    /// 获取 Main Bundle 中文件内的字符串
    /// - Parameters:
    ///   - name: 文件名

    public func imagePath(forResource name: String?, ofType ext: String?) -> String? {
        guard let name = name else { return nil }
        guard let ext = ext else { return nil }

        var scaleString = "@2x"
        if UIScreen.main.scale == 3.0 {
            scaleString = "@3x"
        } else if UIScreen.main.scale == 1.0 {
            scaleString = "@1x"
        }

        guard let path = base.path(forResource: name + scaleString, ofType: ext) else {
            return base.path(forResource: name, ofType: ext)
        }
        return path
    }

}
