func group(animations : [CAAnimation], fillMode : CAMediaTimingFillMode!, forEffectLayer : Bool = false, sublayersCount : NSInteger = 0) -> CAAnimationGroup!{
let groupAnimation = CAAnimationGroup()
groupAnimation.animations = animations

if (fillMode != nil){
if let animations = groupAnimation.animations {
for anim in animations {
anim.fillMode = fillMode
}
}
groupAnimation.fillMode = fillMode
groupAnimation.isRemovedOnCompletion = false
}

if forEffectLayer{
groupAnimation.duration = QCMethod.maxDuration(ofEffectAnimation: groupAnimation, sublayersCount: sublayersCount)
}else{
groupAnimation.duration = QCMethod.maxDuration(ofAnimations: animations)
}

return groupAnimation
}
