Installation
The Squall SDK comes as a dynamic framework and requires at least Xcode 7.0 to run. You can install Squall manually or use it via cocoapods.
Download Squall SDK
Cocoapods Installation
The cocoapods integration should be pretty straightforward.

Just add the pod "Squall" to your podfile, run pod install and you should be good to go.

Make sure your deployment target is at least iOS 8 or higher.

Example:

platform :ios, '8.0'

use_frameworks!

target 'MyApp' do
	pod 'Squall'
end
You can also get all the latest changes straight from the Github repo by using:

 pod 'Squall', :git=> 'https://github.com/marcuseckert/Squall'
Manual Installation
Drag the framework into your project and add it to Embedded Binaries and Linked Frameworks and Libraries.
Stripping Invalid Architectures
The Squall SDK runs on both the simulator and the device. Due to a bug in XCode simulator slices of dynamic frameworks are currently not stripped before the app is sent to the App Store resulting in an error message when you try to deploy.

To fix this, add a "Run Script Phase" at the end of the build phases to your target and paste in the code from this link. This should strip all non-valid architectures from the frameworks in the framework folder of your build target before archiving the app.

Read more on the topic here.

License
To enable all features, provide Squall with your license key before you use any of the Squall classes.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [Squall setLicenseKey:@"YOUR-LICENSE-KEY"];
    return YES;
}

Animations
Sqa files are not animation-specific. Each file allows you to construct both Squall and Core Animations.
Building an Animation
SLSquallAnimation *animation = [SLSquallAnimation animationFromBundle:@"myAnimation.sqa"];
[animation play];
[self.layer addSublayer:animation];
Controlling Playback
Both Squall and Core Animations inherit from SLAnimation which allows you to control the flow of an animation.

A Core Animation can be adapted by passing in a delegate object that implements the SLCoreAnimationBuildDelegate protocol. It allows you to change or skip animations before they are added to their respective layer.

Previewing Animations in Your App
The Squall SDK also allows you to preview animations in the context of an already existing app. All that needs to be done is to create an instance of SLLivePreview and pass in the layer any incoming animation should be added to. The IP address of your device will be printed to the console.

You can also implement the SLLivePreviewDelegate protocol, wait for the connection to be established and then read out the ipAddress or bonjourName property of your SLLivePreview instance.

SLLivePreview* preview = [[SLLivePreview alloc] initWithPreviewLayer:self.view.layer];

By default the animation will be scaled to properly fit the layer. The resizingBehavior property allows you to change this behavior.

By implementing the SLLivePreviewDelegate protocol you can respond to events.


Tipps
Changing Text Layers
The following examples shows you how to dynamically change text layers coming from After Effects. Before you begin make sure that your text layer in After Effects has a unique name.


NSError* error;
SLSquallAnimation *animation = [SLSquallAnimation animationFromBundle:@"myAETextAnimation.sqa" 
                                                  error:&error];
if (!error) {
    SLTextLayer* testLayer = [animation getTextLayerWithName:@"myAETextLayer"];
    textLayer.text = @"new Text";
    [textLayer layoutText];
    
    //Prevents the animation to clip the text layer should it 
    //now exceed the bounds of the main composition layer.
    animation.rootLayer.masksToBounds = false;

    [animation play];
    [self.view.layer addSublayer:animation];
}