appunite / CLCascade

Twitter-like cascade UI library
http://appunite.com/
Other
504 stars 67 forks source link

It would help if there was not so much subclassing #16

Closed sumchattering closed 4 years ago

emilwojtaszek commented 12 years ago

Just check the example project, only what you have to do is to change: UIViewController -> CLViewController UITableViewController -> CLTableViewController

I thing it is extremely easy! To make it faster use Edit->Refactor or Find->Replace All.

I could not use UINavigationController becouse I've started working on this project before iOS 5 (so there was no properties like childViewControllers and I can't control transitions).

Following this path, I've started using CLNavigationController, so I need to sublass UIViewController to add property of this, to have acces to object which is responding for hierarchy. What more is have ivars which save current state.

I thing inheritance is necessary to deal with all problems, but I could be wrong. If you have a different vision, share it with me, I welcome the opportunity to teach something new.

This project is still in development stage, and feel free to fork and make same pull request to improve this project.

ipodishima commented 12 years ago

Hi samyzee

Just to know : will you fork the project to remove all the inheritance stuff ? Because I have the same problem : an iPhone App with controllers, and I just don't want to copy / paste all my controller part code for the iPad. In my iPhone App, I already did this for a custom Tab Bar. This is all about categories and associative references, seems that in three20 they don't do like this.

If you won't fork, I do it maybe (depends on the time I have)... Just let me know plz

steipete commented 12 years ago

ipodshima, you may wanna check out my stacked view - I looked into CLCascade some time ago but needed a different concept, so I built this: https://github.com/steipete/PSStackedView

ipodishima commented 12 years ago

Hi,

I checked out your implementation. Seems to be interesting because you do not need to inherit but there are some things I will need to correct if I use yours :

So, I'm not really sure which one of the project I will chose ;)

Le 1 nov. 2011 à 18:11, Peter Steinberger a écrit :

ipodshima, you may wanna check out my stacked view - I looked into CLCascade some time ago but needed a different concept, so I built this: https://github.com/steipete/PSStackedView

Reply to this email directly or view it on GitHub: https://github.com/appunite/CLCascade/issues/16#issuecomment-2592987

ipodishima commented 12 years ago

Yes maybe. Honestly I'm still thinking because the main problem in CLCascade is the CLViewController. This is the only class I need to move in a category to put my iPhone controllers instead (with some adaptations of course, but easy ones). The rest of the class can stay like that in my opinion

steipete commented 12 years ago

For those issues, it's better to open up issues on my repo.

For the rounded corners - all the code is already there, but deactivated because it needs masking, and this is an absolute performance sucker (it needs offscreen rendering). Thus, it's better to fake the corners yourself.

for the overlay - you could change the z order of the menu items, that shouldn't be so hard.

the shadow stuff is also easily fixable, some code's already there, just didn't had the need to in my project.

for animations, lots of work went in there, but yes, there's still place for improvements. for my use case, it worked very well.

steipete commented 12 years ago

Does CLCascade support view controllers of variable size? Last time I checked there were two fixed sizes.

emilwojtaszek commented 12 years ago

Yes, that's true, CLCascade support two sizes: typedef enum { CLViewSizeNormal = 0, CLViewSizeWider = 1 } CLViewSize;

but you can set this sizes. Calculation is crucial in this framework. Look at this: http://cl.ly/3v352221030W1t0b2X3r If you change leftInset, you can change the width of page.

emilwojtaszek commented 12 years ago

I came up with a new idea, it will be easier if you replace UIViewController to TTViewController in CLViewController.h.

steipete commented 12 years ago

See, my approach calculates all sizes dynamically. No need to restrict it to certain sizes. I just read what size the view controller has when you add it, and use this size. Also supporting dynamic changing of the width (e.g. a smaller max width on portrait mode).

emilwojtaszek commented 12 years ago

Great, I guess it took you a lot of time, but I focused on the interface that most resembled that of Twitter. Maybe in the future I think of similar functionality. I really need to look into your code ;)

emilwojtaszek commented 12 years ago

Let's back to the main thread. Does conversion of a UIViewController to TTViewController comes into play?

ipodishima commented 12 years ago

Hi

Right now I'm working on a solution to move the CLViewController to a UIViewController category. I'm close, there are just some issues with the loadView method. By the way, for the CategorieViewController for example, which is loaded from CLTableViewController (this will probably change with my implementation) there is something wrong : why don't you call the [super loadView] method instead of rewriting exactly the same ?

ipodishima commented 12 years ago

Did it !

When I will be at home I pull it (network at the office don't work so much). There will maybe be some stuff to correct / add etc but I'm glad of what I achieved ! I can push any controller I want now