IOS加载网络图片(Kingfisher)

    技术2022-08-31  97

    博主使用IOS开发框架:SWIFTUI   详细页面如下:  https://github.com/onevcat/Kingfisher/wiki/SwiftUI-Support   安装方式:

    CocoaPods

        pod 'Kingfisher/SwiftUI'     SwiftUI support is provided in a sub-spec. So instead of specifying  pod 'Kingfisher' , you need  pod 'Kingfisher/SwiftUI' .   Swift文件中加载方法: import struct Kingfisher.KFImage // If you are using CocoaPods, in which the SwiftUI support is defined in the same module. import struct Kingfisher . KFImage     简单使用方法:   如果要加载Http的图片,需要进行如下修改: 选择工程中的TARGETS->Info,添加AppTransportSecurity类型Dictionary。在AppTransportSecurity下添加AllowsArbitraryLoads类型Boolean, 值设为YES。    
    Processed: 0.011, SQL: 9