canvaspod / canvas Goto Github PK
View Code? Open in Web Editor NEWAnimate in Xcode without code
Home Page: http://canvaspod.io
License: MIT License
Animate in Xcode without code
Home Page: http://canvaspod.io
License: MIT License
CSAnimationView * loginAnimation = [[CSAnimationView alloc] initWithFrame:CGRectMake(15, CGRectGetMaxY(verifyFieldAnimation.frame) + 35., SCREENBOUND.size.width - 30., 45)];
loginAnimation.type = CSAnimationTypeFadeInSemi;
loginAnimation.delay = .5;
loginAnimation.duration = .4;
loginAnimation.backgroundColor = [UIColor clearColor];
loginAnimation.layer.masksToBounds = YES;
loginAnimation.layer.cornerRadius = 7;
[self addSubview:loginAnimation];
_loginButton = [UIButton buttonWithType:UIButtonTypeCustom];
_loginButton.frame = CGRectMake(15, CGRectGetMaxY(verifyFieldAnimation.frame) + 35., SCREENBOUND.size.width - 30., 45);
[_loginButton setBackgroundImage:[UIImage imageNamed:@"login_btn"] forState:UIControlStateNormal];
[_loginButton setTitle:@"登录" forState:UIControlStateNormal];
[_loginButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
_loginButton.titleLabel.font = [UIFont fontForFontName:FontNameHelveticaNeue size:15.];
[loginAnimation addSubview:_loginButton];
// Animation
[loginAnimation startCanvasAnimation];
And, My Button title color change from white to .5 alapha ? why ?
I would like the hidden or setHidden to be opened on the CSAnimationView object.
I dont want to have to wrap my CSAnimationView view within another view just to hide it.
unless there is another way?
When you pull the app, the build fails because this framework is not included by the application.
Hi,
With a Shake animation embedded in a ViewControler that has Auto Layout enabled. the starting position for the Shake Animation view is incorrect.
Best way to see this in action is to take the demo app, turn on Autolayout for the Animnation Table View Controller. For the Shake view itself, change the Delay attribute to 4 seconds.
Now when you run the app, you will see the Shake view is offset to the left - probably it's starting position for the shake but this should not happen until the animation is active i.e. after the animation actually starts?
How can we animate between 2 UIColors so that they crossfade evenly / correctly?
my blur uiview is black how can i fix that
Category methods should be prefixed so they don't clash with other libraries or with methods that may be added by Apple in the future. This is especially important for methods that are likely to be implemented elsewhere such as "fontName".
Hi, I was wondering how to configure multiple animations, I need. say I want to do bounceLeft and then morph.
How to achieve this?
Thanks.
CSAnimation.h multiple errors, “Expected a type” , and other ones in other classes. DO you have any update on this?
The animation will appare when the UIView added to stage.
How can I disable it? I just wanna show the animation on press a button.
Seems really simple but if there was an ability to set a runtime attribute to only run the animation on first load, once per app cylce, etc. It would be helpful for building tutorial like functionalities or just having a simple animation on an initial menu that doesn't loop when you go back to it.
Would be great to have iOS 6 support with this as well since 11% of devices are using iOS 6 still.
https://developer.apple.com/support/appstore/
Hi,
when i am going to run pod install command,it is generating below error.
[!] Unknown external source parameters for Canvas
: path./
Hi
I install Canvas framework in my project, however i can't import canvas module into ViewController
I spent several hours looking for a solution. I ran the install multiple times, and each time it could not find the Canvas.framework or the pod.MYAPP.framework or Foundation.framework files. I installed the git repository, I edited gitignore, I edited my podfile, etc. Please look into this issue. I had to find another solution for animating my buttons and wasted a lot of time on this. I also had to recode my entire application since it would be faster to do this than to try to fix all the config issues created by installing pods in my project.
When using bounceLeft/Right etc., the animating views start from outside the screen on iPhone 5s and older devices but start from inside the screen on iPhone 6 & 6 Plus. I looked into the code and found it's because the starting point is now set to be 300 right/left to the origin. I think it can be solved either by setting a larger constant offset for all animations or determining the offset at runtime by detecting current screen size.
It seems to be missing one small thing: Knowing when the view has finished it's animation.
Are there any plans to add to support this in the near future?
This is a very useful lib. Thank you.
It would be great to extend the fontName attribute to work on UITabBar.
Hello
first of all thank you for the extraordinary work you do
I have a question if you allow: Canvas manages subscriptions and online sales? a training group for a user of such date on such date?
if not what is complicated to put it in place?
Thank you
Is there any additional setup we need to do to use the animations in swift programmatically? For example, I am trying to set a button on click to do an animation. However, I cannot just import the CSAnimationView.h file
Hello,
It would be great to enable userInteraction while the view is animating.
how to add animation to my button
my button like this
loginButton = [UIButton buttonWithType:UIButtonTypeCustom];
[loginButton setBackgroundImage:[UIImage imageNamed:@"login_button_def.png"] forState:UIControlStateNormal];
[loginButton setBackgroundImage:[UIImage imageNamed:@"login_button_focus.png"] forState:UIControlStateHighlighted];
loginButton.frame = CGRectMake(35,400, 250, 50);
[loginButton setTitle:@"登 陆" forState:UIControlStateNormal];
[loginButton.titleLabel setFont:XYXY_SYSTEM_FONT(18)];
[loginButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[loginButton setTitleColor:[UIColor whiteColor] forState:UIControlStateHighlighted];
[loginButton addTarget:self action:@selector(login) forControlEvents:UIControlEventTouchUpInside];
thank you
我现在有一个功能,在向下走的用canvas画的图上单击画一条停在页面上的线,该怎么画
`const _canvas = require('canvas')
try {
_canvas.loadImage('https://pbimg.btdmp.com/pbase/shop-id/10117363/artworks/2141699b41cb8b5b454ffbd0380e247b.png')
} catch (e) {
console.log(e)
}`
I had trouble with load image, exception orccur with message "Out of memory". I still can load succeeded with image has size more than 50MB but this image had trouble.
As of CocoaPods 0.34, the PODS_ROOT variable is deprecated. This seems to break my build with the following error:
ruby: No such file or directory -- /Optimizely-iOS-SDK/scripts/OptimizelyPrepareNibs.rb (LoadError)
Command /bin/sh failed with exit code 1
To quote http://blog.cocoapods.org/CocoaPods-0.34:
"Unfortunately during the release candidates we discovered that a non negligible number of Pods rely on the unsupported PODS_ROOT configuration setting instead of using the vendored_frameworks and the vendored_libraries attributes. [...] However, this is a temporary band aid and Podspecs maintainers should update their specifications as soon as possible."
Problem seems to come from scripts/prepare_command.rb
in line $PODS_ROOT/Optimizely-iOS-SDK/scripts/OptimizelyPrepareNibs.rb
Hi. Just an heads up...
As you can read here the method used to achieve the blur in CSBlurView might get an app rejected by apple, as it's now considered private.
I also implemented the same method in one of my pods. I used that pod in one of my projects, and although the app passed Apple validation, the blurred view does not appear on an ipad retina with ios 7.1.
Some .otf Fonts seem not to work. Why is that?
Hi i am from Brazil... I have a problem with Canvas. I try to use CanvaCord in my Whatsapp Bot but not work.
`> [email protected] start C:\xampp\htdocs\fox-bot
node index.js
internal/modules/cjs/loader.js:1003
return process.dlopen(module, path.toNamespacedPath(filename));
^
Error: Não foi possível encontrar o módulo especificado.
\?\C:\xampp\htdocs\fox-bot\node_modules\canvas\build\Release\canvas.node
←[90m at Object.Module._extensions..node (internal/modules/cjs/loader.js:1003
:18)←[39m
←[90m at Module.load (internal/modules/cjs/loader.js:812:32)←[39m
←[90m at Function.Module._load (internal/modules/cjs/loader.js:724:14)←[39m
←[90m at Module.require (internal/modules/cjs/loader.js:849:19)←[39m
←[90m at require (internal/modules/cjs/helpers.js:74:18)←[39m
at Object. (C:\xampp\htdocs\fox-bot\node_modules\←[4mcanvas←[24m
lib\bindings.js:3:18)
←[90m at Module._compile (internal/modules/cjs/loader.js:956:30)←[39m
←[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10
)←[39m
←[90m at Module.load (internal/modules/cjs/loader.js:812:32)←[39m
←[90m at Function.Module._load (internal/modules/cjs/loader.js:724:14)←[39m
←[90m at Module.require (internal/modules/cjs/loader.js:849:19)←[39m
←[90m at require (internal/modules/cjs/helpers.js:74:18)←[39m
at Object. (C:\xampp\htdocs\fox-bot\node_modules\←[4mcanvas←[24m
lib\canvas.js:9:18)
←[90m at Module._compile (internal/modules/cjs/loader.js:956:30)←[39m
←[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10
)←[39m
←[90m at Module.load (internal/modules/cjs/loader.js:812:32)←[39m
←[90m at Function.Module._load (internal/modules/cjs/loader.js:724:14)←[39m
←[90m at Module.require (internal/modules/cjs/loader.js:849:19)←[39m
←[90m at require (internal/modules/cjs/helpers.js:74:18)←[39m
at Object. (C:\xampp\htdocs\fox-bot\node_modules\←[4mcanvas←[24m
index.js:1:16)
←[90m at Module._compile (internal/modules/cjs/loader.js:956:30)←[39m
←[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10
)←[39m
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: node index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Enzo\AppData\Roaming\npm-cache_logs\2021-03-22T20_03_32_7
06Z-debug.log`
I tried to install module named dlopen. But no work
Hi,
I've got a button which is supposed to display a View on the screen using one of your animations and when pressed again it's supposed to dismiss it.
The problem I've got is whenever the button is pressed rapidly again and again, multiple Views are being displayed as my flag variable indicates that the View is gone but it's still being animated on the screen.
Therefore is there any way of knowing when the View is finished animating?
Add comments to code for developers; for example, explain how to use methods in CSAnimation.h and CSAnimationView.h. It would be helpful for getting a better idea of how canvas works without having to read your code.
Please help. Can't install pod :(
――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
CocoaPods : 0.33.1
Ruby : ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.3.0]
RubyGems : 2.0.5
Host : Mac OS X 10.10 (14A314h)
Xcode : 6.0 (6A279r)
Ruby lib dir : /Users/yamill/.rvm/rubies/ruby-2.0.0-p247/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 639dd906b7856f9fb68241b45e10205bb55a912f
platform :ios, '7.0'
pod 'Canvas', '~> 0.1'
target "WPV" do
end
#target "WPVTests" do
#end
NoMethodError - undefined method `add_dependency' for nil:NilClass
/Users/yamill/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-0.33.1/lib/cocoapods/installer.rb:402:in `block (2 levels) in set_target_dependencies'
/Users/yamill/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-0.33.1/lib/cocoapods/installer.rb:401:in `each'
/Users/yamill/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-0.33.1/lib/cocoapods/installer.rb:401:in `block in set_target_dependencies'
/Users/yamill/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-0.33.1/lib/cocoapods/installer.rb:400:in `each'
/Users/yamill/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-0.33.1/lib/cocoapods/installer.rb:400:in `set_target_dependencies'
/Users/yamill/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-0.33.1/lib/cocoapods/installer.rb:118:in `block in generate_pods_project'
/Users/yamill/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-0.33.1/lib/cocoapods/user_interface.rb:52:in `section'
/Users/yamill/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-0.33.1/lib/cocoapods/installer.rb:114:in `generate_pods_project'
/Users/yamill/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-0.33.1/lib/cocoapods/installer.rb:91:in `install!'
/Users/yamill/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-0.33.1/lib/cocoapods/command/project.rb:40:in `run_install_with_update'
/Users/yamill/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-0.33.1/lib/cocoapods/command/project.rb:70:in `run'
/Users/yamill/.rvm/gems/ruby-2.0.0-p247/gems/claide-0.6.1/lib/claide/command.rb:281:in `run'
/Users/yamill/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-0.33.1/lib/cocoapods/command.rb:48:in `run'
/Users/yamill/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-0.33.1/bin/pod:33:in `<top (required)>'
/Users/yamill/.rvm/gems/ruby-2.0.0-p247/bin/pod:23:in `load'
/Users/yamill/.rvm/gems/ruby-2.0.0-p247/bin/pod:23:in `<main>'
/Users/yamill/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in `eval'
/Users/yamill/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in `<main>'
――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
you say ios7 auto layout not work well,
i test in ios7 auto layout,it did not work well,
so,how could we do? because, our company need ios7.
谢谢!
Can we run multiple animations at once, and cancel one without messing the other ones up?
The issue can be seen in the two videos below. The login view is a CSAnimation view which is set up in Interface Builder. The login view has a zoomOut animation set which is firing when the login screen is the initial view controller, but not when presented modally.
NOTE: I am running this in XCode 6 using Swift. I don't think that is the problem, though, since I have tried this using the deprecated modal transitions as well.
Non-modal: https://docs.google.com/a/mutualmobile.com/file/d/0B9C9Tl1ZlArPTGJXWkQ3YVExbms/edit
Modal: https://docs.google.com/a/mutualmobile.com/file/d/0B9C9Tl1ZlArPTGJXWkQ3YVExbms/edit
Do you guys have any ideas why this is happening? It seems like the CSAnimation is firing twice when presented modally but once when the screen is the initial view controller.
should modify the podfile, add the target line.
target 'Canvas' do
pod 'DAKeyboardControl'
pod 'Canvas', :path => './Canvas.podspec'
pod 'URBMediaFocusViewController'
end
Hi, When the view loads ie after segue from previous VC, the animations have almost already completed. I tried changing the delay but it didn't work. I want the animations to happen after the view has appeared. Any help here?
Thanks
Am I right in thinking you created a custom UIView to do the animations?
So I must create my own CSAnimationView sub-classes to harness this? (or place views inside a CSAnimationView)
Hi guys, is there a way to make the animations repeat itself continuously?
hello I first tested canvas it worked I loved the animation then I added swrevealview controller for my menu bar and now my animation is not working
» pod install
Updating local specs repositories
CocoaPods 1.0.0.beta.6 is available.
To update use: sudo gem install cocoapods --pre
[!] This is a test version we'd love you to try.
For more information see http://blog.cocoapods.org
and the CHANGELOG for this version http://git.io/BaH8pQ.
Analyzing dependencies
――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
/Users/eric/.rvm/gems/ruby-2.3.0/bin/pod install
pod install
CocoaPods : 0.39.0
Ruby : ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]
RubyGems : 2.5.1
Host : Mac OS X 10.11.2 (15C50)
Xcode : 7.1.1 (7B1005)
Git : git version 2.4.9 (Apple Git-60)
Ruby lib dir : /Users/eric/.rvm/rubies/ruby-2.3.0/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 92aabb977e468f5c6955406c79c520e91f013e63
cocoapods-plugins : 0.4.2
cocoapods-search : 0.1.0
cocoapods-stats : 0.6.2
cocoapods-trunk : 0.6.4
cocoapods-try : 0.5.1
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '7.0'
pod 'Canvas', '~> 0.1.2'
NoMethodError - undefined method `to_ary' for #<Pod::Specification name="Canvas">
Did you mean? to_query
/Users/eric/.rvm/gems/ruby-2.3.0/gems/cocoapods-0.39.0/lib/cocoapods/resolver/lazy_specification.rb:14:in `method_missing'
/Users/eric/.rvm/gems/ruby-2.3.0/gems/cocoapods-0.39.0/lib/cocoapods/resolver.rb:64:in `flatten'
/Users/eric/.rvm/gems/ruby-2.3.0/gems/cocoapods-0.39.0/lib/cocoapods/resolver.rb:64:in `block in resolve'
/Users/eric/.rvm/gems/ruby-2.3.0/gems/cocoapods-0.39.0/lib/cocoapods/resolver.rb:63:in `tap'
/Users/eric/.rvm/gems/ruby-2.3.0/gems/cocoapods-0.39.0/lib/cocoapods/resolver.rb:63:in `resolve'
/Users/eric/.rvm/gems/ruby-2.3.0/gems/cocoapods-0.39.0/lib/cocoapods/installer/analyzer.rb:539:in `block in resolve_dependencies'
/Users/eric/.rvm/gems/ruby-2.3.0/gems/cocoapods-0.39.0/lib/cocoapods/user_interface.rb:59:in `section'
/Users/eric/.rvm/gems/ruby-2.3.0/gems/cocoapods-0.39.0/lib/cocoapods/installer/analyzer.rb:537:in `resolve_dependencies'
/Users/eric/.rvm/gems/ruby-2.3.0/gems/cocoapods-0.39.0/lib/cocoapods/installer/analyzer.rb:70:in `analyze'
/Users/eric/.rvm/gems/ruby-2.3.0/gems/cocoapods-0.39.0/lib/cocoapods/installer.rb:213:in `analyze'
/Users/eric/.rvm/gems/ruby-2.3.0/gems/cocoapods-0.39.0/lib/cocoapods/installer.rb:136:in `block in resolve_dependencies'
/Users/eric/.rvm/gems/ruby-2.3.0/gems/cocoapods-0.39.0/lib/cocoapods/user_interface.rb:59:in `section'
/Users/eric/.rvm/gems/ruby-2.3.0/gems/cocoapods-0.39.0/lib/cocoapods/installer.rb:135:in `resolve_dependencies'
/Users/eric/.rvm/gems/ruby-2.3.0/gems/cocoapods-0.39.0/lib/cocoapods/installer.rb:105:in `install!'
/Users/eric/.rvm/gems/ruby-2.3.0/gems/cocoapods-0.39.0/lib/cocoapods/command/project.rb:71:in `run_install_with_update'
/Users/eric/.rvm/gems/ruby-2.3.0/gems/cocoapods-0.39.0/lib/cocoapods/command/project.rb:101:in `run'
/Users/eric/.rvm/gems/ruby-2.3.0/gems/claide-0.9.1/lib/claide/command.rb:312:in `run'
/Users/eric/.rvm/gems/ruby-2.3.0/gems/cocoapods-0.39.0/lib/cocoapods/command.rb:47:in `run'
/Users/eric/.rvm/gems/ruby-2.3.0/gems/cocoapods-0.39.0/bin/pod:44:in `<top (required)>'
/Users/eric/.rvm/gems/ruby-2.3.0/bin/pod:23:in `load'
/Users/eric/.rvm/gems/ruby-2.3.0/bin/pod:23:in `<main>'
/Users/eric/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `eval'
/Users/eric/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `<main>'
I have a button where I want it to animate FIRST, THEN go the second view but the button goes straight to the second view controller, even though I put animView.startCanvasAnimation()
in my IBAction, I even tried to transform to the second view programmatically, but it didn't work. Please Help!
For those who prefer to use regular old git and submodules, it would be nice to be able to try the demo app without having to use Cocoapods
When integrating the framework with swift project using cocoapods, it always return the error "Undefined symbols for architecture x86_64:
"_CSAnimationTypeMorph", referenced from ..."
Is this a bug?
I had to add Acclerate framework for the project to build successfully.
The Readme can list it in the Getting Started
Hey guys,
This isn't really a big issue, but while using your control, I realized that sometimes, embedding my UILabels and such was a pain in terms of UIView constraints (I have a crap ton of UILabels in my view controller view). Instead, I think you should start making UILabel subclasses (and UIImageView) so that we don't have to embed these views...
I tried copying your code and it actually worked really well, and everything was the same from the animations, etc.:
.h
#import <UIKit/UIKit.h>
#import "CSAnimation.h"
@interface CSLabel : UILabel
@property (nonatomic) NSTimeInterval delay;
@property (nonatomic) NSTimeInterval duration;
@property (nonatomic, copy) CSAnimationType type;
@property (nonatomic) BOOL pauseAnimationOnAwake;
@end
@interface UILabel (CSLabel)
- (void)startCanvasAnimation;
@end
.m
#import "CSLabel.h"
@implementation CSLabel
- (void)awakeFromNib {
if (self.type && self.duration && ! self.pauseAnimationOnAwake) {
[self startCanvasAnimation];
}
}
- (void)startCanvasAnimation {
Class <CSAnimation> class = [CSAnimation classForAnimationType:self.type];
[class performAnimationOnView:self duration:self.duration delay:self.delay];
[super startCanvasAnimation];
}
@end
@implementation UIView (CSAnimationView)
- (void)startCanvasAnimation {
[[self subviews] enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
[obj startCanvasAnimation];
}];
}
@end
Just something to think about. This control has been amazing!
Hello, have you an swift usage exemple ?
Is it possible to import files without using Pods?
Which files shoul I import on my project?
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.