【问题标题】:Expected a type error in 'myproj'-Bridging-Header.swift预计“myproj”-Bridging-Header.swift 中会出现类型错误
【发布时间】:2017-02-17 13:11:35
【问题描述】:

enter image description here当我将 UIIMage+Gif.swift 文件添加到我的 Objective C 项目以在我的 Obj-C 项目内的 Swift 文件中添加 GIF 图像时,我在生成的 swift 头文件中出现“预期类型”错误。

+ (double)delayForImageAtIndex:(NSInteger)index source:(CGImageSourceRef _Null_unspecified)source;
+ (UIImage * _Nullable)animatedImageWithSource:(CGImageSourceRef _Nonnull)source;

【问题讨论】:

    标签: ios objective-c swift uiimage gif


    【解决方案1】:

    简单,

    通过右键单击左侧面板添加新文件,其中所有目标 c 文件并添加新文件并将其命名为 uiimage+gif 它的工作

    【讨论】:

    • 我已经添加了一个新的 swift 文件并将其命名为 UIImage+Gif 并在其中插入代码并运行我在自动生成的 swift 文件中出现编译错误'预期类型'
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-06-21
    • 1970-01-01
    • 1970-01-01
    • 2017-03-23
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多