开源软件名称(OpenSource Name):moqod/ios-material-design开源软件地址(OpenSource Url):https://github.com/moqod/ios-material-design开源编程语言(OpenSource Language):Objective-C 100.0%开源软件介绍(OpenSource Introduction):iOS Material Design LibraryInspired by Material Design guideline from Google. Features
SampleClone the repo and run the project. UsageNow there is only one interesting category - (void)mdInflateAnimatedFromPoint:(CGPoint)point backgroundColor:(UIColor *)backgroundColor duration:(NSTimeInterval)duration completion:(void (^)(void))block;
- (void)mdDeflateAnimatedToPoint:(CGPoint)point backgroundColor:(UIColor *)backgroundColor duration:(NSTimeInterval)duration completion:(void (^)(void))block; These methods allow you to change background color of a view using shape animation from any point, for example - touch, Example for UIControl: - (void)buttonAction:(UIControl *)sender event:(UIEvent *)event {
CGPoint position = [[[event allTouches] anyObject] locationInView:self.subview];
[self.subview mdInflateAnimatedFromPoint:position backgroundColor:[self randomColor] duration:0.33 completion:nil];
} Static methods: ``` objc + (void)mdInflateTransitionFromView:(UIView *)fromView toView:(UIView *)toView originalPoint:(CGPoint)originalPoint duration:(NSTimeInterval)duration completion:(void (^)(void))block;
These methods perform transition like [UIView transitionFromView:fromView toView:toView duration:duration options:UIViewAnimationOptionBeginFromCurrentState completion:nil]; but with shape animation from given point. You could use this functinoality with any `UIView` instance without subclassing, cool, isnt'it? Source code is simple, customize, use, add merge requests! #Licence MIT |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论