MWCaptionView.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. //
  2. // MWCaptionView.h
  3. // MWPhotoBrowser
  4. //
  5. // Created by Michael Waterfall on 30/12/2011.
  6. // Copyright (c) 2011 __MyCompanyName__. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import "MWPhotoProtocol.h"
  10. @interface MWCaptionView : UIToolbar
  11. //TWS
  12. @property (nonatomic, strong) id <MWPhoto> photo;
  13. @property (nonatomic, strong) UILabel *label;
  14. // Init
  15. - (id)initWithPhoto:(id<MWPhoto>)photo;
  16. // To create your own custom caption view, subclass this view
  17. // and override the following two methods (as well as any other
  18. // UIView methods that you see fit):
  19. // Override -setupCaption so setup your subviews and customise the appearance
  20. // of your custom caption
  21. // You can access the photo's data by accessing the _photo ivar
  22. // If you need more data per photo then simply subclass MWPhoto and return your
  23. // subclass to the photo browsers -photoBrowser:photoAtIndex: delegate method
  24. - (void)setupCaption;
  25. // Override -sizeThatFits: and return a CGSize specifying the height of your
  26. // custom caption view. With width property is ignored and the caption is displayed
  27. // the full width of the screen
  28. - (CGSize)sizeThatFits:(CGSize)size;
  29. @end