Advertisement
Guest User

Untitled

a guest
Apr 16th, 2014
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. - (id)init {
  2. if (self = [super init]) {
  3. self.user = [User newUserWithTempData];
  4. }
  5. return self;
  6. }
  7.  
  8. - (void)viewDidLoad
  9. {
  10. [super viewDidLoad];
  11. self.userNameLabel.text = self.user.nameString;
  12. }
  13.  
  14. #import "CircleView.h"
  15.  
  16. @implementation CircleView
  17.  
  18. - (void)drawRect:(CGRect)rect{
  19. // CUSTOM DRAWING METHOD HERE
  20. }
  21.  
  22. @end
  23.  
  24. #import <UIKit/UIKit.h>
  25. @class CircleView;
  26. @interface CreateNewQuestionCell : UITableViewCell
  27. @property (nonatomic, weak) IBOutlet CircleView *circleView;
  28. @end
  29.  
  30. // MyUIViewController.h
  31.  
  32. #import <UIKit/UIKit.h>
  33. #import "BezierGraphView.h"
  34.  
  35. @interface MyUIViewController : UIViewController
  36.  
  37. @property (nonatomic, strong) IBOutlet BezierGraphView *graphView;
  38. @property (strong) IBOutlet UISlider *xSlider;
  39. @property (strong) IBOutlet UISlider *ySlider;
  40. @property (strong) IBOutlet UISlider *zSlider;
  41.  
  42. -(IBAction)sliderValueDidChange;
  43.  
  44. @end
  45.  
  46. //BezierGraphView.h
  47.  
  48. #import <UIKit/UIKit.h>
  49.  
  50. @interface BezierGraphView : UIView
  51.  
  52. -(void)valuesDidChangeWithX:(CGFloat)xValue Y:(CGFloat)yValue Z:(CGFloat)zValue;
  53.  
  54. @end
  55.  
  56.  
  57. //BezierGraphView.m
  58. #import "BezierGraphView.h"
  59.  
  60. @implementation BezierGraphView
  61.  
  62.  
  63. -(void)valuesDidChangeWithX:(CGFloat)xValue Y:(CGFloat)yValue Z:(CGFloat)zValue{
  64. //drawRect code goes here
  65. }
  66.  
  67.  
  68. @end
  69.  
  70. //MyUIViewController.m
  71.  
  72. @implementation MyUIViewController
  73.  
  74. //Other UIViewController stuff, like viewDidLoad
  75.  
  76. -(IBAction)sliderValueDidChange{
  77.  
  78. [self.graphView valuesDidChangeWithX:self.xSlider.value
  79. Y:self.ySlider.value
  80. Z:self.zSlider.value]
  81. }
  82.  
  83. @end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement