mayqiyue / OCSkeleton

[OCSkeleton] - Make your loading view a little difference.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

When to use?

KinmoCode opened this issue · comments

commented

I want to know when it should be used and when it should be closed. I don't know if I can write a demo.

you can use the library when your view is loading the remote data.
Say you need request a string from server, then the code should be like this:

[view slideToDir:OCDirectionRight animations:nil];    
[request withCallback::^(NSString *str) {
    [view stopSliding]
}];
commented

I try, thank you

commented

For a tableview, do I have to write two cell classes, one for transitional use and one for displaying formal content?

You can add the both the transitional view and the displaying view in the same cell. And use hidden to control it.

commented

I think I understand that doing two sets of layouts in a cell, hidden and displayed through the success or failure of data loading.

that's it.

commented

thx~

commented

According to today's thinking, I made two layouts in a custom cell and then created a property to determine which layout to load. Inside the cellForRowAtIndexPath method loads different cells by assigning this property, but still cannot achieve the effect. Please help guide.

hey bro, I have updated the demo to show how to switch between loading state and displaying state.

commented

First of all, I am very grateful to the god for my demo guidance, I have roughly grasped the use of methods. Now there is a problem: In actual use, I pull data from the server, pull data in the viewDidAppear method (using AFN network framework), and then change the isLoading state to false in AFN's block callback. The willDisplayCell method only begins to execute, so it does not show the skeleton effect.