swiftxcodecanvasawakefromnib

Buildtime Canvas Pod xCode issue | missing a [super awakeFromNib] call || from CSAnimationView.m file


I just added the canvas pod (through cocoapods) and I can see the files in my workspace just fine, and I was able to "import Canvas" into my ViewController.swift. But I am getting a semantic build time error that the file CSAnimationView.m is possibly missing a method [super awakeFromNib][errorscreenshot]1

/*
* This file is part of the Canvas package.
* (c) Canvas <usecanvas@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

#import "CSAnimationView.h" @implementation CSAnimationView

- (void)awakeFromNib {
if (self.type && self.duration && ! self.pauseAnimationOnAwake) {[self startCanvasAnimation];
}
}

- (void)startCanvasAnimation {

    Class <CSAnimation> class = [CSAnimationclassForAnimationType:self.type];

    [class performAnimationOnView:self duration:self.durationdelay:self.delay];

    [super startCanvasAnimation];
}

@end

Solution

  • Since:

    1) the library you are trying to add, "Canvas", is 3 and more years is not being updated, latest version is 0.1.2, see here: https://github.com/CanvasPod/Canvas/releases

    2) Xcode >= 8 requires [super awakeFromNib], please read here: Calling awakeFromNib of superclass and here:

    You must call the super implementation of awakeFromNib to give parent classes the opportunity to perform any additional initialization they require. Although the default implementation of this method does nothing, many UIKit classes provide non-empty implementations. You may call the super implementation at any point during your own awakeFromNib method.

    The only way to build it, is adding manually the branch master and fix by yourself the issue(s)