#UIViewPropertyAnimation
Explore tagged Tumblr posts
ios-goodies · 6 years ago
Text
Week 283
Happy Thursday! It's been a busy week, with a lot of new content and some very interesting news.
Apple published the schedule for WWDC, and, as expected, the keynote will be on June 3rd, 10:00 a.m. PDT, and it will be live streamed. Check the sessions and, if you're lucky to be there, the labs that you want to attend and add them to the calendar. Make use of the tools for it, the official WWDC app for iOS and the unofficial WWDC app for macOS.
GitHub had its Satellite conference, and announced, among other great things, that it's going to offer a way for the community to support open-source creators, through GitHub Sponsors. This is a great initiative, and I hope it proves successful. Kudos to the GitHub team for making it!
Last but not least, I'd like to highlight a new project from Dave Verwer. iOS Dev Jobs aims to become the place to go to if you want to find a new job. It's just been launched, and it's already full of great oportunities. So keep it in mind if at some point you'll want a change in your career.
Articles
Storing Codable structs on the disk, by @mecid
Using Codable to make enums with associated values even more powerful, by @natanrolnik
Empty Strings in Swift, by @kharrison
Using NSBatchDeleteRequest to delete batches in Core Data, by @twannl
Understanding Compilers – featuring Swift!, by Divya Basappa
Advanced Animations with UIViewPropertyAnimator, by @etrapeznikov
Ordered Collection Diffing, by @p_montalto
Tools/Controls
Glide - Game engine for making 2d games on iOS, macOS and tvOS, by @glideengine
EasyClosure - Unified communication with easy closure in Swift, by @onmyway133
SwiftInfo - Extract and analyze the evolution of an iOS app's code, by @rockthebruno
LoadingShimmer - An easy way to add a shimmering effect to any view with just one line of code. It is useful as an unobtrusive loading indicator, by @jogendrafx
Business/Career
A Decade of Remote Work, by @vpetersson
UI/UX
Animation Handbook, by @warpling
Credits
pmusolino, onmyway133, natanrolnik, naeemshaikh90, popei69, mecid, jogendra, rbarbosa
1 note · View note
jack-magnus · 6 years ago
Video
tumblr
Swift Tutorial - UIViewPropertyAnimator - Control Your Animations https://www.youtube.com/watch?v=cHwdvH3cStE
0 notes
nancydsmithus · 6 years ago
Text
Performing iOS Animations On Views With UIKit And UIView
Performing iOS Animations On Views With UIKit And UIView
Saravanan V
2019-11-20T11:00:00+00:002019-11-20T12:00:10+00:00
I have been an iOS developer for over a decade now and have rarely seen articles that consolidate all possible ways to perform animations in iOS. This article aims to be a primer on iOS animations with the intent of exhaustively covering the different ways of doing the same.
Given the extensiveness of the topic, we would cover each part succinctly at a fairly high level. The goal is to educate the reader with a set of choices to add animations to his/ her iOS app.
Before we start off with topics related to iOS, let us take a brief look at animation speed.
Animating At 60FPS
Generally in videos, each frame is represented by an image and the frame rate determines the number of images flipped in the sequence. This is termed as ‘frames per second’ or FPS.
FPS determines the number of still images flipped within a second, which literally means that the more the number of images/ frames, more details/ information are displayed in the video. This holds true for animations as well.
FPS is typically used to determine the quality of animations. There is a popular opinion that any good animation should run at 60fps or higher — anything less than 60fps would feel a bit off.
Do you want to see the difference between 30FPS and 60FPS? Check this!
Did you notice the difference? Human eyes can definitely feel the jitter at lower fps. Hence, it is always a good practice to make sure that any animation you create, adheres to the ground rule of running at 60FPS or higher. This makes it feel more realistic and alive.
Having looked at FPS, let’s now delve into the different core iOS frameworks that provide us a way to perform animations.
Core Frameworks
In this section, we will touch upon the frameworks in the iOS SDK which can be used for creating view animations. We will do a quick walk through each of them, explaining their feature set with a relevant example.
UIKit/ UIView Animations
UIView is the base class for any view that displays content in iOS apps.
UIKit, the framework that gives us UIView, already provides us some basic animation functions which make it convenient for developers to achieve more by doing less.
The API, UIView.animate, is the easiest way to animate views since any view’s properties can be easily animated by providing the property values in the block-based syntax.
In UIKit animations, it is recommended to modify only the animatable properties of UIVIew else there will be repercussions where the animations might cause the view to end up in an unexpected state.
animation(withDuration: animations: completion)
This method takes in the animation duration, a set of view’s animatable property changes that need to be animated. The completion block gives a callback when the view is done with performing the animation.
Almost any kind of animation like moving, scaling, rotating, fading, etc. on a view can be achieved with this single API.
Now, consider that you want to animate a button size change or you want a particular view to zoom into the screen. This is how we can do it using the UIView.animate API:
let newButtonWidth: CGFloat = 60 UIView.animate(withDuration: 2.0) { //1 self.button.frame = CGRect(x: 0, y: 0, width: newButtonWidth, height: newButtonWidth) //2 self.button.center = self.view.center //3 }
Here’s what we are doing here:
We call the UIView.animate method with a duration value passed to it that represents how long the animation, described inside the block, should run.
We set the new frame of the button that should represent the final state of the animation.
We set the button center with its superview’s center so that it remains at the center of the screen.
The above block of animation code should trigger the animation of the button’s frame changing from current frame:
Width = 0, Height = 0
To the final frame:
Width = Height = newButtonWidth
And here’s what the animation would look like:
Tumblr media
animateWithDuration:delay:usingSpringWithDamping:initialSpringVelocity:options:animations:completion
This method is like an extension of the animate method where you can do everything that you can perform in the prior API with some physics behaviors added to the view animations.
For example, if you want to achieve spring damping effects in the animation that we have done above, then this is how the code would look like:
let newButtonWidth: CGFloat = 60 UIView.animate(withDuration: 1.0, //1 delay: 0.0, //2 usingSpringWithDamping: 0.3, //3 initialSpringVelocity: 1, //4 options: UIView.AnimationOptions.curveEaseInOut, //5 animations: ({ //6 self.button.frame = CGRect(x: 0, y: 0, width: newButtonWidth, height: newButtonWidth) self.button.center = self.view.center }), completion: nil)
Here’s the set of parameters we use:
duration Represents the duration of the animation determining how long the block of code should run.
delay Represents the initial delay that we want to have before the start of the animation.
SpringWithDamping Represents the value of the springy effect that we want the view to behave. The value must be between 0 to 1. The lower the value, the higher the spring oscillation.
velocity Represents the speed at which the animation should start.
options Type of animation curve that you want to apply to your view animation.
Finally, the block of code where we set the frame of the button that needs to be animated. It is the same as the previous animation.
And here’s what the animation would look like with the above animation configuration:
Tumblr media
UIViewPropertyAnimator
For a bit more control over animations, UIViewPropertyAnimator comes handy where it provides us a way to pause and resume animations. You can have custom timing and have your animation to be interactive and interruptible. This is very much helpful when performing animations that are also interactable with user actions.
The classic ‘Slide to Unlock’ gesture and the player view dismiss/ expand animation (in the Music app) are examples of interactive and interruptible animations. You can start moving a view with your finger, then release it and the view will go back to its original position. Alternatively, you can catch the view during the animation and continue dragging it with your finger.
Following is a simple example of how we could achieve the animation using UIViewPropertyAnimator:
let newButtonWidth: CGFloat = 60 let animator = UIViewPropertyAnimator(duration:0.3, curve: .linear) { //1 self.button.frame = CGRect(x: 0, y: 0, width: newButtonWidth, height: newButtonWidth) self.button.center = self.view.center } animator.startAnimation() //2
Here’s what we are doing:
We call the UIViewProperty API by passing the duration and the animation curve.
Unlike both the above UIView.animate API’s, the animation won’t start unless you specify it by yourself i.e. you��re in full control of the complete animation process/ flow.
Now, let’s say that you want even more control over the animations. For example, you want to design and control each and every frame in the animation. There’s another API for that, animateKeyframes. But before we delve into it, let’s quickly look at what a frame is, in an animation.
What Is A frame?
A collection of the view’s frame changes/ transitions, from the start state to the final state, is defined as animation and each position of the view during the animation is called as a frame.
animateKeyframes
This API provides a way to design the animation in such a way that you can define multiple animations with different timings and transitions. Post this, the API simply integrates all the animations into one seamless experience.
Let’s say that we want to move our button on the screen in a random fashion. Let’s see how we can use the keyframe animation API to do so.
UIView.animateKeyframes(withDuration: 5, //1 delay: 0, //2 options: .calculationModeLinear, //3 animations: { //4 UIView.addKeyframe( //5 withRelativeStartTime: 0.25, //6 relativeDuration: 0.25) { //7 self.button.center = CGPoint(x: self.view.bounds.midX, y: self.view.bounds.maxY) //8 } UIView.addKeyframe(withRelativeStartTime: 0.5, relativeDuration: 0.25) { self.button.center = CGPoint(x: self.view.bounds.width, y: start.y) } UIView.addKeyframe(withRelativeStartTime: 0.75, relativeDuration: 0.25) { self.button.center = start } })
Here’s the breakdown:
duration Call the API by passing in the duration of the animation.
delay Initial delay duration of the animation.
options The type of animation curve that you want to apply to your view animation.
animations Block that takes all keyframe animations designed by the developer/ user.
addKeyFrame Call the API to design each and every animation. In our case, we have defined each move of the button. We can have as many such animations as we need, added to the block.
relativeStartTime Defines the start time of the animation in the collection of the animation block.
relativeDuration Defines the overall duration of this specific animation.
center In our case, we simply change the center property of the button to move the button around the screen.
And this is how the final animations looks like:
Tumblr media
CoreAnimation
Any UIKit based animation is internally translated into core animations. Thus, the Core Animation framework acts as a backing layer or backbone for any UIKit animation. Hence, all UIKit animation APIs are nothing but encapsulated layers of the core animation APIs in an easily consumable or convenient fashion.
UIKit animation APIs don’t provide much control over animations that have been performed over a view since they are used mostly for animatable properties of the view. Hence in such cases, where you intend to have control over every frame of the animation, it is better to use the underlying core animation APIs directly. Alternatively, both the UIView animations and core animations can be used in conjunction as well.
UIView + Core Animation
Let’s see how we can recreate the same button change animation along with specifying the timing curve using the UIView and Core Animation APIs.
We can use CATransaction’s timing functions, which lets you specify and control the animation curve.
Let’s look at an example of a button size change animation with its corner radius utilizing the CATransaction’s timing function and a combination of UIView animations:
let oldValue = button.frame.width/2 let newButtonWidth: CGFloat = 60 /* Do Animations */ CATransaction.begin() //1 CATransaction.setAnimationDuration(2.0) //2 CATransaction.setAnimationTimingFunction(CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut)) //3 // View animations //4 UIView.animate(withDuration: 1.0) { self.button.frame = CGRect(x: 0, y: 0, width: newButtonWidth, height: newButtonWidth) self.button.center = self.view.center } // Layer animations let cornerAnimation = CABasicAnimation(keyPath: #keyPath(CALayer.cornerRadius)) //5 cornerAnimation.fromValue = oldValue //6 cornerAnimation.toValue = newButtonWidth/2 //7 button.layer.cornerRadius = newButtonWidth/2 //8 button.layer.add(cornerAnimation, forKey: #keyPath(CALayer.cornerRadius)) //9 CATransaction.commit() //10
Here’s the breakdown:
begin Represents the start of the animation code block.
duration Overall animation duration.
curve Represents the timing curve that needs to be applied to the animation.
UIView.animate Our first animation to change the frame of the button.
CABasicAnimation We create the CABasicAnimation object by referring the cornerRadius of the button as the keypath since that’s what we want to animate. Similarly, if you want to have granular level control over the keyframe animations, then you can use the CAKeyframeAnimation class.
fromValue Represents the starting value of the animation, i.e. the initial cornerRadius value of the button from where the animation must start off.
toValue Represents the final value of the animation, i.e. the final cornerRadius value of the button where the animation must end.
cornerRadius We must set the cornerRadius property of the button with the final value of the animation else the button’s cornerRadius value will get auto-reverted to its initial value after the animation completes.
addAnimation We attach the animation object that contains the configuration of the entire animation process to the layer by representing the Keypath for which the animation needs to be performed.
commit Represents the end of the animation code block and starts off the animation.
This is how the final animation would look like:
Tumblr media
This blog is a great read to help create more advanced animations as it neatly walks you through most of the Core Animation framework APIs with instructions guiding you through every step of the way.
UIKitDynamics
UIKit Dynamics is the physics engine for UIKit which enables you to add any physics behaviors like collision, gravity, push, snap, etc, to the UIKit controls.
UIKitDynamicAnimator
This is the admin class of the UIKit Dynamics framework that regulates all animations triggered by any given UI control.
UIKitDynamicBehavior
It enables you to add any physics behavior to an animator which then enables it to perform on the view attached to it.
Different kinds of behaviors for UIKitDynamics include:
UIAttachmentBehavior
UICollisionBehavior
UIFieldBehavior
UIGravityBehavior
UIPushBehavior
UISnapBehavior
The architecture of UIKitDynamics looks something like this. Note that Items 1 to 5 can be replaced with a single view.
Let us apply some physics behavior to our button. We will see how to apply gravity to the button so that it gives us a feeling of dealing with a real object.
var dynamicAnimator : UIDynamicAnimator! var gravityBehavior : UIGravityBehavior! dynamicAnimator = UIDynamicAnimator(referenceView: self.view) //1 gravityBehavior = UIGravityBehavior(items: [button]) //2 dynamicAnimator.addBehavior(gravityBehavior) //3
Here’s the breakdown:
UIKitDynamicAnimator We have created a UIKitDynamicAnimator object which acts as an orchestrator for performing animations. We have also passed the superview of our button as the reference view.
UIGravityBehavior We have created a UIGravityBehavior object and pass our button into the array elements on which this behavior is injected.
addBehavior We have added the gravity object to the animator. This should create an animation as shown below:
Tumblr media
Notice how the button falls off from the center (its original position) of the screen to the bottom and beyond.
We should tell the animator to consider the bottom of the screen to be the ground. This is where UICollisionBehavior comes into picture.
var dynamicAnimator : UIDynamicAnimator! var gravityBehavior : UIGravityBehavior! var collisionBehavior : UICollisionBehavior! dynamicAnimator = UIDynamicAnimator(referenceView: self.view) //1 gravityBehavior = UIGravityBehavior(items: [button]) //2 dynamicAnimator.addBehavior(gravityBehavior) //3 collisionBehavior = UICollisionBehavior(items: [button]) //4 collisionBehavior.translatesReferenceBoundsIntoBoundary = true //5 dynamicAnimator.addBehavior(collisionBehavior) //6
UICollisionBehavior We have created a UICollisionBehavior object and passed along the button so that the behavior is added to the element.
translatesReferenceBoundsIntoBoundary Enabling this property tells the animator to take the reference views boundary as the end, which is the bottom of the screen in our case.
addBehavior We have added collision behavior to the animator here. Now, our button should hit the ground and stand still as shown below:
Tumblr media
That’s pretty neat, isn’t it? Now, let us try adding a bouncing effect so that our object feels more real. To do that, we will use the UIDynamicItemBehavior class.
var dynamicAnimator : UIDynamicAnimator! var gravityBehavior : UIGravityBehavior! var collisionBehavior : UICollisionBehavior! var bouncingBehavior : UIDynamicItemBehavior! dynamicAnimator = UIDynamicAnimator(referenceView: self.view) //1 gravityBehavior = UIGravityBehavior(items: [button]) //2 dynamicAnimator.addBehavior(gravityBehavior) //3 collisionBehavior = UICollisionBehavior(items: [button]) //4 collisionBehavior.translatesReferenceBoundsIntoBoundary = true //5 dynamicAnimator.addBehavior(collisionBehavior) //6 //Adding the bounce effect bouncingBehavior = UIDynamicItemBehavior(items: [button]) //7 bouncingBehavior.elasticity = 0.75 //8 dynamicAnimator.addBehavior(bouncingBehavior) //9
UIDynamicItemBehavior We have created a UIDynamicItemBehavior object and pass along the button so that the behavior is added to the element.
elasticity Value must be between 0-1, it represents the elasticity i.e. the number of times the object must bounce on and off the ground when it is hit. This is where the magic happens — by tweaking this property, you can differentiate between different kinds of objects like balls, bottles, hard-objects and so on.
addBehavior We have added collision behavior to the animator here.
Now, our button should bounce when it hits the ground as shown below:
Tumblr media
This repo is quite helpful and shows all UIKitDynamics behaviors in action. It also provides source code to play around with each behavior. That, in my opinion, should serve as an extensive list of ways to perform iOS animations on views!
In the next section, we will take a brief look into the tools that will aid us in measuring the performance of animations. I would also recommend you to look at ways to optimize your Xcode build since it will save a huge amount of your development time.
Performance Tuning
In this section, we will look at ways to measure and tune the performance of iOS animations. As an iOS developer, you might have already used Xcode Instruments like Memory Leaks and Allocations for measuring the performance of the overall app. Similarly, there are instruments that can be used to measure the performance of animations.
Core Animation Instrument
Try the Core Animation instrument and you should be able to see the FPS that your app screen delivers. This is a great way to measure the performance/ speed of any animation rendered in your iOS app.
Drawing
FPS is vastly lowered in the app that displays heavy content like images with effects like shadows. In such cases, instead of assigning the Image directly to the UIImageView’s image property, try to draw the image separately in a context using Core Graphics APIs. This overly reduces the image display time by performing the image decompression logic asynchronously when done in a separate thread instead of the main thread.
Rasterization
Rasterization is a process used to cache complex layer information so that these views aren’t redrawn whenever they’re rendered. Redrawing of views is the major cause of the reduction in FPS and hence, it is best to apply rasterization on views that are going to be reused several times.
Wrapping Up
To conclude, I have also summed up a list of useful resources for iOS animations. You may find this very handy when working on iOS animations. Additionally, you may also find this set of design tools helpful as a (design) step before delving into animations.
I hope I have been able to cover as many topics as possible surrounding iOS animations. If there is anything I may have missed out in this article, please let me know in the comments section below and I would be glad to make the addition!
Tumblr media
(dm, yk, il)
0 notes
itunesbooks · 6 years ago
Text
Mastering iOS 12 Programming - Donny Wals
Mastering iOS 12 Programming Build professional-grade iOS applications with Swift and Xcode 10, 3rd Edition Donny Wals Genre: Programming Price: $39.99 Publish Date: October 31, 2018 Publisher: Packt Publishing Seller: Ingram DV LLC Become a professional iOS developer with the most in-depth and advanced guide to Swift, Xcode 10, ARKit, and Core ML Key Features Explore the extensive world of iOS development through practical examples Gain detailed insights into core iOS programming concepts such as app extensions and performance Extend your iOS apps by adding augmented reality and machine learning capabilities Book Description The iOS development environment has significantly matured, and with Apple users spending more money in the App Store, there are plenty of development opportunities for professional iOS developers. However, the journey to mastering iOS development and the new features of iOS 12 is not straightforward. This book will help you make that transition smoothly and easily. With the help of Swift 4.2, you'll not only learn how to program for iOS 12, but also how to write efficient, readable, and maintainable Swift code that maintains industry best practices. Mastering iOS 12 Programming will help you build real-world applications and reflect the real-world development flow. You will also find a mix of thorough background information and practical examples, teaching you how to start implementing your newly gained knowledge. By the end of this book, you will have got to grips with building iOS applications that harness advanced techniques and make best use of the latest and greatest features available in iOS 12. What you will learn Build a professional iOS application using Xcode 10 and Swift 4.2 Use AutoLayout to create complex layouts that look great on every device Delve into advanced animations with UIViewPropertyAnimator and UIKit Dynamics Enhance your app by using instruments and building your own profiling tools Integrate iMessage, Siri, and more in your app through app extensions Train and use machine learning models with Core ML 2 and Create ML Create engaging augmented reality experiences with ARKit 2 Who this book is for If you're a developer with some experience in iOS programming and want to enhance your skills by unlocking the full potential of the latest iOS version with Swift to build great applications, this book is for you. http://dlvr.it/R0sQQJ
0 notes
internet-marketingme-blog · 6 years ago
Text
Hvad bringer iOS 10 til App-udviklere?
  Forbedrede brugermeddelelser iOS 10 markerer fremkomsten af brugerinformationsrammen (UserNotifications.framework) og brugermeddelelser-brugergrænsefladen og slutter til UILocalNotification. Brugermeddelelsesrammen hjælper med at understøtte og håndtere fjernbetjeninger såvel som lokale meddelelser. Udviklere kan bruge klasserne af rammerne til at ændre fjern- og lokale meddelelser, som de leveres til enheden. Udseendet af lokale og eksterne meddelelser kan tilpasses ved hjælp af brugermeddelelser UI-rammer. Med hjælp fra disse to rammer har Apple ikke ændret de samlede lokale notifikationer, men har væsentligt improviseret funktionaliteterne. Den største ændring i det nye meddelelsessystem er, at det bringer en mellemmand mellem besked ankomst og enhedsdisplay-en underretningstjenesteudbyder, der er i stand til end-to-end kryptering med app, der modtager den krypterede besked fra Apple, dekryptering sker på brugerenheden og viser meddelelsen i meddelelsescentret. Forbedret iMessage En overflod af API'er er blevet introduceret i iOS 10, især forbedringer til Messages App. Appudvidelser kan interagere med Message app, og brugere kan sende mediefiler, interaktive meddelelser, klistermærker. Klisterpakken indeholder et sæt klistermærker til meddelelsesindholdet. iMessage app hjælper ikke kun brugere med at søge billeder, men giver også en brugergrænseflade i appen. Fra udviklingsperspektivet kan den brugerdefinerede grænseflade til meddelelserne laves ved hjælp af MSMessagesAppViewController. MSSession og MSMessage kan hjælpe med at ændre meddelelsen, idet tidligere har indbygget support til udgående meddelelser. For at kunne levere en brugerdefineret klisterbrowser til meddelelsesprogrammet kan MSStickerBrowserViewController bruges. Som det ses, er de nye og forbedrede meddelelsesudvidelser bedre og mere kraftfulde. Ændringer i animationer I IOS 10 etableres bedre kontrol over animationer. Evnen til at kontrollere animerede egenskaber som genoptagelse, stop eller positioner er finkornet i iOS 10. UIViewPropertyAnimator er den vigtige klasse, som hjælper med at skabe og udløse animationerne. Tale genkendelse Der indføres en ny API, der understøtter kontinuerlig hastighedsgenkendelse. Dette hjælper udviklere med at opbygge nye apps til at genkende tale og transkribere den til tekst. Det meste af magien er lavet med hjælp af API'er i Speech framework, især med klasser som SFSpeechRecognizer, SFSpeechURLRecognitionREquest, SFTranscription etc. Integration med Siri Få integreret med Siri for de fleste apps som beskeder, opkald, betalinger, fotos osv. IOS 10 nu lader brugerne bruge deres stemme til at udføre handlinger, og alle disse opnås ved hjælp af Sirikit. De berørte domæner skal registreres med svar udført. For ikke-grafiske hensigter skal udviklere bruge Apple Maps, mens udviklere for grafiske hensigter også kan kaldes Intents UI-udvidelser, kan udvide brugergrænsefladen til interface design. ReplayKit bliver bedre IOS 10 har købt nye forbedringer til ReplayKit, der blev introduceret i iOS 9 Ie introduktion af live-udsendelse af Replaykit-streams, hvilket betyder at en bruger kan udsende medier via andre websteder eller applikationer og udsende US-udvidelse, som hjælper brugeren til at logge ind på en tjeneste og indstille en udsendelse . Udviklere skal oprette RPBroadcastActivityViewController for at give brugerne mulighed for at vælge streamingtjenesten, der gerne vil bruge. Handlingen ville returnere RPBroadcastController, der hjælper med at starte, stoppe live-udsendelser. Der er mindre andre forbedringer, og nogle af dem er  
0 notes
cdemiranda · 6 years ago
Link
via AppCoda
0 notes
iamaprogrammerz · 7 years ago
Photo
Tumblr media
@freeCodeCamp : How to implement interactive animations with Swift’s UIViewPropertyAnimator https://t.co/eH5lnBWefB
0 notes
murderofcro-ws · 8 years ago
Quote
Favorite tweets: Whoever on UIKit made UIView.animateKeyframes work inside of a UIViewPropertyAnimator: holy shit, I owe you a really great beer.— Marco Arment (@marcoarment) October 29, 2017
http://twitter.com/marcoarment
0 notes
iyarpage · 8 years ago
Text
iOS Animations by Tutorials Updated for Swift 4 and iOS 11
Happy Monday – it’s another iOS 11 Launch Party book release!
It’s hard to believe that we’re already on the Fourth Edition of our classic book iOS Animations by Tutorials — fully updated for Swift 4, iOS 11 and Xcode 9.
iOS Animations by Tutorials teaches you everything you need to know to create delightful animations in your iOS apps and create fun and engaging user experiences.
This will be a free update for existing iOS Animations by Tutorials PDF customers — our way to say “thanks” to our readers for their support.
Don’t own iOS Animations by Tutorials yet? Read on to see how you can get a copy!
What is iOS Animations by Tutorials?
This book is for iOS developers who already know the basics of iOS and Swift 4, and want to dive deep into animations.
iOS Animations by Tutorials is 27 chapters and 414 pages — and covers an amazing range of animation techniques.
Here’s a quick look at what’s inside iOS Animations by Tutorials:
Chapter 1, Getting Started with View Animations: You’ll learn how to move, scale and fade views. You’ll create a number of different animations to get comfortable with Swift and the basic UIKit APIs.
Chapter 2, Springs: You’ll build on the concepts of linear animation and create more eye-catching effects using spring-driven animations. Boiiing! :]
Chapter 3, Transitions: You’ll learn about several class methods in UIKit that help you animate views in or out of the screen. These one-line API calls make transition effects easy to achieve.
Chapter 4, View Animations in Practice: This chapter teaches you how to combine techniques you’ve already learned in creative ways to build up even cooler animations.
Chapter 5, Keyframe Animations: You’ll use keyframe animations to unlock the ultimate achievement of an impressive UI: creating elaborate animation sequences built from a number of distinct stages.
Chapter 6, Introduction to Auto Layout: This is a crash course on Auto Layout in case you’re not familiar with it already; you’ll need this for the next chapter.
Chapter 7, Animating Constraints: Once you’ve worked through the project in Chapter 6, you’ll add a number of animations to it and put your newfound knowledge to good use.
Chapter 8, Getting Started with Layer Animations: You’ll start with the simplest layer animations, but also learn about debugging animations gone wrong.
Chapter 9, Animation Keys and Delegates: Here you gain more control over the currently running animations and use delegate methods to react to animation events.
Chapter 10, Groups and Advanced Timing: In this chapter you combine a number of simple animations and run them together as a group.
Chapter 11, Layer Springs: Take a tour of the shiny new CASpringAnimation class, which allows you to easily create layer spring animations.
Chapter 12, Keyframe Animations: Here you’ll learn about layer keyframe animations, which are powerful and slightly different than view keyframe animations.
Chapter 13, Shapes and Masks: Draw shapes on the screen via CAShapeLayer and animate its special path property.
Chapter 14, Gradient Animations: Learn how to use CAGradientLayer to help you draw and animate gradients.
Chapter 15, Stroke and Path Animations: Here you will draw shapes interactively and work with some powerful features of keyframe animations.
Chapter 16, Replicating Animations: Learn about the little known but powerful CAReplicatorLayer class.
Chapter 17, Custom Presentation Controller & Device Orientation Animations: Learn how to present view controllers via custom animated transitions.
Chapter 18, UINavigationController Custom Transition Animations: You’ll build upon your skills with presenting view controllers and develop a really neat reveal transition for a navigation controller app.
Chapter 19, Interactive UINavigationController Transitions: Learn how to make the reveal transition interactive: the user will be able to scrub back and forth through the animated transition!
Chapter 20, Getting Started with UIViewPropertyAnimator: Learn how to create basic view animations and keyframe animations. You’ll look into using custom timing that goes beyond the built-in easing curves.
Chapter 21, Intermediate Animations with UIViewPropertyAnimator: In this chapter you are going to learn about using animators with Auto Layout. Further, you will learn how to reverse animations or make additive animations for smoother changes along the way.
Chapter 22, Interactive Animations with UIViewPropertyAnimator: Learn how to drive your animations interactively based on the user’s input. For extra fun you’ll look into both basic and keyframe animations interactivity.
Chapter 23, UIViewPropertyAnimator View Controller Transitions: Create custom View Controller transitions using a UIViewPropertyAnimator to drive the transition animations. You will create both static and interactive transitions.
Chapter 24, Simple 3D Animations: Learn how to set up your layers in 3D space, how to choose the distance from the camera to your layer, and how to create animations in your 3D scene.
Chapter 25, Intermediate 3D Animations: Go further into 3D space and learn about some of the more advanced ways to create 3D Animations.
Chapter 26, Particle Emitters: Learn how to use UIKit’s built-in particle emitters to create a fun snowfall effect.
Chapter 27, Frame Animations with UIImageView: Learn how to sequence multiple images together into a flipbook-style animation.
About the Author
Of course, our book would be nothing without our animated author and long-time team member, Marin:
Marin Todorov is one of the founding members of the raywenderlich.com tutorial team. He is an independent iOS consultant and publisher, and also has a background in web and desktop development. Besides crafting code, Marin also enjoys blogging, writing books and speaking at conferences. He happily open sources code.
Free iOS Animation Chapters this Week
To help celebrate the launch, we’re going to open up the book and share some free chapters with you this week. This will give you a chance to check out the book — we’re confident you’ll love it!
Now Available in ePub!
And as another exciting announcement, by popular request, iOS Animations by Tutorials is now available in ePub format. Take it on the go with you on your iPad, iPhone or other digital reader and enjoy all the mobile reading benefits that ePub has to offer!
Where To Go From Here?
iOS Animations by Tutorials, Fourth Edition is now 100% complete, fully updated for Swift 4 and tvOS 11 and available today.
If you’ve already bought the iOS Animations by Tutorials PDF, you can download the new book immediately on the store page for the book.
If you don’t have iOS Animations by Tutorials yet, you can grab your own copy in our online store.
And to help sweeten the deal, the digital edition of the book is on sale for $49.99! But don’t wait — this sale price is only available for a limited time.
Speaking of sweet deals, be sure to check out the great prizes we’re giving away this year with the iOS 11 Launch Party, including over $9,000 in giveaways!
To enter, simply retweet this post using the #ios11launchparty hashtag by using the button below:
Tweet !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');
We hope you enjoy this free update, and stay tuned for more book releases and updates coming soon!
The post iOS Animations by Tutorials Updated for Swift 4 and iOS 11 appeared first on Ray Wenderlich.
iOS Animations by Tutorials Updated for Swift 4 and iOS 11 published first on http://ift.tt/2fA8nUr
0 notes
universeinform-blog · 8 years ago
Text
A tour of iOS 10.3: Checking out APFS, the Settings app, and other tweaks
New Post has been published on https://universeinform.com/2017/03/31/a-tour-of-ios-10-3-checking-out-apfs-the-settings-app-and-other-tweaks/
A tour of iOS 10.3: Checking out APFS, the Settings app, and other tweaks
Apple has just launched iOS 10.3 to most of the people, a replace that is in all likelihood to be the remaining fundamental release of iOS 10; at this factor within the year, paintings commonly begins in earnest on the next foremost release of iOS, so as to be discovered at WWDC in June.
The replace is to be had for the whole lot that runs iOS 10: the iPhone 5 and more recent, the fourth technology iPad and newer, the iPad Mini 2 and more recent, each iPad Pros, and the 6th-era iPod Contact.
The replace has been going thru the beta system for more than one months now, and since it’s possible to be iOS 10’s remaining important update, we’ll spend a few greater time with a few of the high-profile capabilities. I’ve also spent a tiny bit of time with the new APFS filesystem, which ain’t alternate tons for most people but does seem to unfasten up a small quantity of neighborhood garage area.
Lots of iOS 10.3’s most major tweaks are in the most thrilling part of any working machine: the Settings app!
  The most obvious of the modifications movements the iCloud settings screen from approximately midway down the list to its personal prominent role on the pinnacle of the stack. There isn’t a ton of stuff right here that doesn’t already exist in iOS 10.2.1, but for the reason that the primary factor the general public do with their iPhones and iPads is signing up to their iCloud bills, it makes feel to move these items front and center.
In particular beneficial is a large “Password & Safety” section right at the top of the new screen, which helps you to exchange your iCloud password and set up -element authentication. This changed into available before, it turned into just buried in a non-obvious area (go to the iCloud settings web page, then faucet your Apple Id, then tap Password & Safety).
What Does iOS 10 Bring for App Developers?
Announced at WWDC 2016, iOS 10 built-in a plethora of changes for the developers, the maximum sizeable revamp built-in the fact that 2013. The SDK for iOS 10 built-wings built-in new APIs and built-in that built-in integrated new utility types and features. So that it will integrate paintings on iOS 10, one might want to do the program built-in Quick 3 and additionally download Xcode eight for built-in the iOS applications. Allow’s focus on built-in integrated evolved associated features that have been added built-in iOS 10.
Improved Person notifications
iOS 10 marks the advent of the Consumer Notification framework (UserNotifications.Framework) and Person Notifications UI framework and give up to UILocalNotification. The Consumer Notification framework allows built-in and built-integrated far away as well as integrated nearby notifications. builders can use the built-in integrated of the framework for modifying far-flung and local notifications as they’re brought to the tool. The advent of the neighborhood and far-flung notifications can be custom designed with help of Consumer Notifications UI framework. With the assist of those two frameworks, Apple has no longer modified the general local notifications, however, has significantly improvised the functionalities.
The largest trade by way of the new notification Mach built integrated is that it built-wings built-in a built-in among message arrival and device display- a notification carrier company capable of cease-to-end encryption with app receivintegratedg the encrypted message from Apple, decryption built-in on the Consumer tool and built-in the notification built-integrated notification middle.
Stronger iMessage
A plethora of APIs has been delivered integrated built-in iOS 10 built-in improvements to Messages App. App extensions can built-have built integrated with Message app and customers can ship media documents, integrate detractive messages, stickers. The Sticky label percent integrated’s built-in a set of stickers to the message content. iMessage app no longer only allows customers search photographs but additionally provides a Consumer integrated terrace built-inbuilt integrated app.
From the development perspective, the custom built interface for the messages may be made with an assist of MSMessagesAppViewController. MSSession and MSMessage could assist with built integrated change of the message, with former have built-in help for expo built-ing messages. With a view to offering a custom Sticky label browser to the message application, MSStickerBrowserViewController can be used.
As witnessed, the brand new and Stepped forward Messages extensions are higher and greater effective.
Modifications integrated Animations
In iOS 10, higher manipulate over animations is set up. The capability to govern animate residences like the resume, forestall or positions are excellent-Gra integrated ed built-in iOS 10. UIViewPropertyAnimator is the important elegance which allows built-in built-indevelopbuiltintegrated and triggers built-in the animations.
Speech Recognition
A brand new API is delivered integrated built-inbuilt integrated supports built-sinuous velocity Reputation. This helps developers built-in new apps for built-integrated speech and transcribintegratedg it to text. most of the magic is done with help of APIs built-in Speech framework, ma built integrated with built-in-built integrated built-integrated SFSpeechRecognizer, SFSpeechURLRecognitionREquest, SFTranscription and so on.
Integration with Siri
Get built integrated with Siri for most apps like messages, call integrated, bills, pictures etc. IOS 10 now Allow users use their voice to carry out actions and built-in of is executed with help of Sirikit. The built-involved built-in integrated want to be registered with reaction built-vanished.
For non-graphical integrated tests, developers need to make use of Apple Maps while for graphical integrated texts also referred to as Intents UI extensions, developers can amplify the User integrated terrace for the integrated terrace design.
Advantages and Disadvantages of Bag Checking When Flying
A hotly-debated topic among air tourists frequently has sure advantages and drawbacks to each argument. For first-time travelers or individuals who simply want a refresher, there are sure regulations to gadgets you can encompass in your carry-on (matters you could take alongside you on the aircraft) and those you can “test-in” (matters that input the cargo preserve of your aircraft, below the ground of the cabin).
Reasons to carry Your Baggage into the Cabin
The airline is answerable for your Luggage, so they might not wander off. Possibly the worst trouble of vacationers is losing their bags. In case this happens, the service will compensate you in the least possible manner like turning in your bag in your inn or domestic hours or days after you have lost your bags.
When you attain your destination, you may zoom right across the airport into your automobile, taxi or trip for hire, while not having to look forward to your luggage to seem at the baggage carousel.
If ever your flight has been behind schedule or canceled, and also you neglected the connecting flight,
Your Bags are with you, which makes you more flexible. There may be a few other flight you could be rerouted to, or one flying to a nearby airport. Understand that when you test in your Baggage, they’ll remain at the scheduled flight (as a general rule), although the flight has been delayed for hours and you’re re-booked on another flight. The airline will simply send your bag on the unique flight, requiring you to live at your destination or move lower back to the airport while the flight arrives (any such sadness!).
One greater advantage is the truth that you may always hold a watch in your non-public belongings, as a result, disposing of the opportunity that your digicam did not characteristic after being entered into the cargo maintain by means of a man who formerly worked at a creation web page, lugging concrete bag, or maybe worse – it disappeared at the manner on your arrival airport.
How to Get Your Husband to Leave the Other Woman
 There is no doubt that no matter what the circumstances are, an affair is devastating. However, it’s far even worse while the husband cannot appear to rip himself away from the other girl or leave her by myself. Very regularly girls contact me and ask “how can I get my husband to depart his female friend,” or “how can I get him far from her whilst he can not appear to depart her on my own.” often, wives who want to lure their cheating husbands returned lodge to manipulative techniques meant to make their husbands feel responsible, ashamed, or jealous, However this often best reads as desperation and paints you in a greater bad light. Men do now not often have the ethical radar or experience of responsibility that girls have, so the processes which could be just right for you or I won’t work at all for your husband. In this text, I will tell you what I accept as true with is the satisfactory way to both get your husband to leave the other girls whilst keeping your self-appreciate.
Take into account that You Probable can not Reason Along with your dishonest Husband
Many girls request that I supply them pointers intended to “make my husband apprehend what the affair is doing to me,” or “make him see how tons the affair is hurting me.” What they do not apprehend is that Guys aren’t rational thinkers, in particular, whilst they’re in the midst of an affair. As tough as it’s miles to listen, it is most unlikely that your husband is going to pay attention what you’re announcing and reply with, “, you’re right. Allow me to stop this right now.” it’s not honest, But it’s far the manner it’s miles.
You are probable now not going so that you can alternate your husband’s concept technique right now.
And, you need to Remember that it is extraordinarily probably that he’s having the affair to replace some thing this is lacking inside himself. Word that I said himself. Please Keep in mind that the flaw is within him, no longer within you. Men cheat because they want to experience perfect, young, alive, in a position, and vibrant. And overwhelmingly, that is an emotional need rather than a physical one, in spite of the common perception.
0 notes
alenofx · 8 years ago
Text
Dance: A radical & elegant animation library built for iOS
See on Scoop.it - iOS & macOS development
Tumblr media
Dance is a powerful and straightforward animation framework built upon the new UIViewPropertyAnimator class introduced in iOS 10. With Dance, creating an animation for a view is as easy as calling view.dance.animate { ... }, which can then be started, paused, reversed, scrubbed through, and finished anywhere that the view can be referenced. Dance is especially forgiving, and provides the power that UIViewPropertyAnimator brings to iOS while maintaining ease of use.
0 notes
invasivecode · 9 years ago
Photo
Tumblr media
Interactive View Animations in iOS 10
At the last WWDC, Apple introduced a new API to create interactive animations in iOS 10. In this post, I want to show you how to use this new API and build a new kinds of animations, where the user can pause and scrub the animation and interact with the animated object.
The main class of this new API is UIViewPropertyAnimator. This class allows you to animate views from start to finish as you would usually do with the old UIView animation API. In addition, UIViewPropertyAnimation allows you to interact with the animated object and pause and restart the animations. UIViewPropertyAnimator class adopts two protocols: UIViewAnimating and UIViewImplicitlyAnimating. These protocols add additional functionalities to the main class. Let's start to use the UIViewPropertyAnimator class and build a very simple animation.
Keep reading
0 notes