Guest User

Untitled

a guest
Jul 16th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. #import <UIKit/UIKit.h>
  2. #import <Foundation/Foundation.h>
  3.  
  4. @interface UIImageText : UIView {
  5. IBOutlet UIImageView *image;
  6. UIImage *curImageLoaded;
  7. IBOutlet UILabel *labelText;
  8. IBOutlet CGPoint centera;
  9. }
  10. - (IBAction)loadView:(CGFloat)alpha withImage:(UIImage *)loadImage withColor:(UIColor *)color withText:(NSString *)text;
  11. - (IBAction)setAlpha:(CGFloat)alpha;
  12. - (UIImage *)imagea;
  13. - (IBAction)setColor:(UIColor *)color;
  14. - (IBAction)setImagea:(UIImage *)loadImage;
  15. - (IBAction)setText:(NSString *)text;
  16. - (IBAction)setCentera:(CGPoint)centerSet;
  17. - (CGPoint)centera;
  18. - (NSString *)text;
  19.  
  20. @property (nonatomic, retain) IBOutlet UIImageView *image;
  21. @property (nonatomic, retain) IBOutlet UILabel *labelText;
  22.  
  23. @end
  24.  
  25.  
  26. #import "UIImageText.h"
  27.  
  28.  
  29. @implementation UIImageText
  30.  
  31.  
  32. @synthesize image, labelText;
  33.  
  34. - (IBAction)loadView:(CGFloat)alpha withImage:(UIImage *)loadImage withColor:(UIColor *)color withText:(NSString *)text {
  35. [self setAlpha:alpha];
  36. [self setColor:color];
  37. [self setImagea:loadImage];
  38. [self setText:text];
  39. [self addSubview:image];
  40. [self addSubview:text];
  41. }
  42. -(NSString *)text
  43. {
  44. return labelText.text;
  45. }
  46. -(CGPoint)centera
  47. {
  48. return [self center];
  49. }
  50.  
  51. - (IBAction)setCentera:(CGPoint)centerSet;
  52. {
  53. self.center = centerSet;
  54. }
  55. -(UIImage *)imagea
  56. {
  57. return curImageLoaded;
  58. }
  59.  
  60. - (IBAction)setAlpha:(CGFloat)alpha {
  61. [image setAlpha:alpha];
  62. }
  63.  
  64. - (IBAction)setColor:(UIColor *)color {
  65. [image setBackgroundColor:color];
  66. }
  67.  
  68. - (IBAction)setImagea:(UIImage *)loadImage {
  69. NSLog(@"setting image");
  70. [self.image setImage:loadImage];
  71. curImageLoaded=loadImage;
  72.  
  73.  
  74.  
  75. //[image beginAnimations:nil context:NULL];
  76. //[image setAnimationDuration:2];
  77. //[image setAlpha:1];
  78. //[image commitAnimations];
  79.  
  80. }
  81.  
  82. - (IBAction)setText:(NSString *)text {
  83. [labelText setText:text];
  84. }
  85. @end
Add Comment
Please, Sign In to add comment