• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
UIView rotate and cross-fade at the same time
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

UIView rotate and cross-fade at the same time


  • Subject: UIView rotate and cross-fade at the same time
  • From: "Eric E. Dolecki" <email@hidden>
  • Date: Tue, 06 Oct 2015 13:04:00 +0000

I have a UIView with a UIImageView in it, a button on top of that. I want
to trigger a rotation with an image cross-fade* at the same time*. This
isn't working for me. Is there a better solution?

@IBAction func newMagicPressed(sender: UIButton) {

        if bMagicButtonCloseMode {

            let toImage = UIImage(named: "presetButtonIcon.png")

            UIView.transitionWithView(self.magicButtonImage,

                duration:0.5,

                options: UIViewAnimationOptions.TransitionCrossDissolve,

                animations: { self.magicButtonImage.image = toImage },

                completion: nil)



            UIView.animateWithDuration(0.5, animations: {

                self.MagicButton.transform =
CGAffineTransformMakeRotation((90.0 * CGFloat(M_PI)) / 180.0)

            })



        } else {

            let toImage = UIImage(named: "close.png")

            UIView.transitionWithView(self.magicButtonImage,

                duration:0.5,

                options: UIViewAnimationOptions.TransitionCrossDissolve,

                animations: { self.magicButtonImage.image = toImage },

                completion: nil)



            UIView.animateWithDuration(0.5, animations: {

                self.MagicButton.transform =
CGAffineTransformMakeRotation((0.0 * CGFloat(M_PI)) / 180.0)

            })



        }

        bMagicButtonCloseMode = !bMagicButtonCloseMode

    }

Thanks - I know reading code in an email isn't fun.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Prev by Date: Re: More Swift issues, NSURLComponents
  • Next by Date: Re: More Swift issues, NSURLComponents
  • Previous by thread: Re: More Swift issues, NSURLComponents
  • Next by thread: Custom UIView receiving no touch events?
  • Index(es):
    • Date
    • Thread