You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I thought I'd start an issue with this new task I am tackling, so I can dump the ideas and issues I com across..
First thing's first, what is this about?
To make the component as not dissimilar as possible, the component needs to draw the splash view with a clipped shape in the middle. That shape would animate out by expanding until it essentially takes over the whole view. At that point, the view behind should be fully visible. So, there is no fading here.
So, the first issue I came across is: How to handle the current implementation?
I think the current implementation is useful by itself, and could be used, so I won't be replacing it. I am, however, seeing two possible approaches:
Add a new init method that takes a UIBezierPath, and save the bezier path.
The issue here is, everywhere in the code, we have to add if statements. Check if we are using the bezier path, then do this, otherwise do nothing. Same thing for the image.
Here is an example:
- (void)drawRect:(CGRect)rect
{
/* Only override draw rect for vectorized splash screen */if (!self.bezierPath) {
return [superdrawRect:rect];
}
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextAddRect(context, self.bounds);
CGContextAddPath(context, self.bezierPath.CGPath);
[self.backgroundViewColor setFill];
CGContextEOFillPath(context);
}
Provide an abstract superclass interface, and have different implementations in two subclasses.
I think this is a better approach, since it modularly separates the two functionalities. We should also hide those classes from the user, and provide a convenient "factory" method, since the user doesn't need to worry about the exact subclass he is using.
From this, I realized there will be some major overhauls to the component, but it will be hidden within the component.
Yep, I do like this idea. There is no need to worry about overhauling, it is one of the reasons the Pod is still 0.1.1. I think it is a really good idea as we should be able to mimic the twitter animation exactly.
I am happy for you to go ahead with either of these approaches.
Activity
Mazyod commentedon Aug 7, 2014
So, the first issue I came across is: How to handle the current implementation?
I think the current implementation is useful by itself, and could be used, so I won't be replacing it. I am, however, seeing two possible approaches:
UIBezierPath, and save the bezier path.The issue here is, everywhere in the code, we have to add if statements. Check if we are using the bezier path, then do this, otherwise do nothing. Same thing for the image.
Here is an example:
I think this is a better approach, since it modularly separates the two functionalities. We should also hide those classes from the user, and provide a convenient "factory" method, since the user doesn't need to worry about the exact subclass he is using.
From this, I realized there will be some major overhauls to the component, but it will be hidden within the component.
Maz
callumboddy commentedon Aug 7, 2014
Yep, I do like this idea. There is no need to worry about overhauling, it is one of the reasons the Pod is still 0.1.1. I think it is a really good idea as we should be able to mimic the twitter animation exactly.
I am happy for you to go ahead with either of these approaches.
callumboddy commentedon Aug 7, 2014
A couple of other features to consider as well:
what is your opinion here?
callumboddy commentedon Aug 7, 2014
I am also going to have a look at creating some new unique transition styles the user can then select from.
Mazyod commentedon Aug 7, 2014
I love the transitions idea! Maybe you can create a new issue for each feature/bug?