Giter Club home page Giter Club logo

Comments (9)

grp avatar grp commented on August 29, 2024

Do you have the latest commit in place? There was a retain cycle that got fixed: 32ded5b

from shimmer.

lionhylra avatar lionhylra commented on August 29, 2024

Thanks. I used the package on cocoaPods.

from shimmer.

grp avatar grp commented on August 29, 2024

I'll put out an update for that soon, but for now you should be able to point Cocoapods to that commit. Thanks for filing!

from shimmer.

lionhylra avatar lionhylra commented on August 29, 2024

I just use the latest commit and test it in the Instrument. The FBShimmeringLayer and FBShimmeringMaskLayer are still retained. Could you have a check?

from shimmer.

grp avatar grp commented on August 29, 2024

When you say the instances increase when it is 'displayed', what do you mean by that? Are you asking it to start shimmering? Are you simply adding it to the view hierarchy? Creating a new FBShimmeringView?

I would try limiting the operations you perform on the shimmering view, then go into the one operation that seems to cause the issue and find where it's allocating a new object.

from shimmer.

grp avatar grp commented on August 29, 2024

I pushed another commit that might help. Let me know if that fixes it.

from shimmer.

lionhylra avatar lionhylra commented on August 29, 2024

Please see my code below:

@interface LoginViewController()
@property (nonatomic, weak) IBOutlet FBShimmeringView * shimmerView;
@property (nonatomic, weak) IBOutlet UITextField * emailTextField;
@property (nonatomic, weak) IBOutlet UITextField * passwordTextField;
@property (nonatomic, weak) IBOutlet UIButton * loginButton;
@end
@implementation JLPLoginViewController
- (void)viewDidLoad {
    [super viewDidLoad];
    [self showLogo];
}
-(void)showLogo{
    UIImageView *imageView = [[UIImageView alloc] initWithFrame:self.shimmerView.bounds];
    imageView.image = [UIImage imageNamed:@"logo"];
    imageView.contentMode = UIViewContentModeScaleAspectFit;
    self.shimmerView.contentView = imageView;

    // Start shimmering.
    self.shimmerView.shimmering = YES;
}
@end

What I did is:

  1. I instantiate the LoginViewController from storyboard in '- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions', and assign it to the rootViewController of main window
  2. When the login button is tapped, I instantiate another view controller and assign to the rootViewController of main window. At this moment, the LoginViewController should have been deallocated.
  3. When the logout button is tapped, instantiate a LoginViewController and assign it to the rootViewController of main window again. At this moment, the FBShimmeringLayer of previous LoginViewController is not deallocated and a new instance of FBShimmeringLayer is created for the new LoginViewController.

from shimmer.

lionhylra avatar lionhylra commented on August 29, 2024

After trying the last commit, I find the issue is still there.
screenshot 2015-10-22 11 38 17
screenshot 2015-10-22 11 38 36

from shimmer.

grp avatar grp commented on August 29, 2024

Unfortunately, you'll have to debug this yourself. It may be due to the specifics of how you're using Shimmer.

from shimmer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.