Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Crash] on storyboard + reference to storyboard #126

Closed
gorbat-o opened this issue Jul 31, 2016 · 5 comments
Closed

[Crash] on storyboard + reference to storyboard #126

gorbat-o opened this issue Jul 31, 2016 · 5 comments

Comments

@gorbat-o
Copy link

Hi,

On execution i found a nil value when im using a reference to storyboard

capture d ecran 2016-07-31 a 04 35 05

capture d ecran 2016-07-31 a 04 35 31

Maybe an idea ?
thanks :)

@gorbat-o
Copy link
Author

Hey, so,

i found a solution for the moment, it's using .. one storyboard without reference to other for this case .. :/

I ve got an other problem, it's with the blue color on selected image

i fix this in patching the class like this

//  RAMBounceAnimation.swift
//
// Copyright (c) 11/10/14 Ramotion Inc. (http://ramotion.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

import UIKit


/// The RAMBounceAnimation class provides bounce animation.
public class RAMBounceAnimation : RAMItemAnimation {

    /**
     Start animation, method call when UITabBarItem is selected

     - parameter icon:      animating UITabBarItem icon
     - parameter textLabel: animating UITabBarItem textLabel
     */
    override public func playAnimation(icon : UIImageView, textLabel : UILabel) {
        playBounceAnimation(icon)
        textLabel.textColor = textSelectedColor
    }

    /**
     Start animation, method call when UITabBarItem is unselected

     - parameter icon:      animating UITabBarItem icon
     - parameter textLabel: animating UITabBarItem textLabel
     - parameter defaultTextColor: default UITabBarItem text color
     - parameter defaultIconColor: default UITabBarItem icon color
     */
    override public func deselectAnimation(icon : UIImageView, textLabel : UILabel, defaultTextColor : UIColor, defaultIconColor: UIColor) {
        textLabel.textColor = defaultTextColor

        if let iconImage = icon.image {
            let renderMode = CGColorGetAlpha(defaultIconColor.CGColor) == 0 ? UIImageRenderingMode.AlwaysOriginal :
                UIImageRenderingMode.AlwaysTemplate
            let renderImage = iconImage.imageWithRenderingMode(renderMode)
            icon.image = renderImage
            //            icon.tintColor = UIColor.clearColor()
        }
    }

    /**
     Method call when TabBarController did load

     - parameter icon:      animating UITabBarItem icon
     - parameter textLabel: animating UITabBarItem textLabel
     */
    override public func selectedState(icon : UIImageView, textLabel : UILabel) {
        textLabel.textColor = textSelectedColor

        if let iconImage = icon.image {
            //            let renderImage = iconImage.imageWithRenderingMode(.AlwaysTemplate)
            icon.image = iconImage
            //            icon.tintColor = UIColor.clearColor()
        }
    }

    func playBounceAnimation(icon : UIImageView) {

        let bounceAnimation = CAKeyframeAnimation(keyPath: Constants.AnimationKeys.Scale)
        bounceAnimation.values = [1.0 ,1.4, 0.9, 1.15, 0.95, 1.02, 1.0]
        bounceAnimation.duration = NSTimeInterval(duration)
        bounceAnimation.calculationMode = kCAAnimationCubic

        icon.layer.addAnimation(bounceAnimation, forKey: nil)

        if let iconImage = icon.image {
            //            let renderImage = iconImage.imageWithRenderingMode(.AlwaysTemplate)
            icon.image = iconImage
            //            icon.tintColor = UIColor.clearColor()
        }
    }
}

@blelem
Copy link

blelem commented Sep 9, 2016

I'm facing the same issue: " [Crash] on storyboard + reference to storyboard", using release 1.5.3. My project crashes on the same line as reported above.
Are references to storyboard supported by the animated toolbar? Although not a must have, I like the approach to spread each pages on it's own storyboard.

@gitwizChen
Copy link

+1. Any help?

@SeRG1k17
Copy link

SeRG1k17 commented Feb 20, 2017

+1, not working
Storyboard

@0ber
Copy link
Contributor

0ber commented Apr 16, 2018

Duplicate of #93

@0ber 0ber marked this as a duplicate of #93 Apr 16, 2018
@0ber 0ber closed this as completed Apr 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants