hyperoslo / cardstack Goto Github PK
View Code? Open in Web Editor NEWA container view controller implementing a stack of "cards" (each card is a view controller)
License: Other
A container view controller implementing a stack of "cards" (each card is a view controller)
License: Other
Support dragging the front screen down to see the list, if you're using a scroll view you could achieve this by looking if you're at the beginning of the view.
Why is this not written in Swift?
I've seen many methods that return suddenly in the middle of their operation if an if
statement applies. Might be better to use if
and else
in this cases, returning in the middle of methods is error prone, hard to debug and might cause unexpected behaviour for other developers that are not that familiar with the codebase.
There are 2 types of warnings:
CardStackController.m:75:5: Instance variable '_currentCardIndex' is being directly accessed
CardStackController.m:177:18: Comparison of integers of different signs: 'NSInteger' (aka 'long') and 'NSUInteger' (aka 'unsigned long')
I played with this before doing collections. Maybe it could have been useful for inspiration.
The processing in the completion block should be necessary. Data consistency should be handled by the library.
- (void)removeAction:(UIButton *)button {
NSInteger index = button.superview.tag;
[self.cardStackController removeCardAtIndex:index animated:YES withCompletion:^{
for (NSUInteger i = 0; i < self.viewControllers.count; i++) {
UIViewController *viewController = [self.viewControllers objectAtIndex:i];
viewController.view.tag = i;
}
}];
}
This should just work:
- (void)removeAction:(UIButton *)button {
NSInteger index = button.superview.tag;
[self.cardStackController removeCardAtIndex:index animated:YES withCompletion:nil];
}
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.