1

I am using the source of HJImagesToVideo https://github.com/HarrisonJackson/HJImagesToVideo

When I compiled the sample code provided by him, it is working fine with Xcode 7.2 but when I am using this in my swift project it is not working and showing some errors on

    buffer = [HJImagesToVideo pixelBufferFromCGImage:[array[i] CGImage] size:CGSizeMake(480, 320)]; //line # 212 of HJImagesToVideo.m

    buffer = [HJImagesToVideo crossFadeImage:[array[i] CGImage]
                                                     toImage:[array[i + 1] CGImage]
                                                      atSize:CGSizeMake(480, 320)
                                                   withAlpha:j/framesToFadeCount]; //line # 241 of HJImagesToVideo.m

    UISaveVideoAtPathToSavedPhotosAlbum(tempPath, self, nil, nil);  //line # 150 of 

and the errors are:

/Users/Raza/my apps/appname/app-name/HJImagesToVideo.m:213:64: No known instance method for selector 'CGImage'

and

/Users/Raza/my apps/appname/app-name/HJImagesToVideo.m:213:54: Implicit conversion of Objective-C pointer type 'id' to C pointer type 'CGImageRef' (aka 'struct CGImage *') requires a bridged cast

on line # 213 and 241

and on line # 150 error is:

Users/Raza/my apps/appname/app-name/HJImagesToVideo.m:150:28: Implicit declaration of function 'UISaveVideoAtPathToSavedPhotosAlbum' is invalid in C99

Can anyone can help me to figure out these problem?

Thanks in advance

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
Muhammad Raza
  • 952
  • 7
  • 24

1 Answers1

3

UISaveVideoAtPathToSavedPhotosAlbum is defined in UIKit. Have you forgot to import UIKit ?

Xvolks
  • 2,065
  • 1
  • 21
  • 32
  • This is not a big issue, other errors are big issues that i m not able to solve – Muhammad Raza Feb 11 '16 at 11:16
  • 1
    I'm sorry, but I tried it by myself and importing UIKit fixes the problem. Just add #import after #import "HJImagesToVideo.h" in _HJImagesToVideo.m_ – Xvolks Feb 11 '16 at 12:03
  • I have solved that error Users/Raza/my apps/appname/app-name/HJImagesToVideo.m:150:28: Implicit declaration of function 'UISaveVideoAtPathToSavedPhotosAlbum' is invalid in C99 Can you please help me to solve problem on line # 213 and 241? – Muhammad Raza Feb 11 '16 at 12:20