Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/101.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 在集合视图Swift中处理n个gif_Ios_Swift - Fatal编程技术网

Ios 在集合视图Swift中处理n个gif

Ios 在集合视图Swift中处理n个gif,ios,swift,Ios,Swift,在我的项目中,我实现了一个从API加载了大量gif的视图。所有对象都在集合视图中分组。我这里有一个问题,应用程序意外退出,在调试器中我得到类似“由于内存问题而终止”的提示 所以,请帮我整理一下同样的问题。如果第三方库可以处理此问题,也可以 提前谢谢 尝试此库:。它支持GIF。 您只需在cellForItem方法中设置gif链接,此库将处理其余内容(包括下载和缓存文件): 请尝试此库:。它支持GIF。 您只需在cellForItem方法中设置gif链接,此库将处理其余内容(包括下载和缓存文件):

在我的项目中,我实现了一个从API加载了大量gif的视图。所有对象都在集合视图中分组。我这里有一个问题,应用程序意外退出,在调试器中我得到类似“由于内存问题而终止”的提示

所以,请帮我整理一下同样的问题。如果第三方库可以处理此问题,也可以

提前谢谢

尝试此库:。它支持GIF。 您只需在cellForItem方法中设置gif链接,此库将处理其余内容(包括下载和缓存文件):

请尝试此库:。它支持GIF。 您只需在cellForItem方法中设置gif链接,此库将处理其余内容(包括下载和缓存文件):


尝试此目标C库以避免内存警告

示例代码片段

        YFGIFImageView *launcherImageView =[[YFGIFImageView alloc]initWithFrame:[[UIScreen mainScreen] bounds]];
        launcherImageView.gifPath = [[NSBundle mainBundle] pathForResource:@"matis.gif" ofType:nil];;
        launcherImageView.unRepeat = YES;

        launcherImageView.clipsToBounds = YES;
        [self.window addSubview:launcherImageView];
        [launcherImageView startGIF];

尝试此目标C库以避免内存警告

示例代码片段

        YFGIFImageView *launcherImageView =[[YFGIFImageView alloc]initWithFrame:[[UIScreen mainScreen] bounds]];
        launcherImageView.gifPath = [[NSBundle mainBundle] pathForResource:@"matis.gif" ofType:nil];;
        launcherImageView.unRepeat = YES;

        launcherImageView.clipsToBounds = YES;
        [self.window addSubview:launcherImageView];
        [launcherImageView startGIF];

您可以使用objective C library以便我可以提供给您吗?从调试消息中可以清楚地看到您的内存不足。您可以使用objective C library以便我可以提供给您吗?从调试消息中可以清楚地看到您的内存不足。谢谢,正在工作。谢谢,正在工作。