iPhone shine animation

shimmer animation ios swift
awesome ios animation
shimmer ios github
facebook shimmer ios
ios shimmer library
simmer ios
shimmer view ios objective c
shimmer carthage

I'm trying to get my view to do a nice shining animation to catch the user's eyes. Any ideas how to implement this?

Here's what I have so far:

[UIView beginAnimations:@"viewShine" context:self.view];
[UIView setAnimationRepeatAutoreverses:NO];
[UIView setAnimationRepeatCount:0];
[UIView setAnimationDuration:2];
[UIView setAnimationDelegate:self];
//Do nice shining animation here
[UIView commitAnimations];

By shine I mean something like what happens to the "slide to unlock" text when you open the iPhone, or anything that's easy to do and looks nice.

I wrote a method that can be called on any UIView to give it the shine you are looking for without needing to include an image:

-(void)AddShineAnimationToView:(UIView*)aView
{
    CAGradientLayer *gradient = [CAGradientLayer layer];
    [gradient setStartPoint:CGPointMake(0, 0)];
    [gradient setEndPoint:CGPointMake(1, 0)];
    gradient.frame = CGRectMake(0, 0, aView.bounds.size.width*3, aView.bounds.size.height);
    float lowerAlpha = 0.78;
    gradient.colors = [NSArray arrayWithObjects:
                       (id)[[UIColor colorWithWhite:1 alpha:lowerAlpha] CGColor],
                       (id)[[UIColor colorWithWhite:1 alpha:lowerAlpha] CGColor],
                       (id)[[UIColor colorWithWhite:1 alpha:1.0] CGColor],
                       (id)[[UIColor colorWithWhite:1 alpha:1.0] CGColor],
                       (id)[[UIColor colorWithWhite:1 alpha:1.0] CGColor],
                       (id)[[UIColor colorWithWhite:1 alpha:lowerAlpha] CGColor],
                       (id)[[UIColor colorWithWhite:1 alpha:lowerAlpha] CGColor],
                       nil];
    gradient.locations = [NSArray arrayWithObjects:
                          [NSNumber numberWithFloat:0.0],
                          [NSNumber numberWithFloat:0.4],
                          [NSNumber numberWithFloat:0.45],
                          [NSNumber numberWithFloat:0.5],
                          [NSNumber numberWithFloat:0.55],
                          [NSNumber numberWithFloat:0.6],
                          [NSNumber numberWithFloat:1.0],
                          nil];

    CABasicAnimation *theAnimation;
    theAnimation=[CABasicAnimation animationWithKeyPath:@"transform.translation.x"];
    theAnimation.duration = 2;
    theAnimation.repeatCount = INFINITY;
    theAnimation.autoreverses = NO;
    theAnimation.removedOnCompletion = NO;
    theAnimation.fillMode = kCAFillModeForwards;
    theAnimation.fromValue=[NSNumber numberWithFloat:-aView.frame.size.width*2];
    theAnimation.toValue=[NSNumber numberWithFloat:0];
    [gradient addAnimation:theAnimation forKey:@"animateLayer"];

    aView.layer.mask = gradient;
}

How to make a logo shine that moves., over the logo (perhaps from left to right) and makes it look like it's shining mode over the text and animated, constrained by an image mask. Use the Live Link Face app, ARKit, and Live Link to capture facial animations and apply them to characters in Unreal Engine. Unreal Engine 4 Documentation > Engine Features > Skeletal Mesh Animation System > Recording Facial Animation from an iPhone X

Figured it out.

Here's my code in case you want to do something similar:

UIView *whiteView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
[whiteView setBackgroundColor:[UIColor whiteColor]];
[whiteView setUserInteractionEnabled:NO];
[self.view addSubview:whiteView];

CALayer *maskLayer = [CALayer layer];

// Mask image ends with 0.15 opacity on both sides. Set the background color of the layer
// to the same value so the layer can extend the mask image.
maskLayer.backgroundColor = [[UIColor colorWithRed:1.0f green:1.0f blue:1.0f alpha:0.0f] CGColor];
maskLayer.contents = (id)[[UIImage imageNamed:@"ShineMask.png"] CGImage];

// Center the mask image on twice the width of the text layer, so it starts to the left
// of the text layer and moves to its right when we translate it by width.
maskLayer.contentsGravity = kCAGravityCenter;
maskLayer.frame = CGRectMake(-whiteView.frame.size.width, 
                             0.0f, 
                             whiteView.frame.size.width * 2, 
                             whiteView.frame.size.height);

// Animate the mask layer's horizontal position
CABasicAnimation *maskAnim = [CABasicAnimation animationWithKeyPath:@"position.x"];
maskAnim.byValue = [NSNumber numberWithFloat:self.view.frame.size.width * 9];
maskAnim.repeatCount = HUGE_VALF;
maskAnim.duration = 3.0f;
[maskLayer addAnimation:maskAnim forKey:@"shineAnim"];

whiteView.layer.mask = maskLayer;

Using this image:

Lumyer on the App Store, Download Lumyer and enjoy it on your iPhone, iPad, and iPod touch. Give life to your photos with hundreds of realistic animated effects. Download Shine: Calm Anxiety & Stress and enjoy it on your iPhone, iPad, and iPod touch. ‎**Featured as Best of 2018 by the App Store & 2019 Webby Award Winner for Best Lifestyle App** Things are hard right now—get the daily support you need with the Shine app, the #1 self-care app created by women of color.

Here is the swift code for the shine effect

class Animate {

    /// Add a persistent shimmer animation. Usage: `Animate.shimmer(myView)`
    static func shimmer(view: UIView) {
      let gradient = CAGradientLayer()
      gradient.startPoint = CGPointMake(0, 0)
      gradient.endPoint = CGPointMake(1, -0.02)
      gradient.frame = CGRectMake(0, 0, view.bounds.size.width*3, view.bounds.size.height)

      let lowerAlpha: CGFloat = 0.7
      let solid = UIColor(white: 1, alpha: 1).CGColor
      let clear = UIColor(white: 1, alpha: lowerAlpha).CGColor
      gradient.colors     = [ solid, solid, clear, clear, solid, solid ]
      gradient.locations  = [ 0,     0.3,   0.45,  0.55,  0.7,   1     ]

      let theAnimation : CABasicAnimation = CABasicAnimation(keyPath: "transform.translation.x")
      theAnimation.duration = 4
      theAnimation.repeatCount = Float.infinity
      theAnimation.autoreverses = false
      theAnimation.removedOnCompletion = false
      theAnimation.fillMode = kCAFillModeForwards
      theAnimation.fromValue = -view.frame.size.width * 2
      theAnimation.toValue =  0
      gradient.addAnimation(theAnimation, forKey: "animateLayer")

      view.layer.mask = gradient

    }
}

Swift 3.0

func shimmer(view: UIView) {
        let gradient = CAGradientLayer()
        gradient.startPoint = CGPoint(x: 0, y: 0)
        gradient.endPoint = CGPoint(x: 1, y: -0.02)
        gradient.frame = CGRect(x: 0, y: 0, width: view.bounds.size.width*3, height: view.bounds.size.height)

        let lowerAlpha: CGFloat = 0.7
        let solid = UIColor(white: 1, alpha: 1).cgColor
        let clear = UIColor(white: 1, alpha: lowerAlpha).cgColor
        gradient.colors     = [ solid, solid, clear, clear, solid, solid ]
        gradient.locations  = [ 0,     0.3,   0.45,  0.55,  0.7,   1     ]

        let theAnimation : CABasicAnimation = CABasicAnimation(keyPath: "transform.translation.x")
        theAnimation.duration = 2
        theAnimation.repeatCount = Float.infinity
        theAnimation.autoreverses = false
        theAnimation.isRemovedOnCompletion = false
        theAnimation.fillMode = kCAFillModeForwards
        theAnimation.fromValue = -view.frame.size.width * 2
        theAnimation.toValue =  0
        gradient.add(theAnimation, forKey: "animateLayer")

        view.layer.mask = gradient
    }

imwcl/WCLShineButton: This is a UI lib for iOS. Effects like , This is a UI lib for iOS. Effects like shining. to build the framework and drag the built WCLShineButton.framework (in Carthage/Build/iOS folder) into your Xcode� A compilation of all the silly/stupid animations I made about iPhones and Androids throughout the years! With a brand new cartoon called "When you Drop Your Phone on the Ground" and enhanced sound

It might be worth to mention: in case of shining progress label, like in facebook paper app, or iOS lock screen, you might consider using https://github.com/facebook/Shimmer.

modocache/MDCShineEffect: Add a "shine" effect to any view., Add a "shine" effect to any view. Contribute to subscribe. As far as OS X/iOS development resources go, it's the best money you'll ever spend. Animation Apps for iPhone and iPad. Whether you are a beginner or a pro, there is an animation app for your iPhone and iPad. We have covered the best animation app for all major categories, however, if you think I missed something, feel free to share it with us in the comments below.

Swift 5.0

func shimmer(){
    let gradient = CAGradientLayer()
    gradient.startPoint = CGPoint(x: 0, y: 0)
    gradient.endPoint = CGPoint(x: 1, y: -0.02)
    gradient.frame = CGRect(x: 0, y: 0, width: self.bounds.size.width*3, height: self.bounds.size.height)

    let lowerAlpha: CGFloat = 0.8
    let solid = UIColor(white: 1, alpha: 1).cgColor
    //let verdeVXM = UIColor(red:0.77, green:0.84, blue:0.00, alpha:1.0)
    let clear = UIColor(white: 1, alpha: lowerAlpha).cgColor
    gradient.colors     = [ solid, solid, clear, clear, solid, solid ]
    gradient.locations  = [ 0,     0.3,   0.45,  0.55,  0.7,   1     ]

    let theAnimation : CABasicAnimation = CABasicAnimation(keyPath: "transform.translation.x")
    theAnimation.duration = 2
    theAnimation.repeatCount = Float.infinity
    theAnimation.autoreverses = false
    theAnimation.isRemovedOnCompletion = false
    theAnimation.fillMode = CAMediaTimingFillMode.forwards
    theAnimation.fromValue = -self.frame.size.width * 2
    theAnimation.toValue =  0
    gradient.add(theAnimation, forKey: "animateLayer")

    self.layer.mask = gradient
}

HOW TO MAKE A GLOWING ANIMATION ON TIKTOK FOR FREE , Here's how you can make your very on glowing animation on your slowmos, iOS Apps Duration: 17:02 Posted: Jun 16, 2019 My 3D animation assignment for this term. I'm a 3rd year animation student, specializing in 2D animation and video editing. 3D animation is an elective subject that I've been taking for almost 2

Swift Animations: Facebook Shimmer using Gradient Masks, Animations are awesome to build and even more fun to play around with when you get it Duration: 20:44 Posted: Jun 14, 2018 If your iPhone is locked when you receive the message, the type of effect is described in the notification, without any other text preview. As soon as you engage it and open the thread, the animation is played. The same goes for banner notifications that arrive while you’re using the iPhone.

How to Create A Light Sweep (Shine) Effect In Adobe After Effects , This effect gives whatever you're working on a shine/glint to give it a reflective appearance. I Duration: 6:26 Posted: Sep 18, 2017 If you have an iPhone, turn it sideways. If you have an iPad, tap on the keyboard. Write your message or select one of the options at the bottom of the screen. If you need to start over, tap Undo or Clear. When you're finished, tap Done. Then tap to send.

Make your App Come Alive - Pulsing Animation (Ep 3, Make your App Come Alive - Pulsing Animation (Ep 3 - Swift) iOS Swift Tutorial Duration: 20:18 Posted: Dec 13, 2017 ‎Hype your Stories with automatically styled and designed motion typography. Stand out. Don't use those tired tools that everyone else uses and expect your content to shine bright, like a diamond. Short of words? We got you. With the tap of a magical little button automatically pull random, mean…

Comments
  • What does a "shine" mean to you?
  • In all honesty it doesn't matter exactly what it does, just that it looks nice and catches the user's eyes. I would imagine something like what happens to the "slide to unlock" text when you open the iPhone.
  • but after this CABasicAnimation ,how can i return to the original view ?
  • See also stackoverflow.com/questions/438046/…
  • Dude, this is 3 years old. Why are you adding links to unrelated frameworks?
  • "Chisel is a collection of LLDB commands to assist debugging iOS apps." – You might have linked the wrong project there.
  • Wait a moment, my mistake. Pasted bad link. Edited.
  • You should probably explain a little what your code does, instead of just pasting a finished block of code. Stack Overflow is all about the learning, less about sharing code. But great implementation, its neat.