博主使用IOS开发框架:SWIFTUI
安装方式:
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。