Merge remote-tracking branch 'origin/master' into init_auto
[nit.git] / lib / ios / ui / uikit.nit
1 # This file is part of NIT ( http://www.nitlanguage.org ).
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 # File generated by objcwrapper
16 #
17 # Partial wrapper of basic UIKit services.
18 module uikit
19
20 import cocoa::foundation
21 import ios
22
23 # Rectangular area on the screen
24 extern class UIView in "ObjC" `{ UIView * `}
25 super NSObject
26
27 new in "ObjC" `{ return [[UIView alloc] initWithFrame: [[UIScreen mainScreen] applicationFrame]]; `}
28
29 # Wraps: `UIView.addSubview`
30 fun add_subview(view: UIView) in "ObjC" `{
31 [self addSubview: view];
32 `}
33
34 # Wraps: `UIView.removeFromSuperview`
35 fun remove_from_superview in "ObjC" `{
36 [self removeFromSuperview];
37 `}
38
39 # Wraps: `UIView.sizeToFit`
40 fun size_to_fit in "ObjC" `{
41 [self sizeToFit];
42 `}
43
44 # Wraps: `UIView.frame =`
45 fun set_frame(x, y, w, h: Float) in "ObjC" `{
46 self.frame = CGRectMake(x, y, w, h);
47 `}
48
49 # Wraps: `UIView.bounds =`
50 fun set_bounds(x, y, w, h: Float) in "ObjC" `{
51 self.bounds = CGRectMake(x, y, w, h);
52 `}
53
54 # Wraps: `UIView.center =`
55 fun set_center(x, y: Float) in "ObjC" `{
56 self.center = CGPointMake(x, y);
57 `}
58
59 # Wraps: `UIView.userInteractionEnabled =`
60 fun user_interaction_enabled=(value: Bool) in "ObjC" `{
61 self.userInteractionEnabled = value;
62 `}
63
64 # Wraps: `UIView.translatesAutoresizingMaskIntoConstraints =`
65 fun translates_autoresizing_mask_into_constraits=(value: Bool) in "ObjC" `{
66 self.translatesAutoresizingMaskIntoConstraints = value;
67 `}
68
69 # Wraps: `UIView.backgroundColor =`
70 fun background_color=(color: UIColor) in "ObjC" `{
71 self.backgroundColor = color;
72 `}
73
74 # Wraps: `[self viewPrintFormatter]`
75 #fun view_print_formatter: UIViewPrintFormatter in "ObjC" `{
76 #return [self viewPrintFormatter];
77 #`}
78
79 # Wraps: `[self drawRect:(CGRect)rect forViewPrintFormatter:(UIViewPrintFormatter)formatter]`
80 #fun draw_rect_for_view_print_formatter(rect: CGRect, formatter: UIViewPrintFormatter) in "ObjC" `{
81 # [self drawRect: rect forViewPrintFormatter: formatter];
82 #`}
83 end
84
85 # Coordinates an app displays on a device screen
86 extern class UIWindow in "ObjC" `{ UIWindow * `}
87 super UIView
88
89 new in "ObjC" `{ return [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]]; `}
90
91 # Wraps: `[self makeKeyAndVisible]`
92 fun make_key_and_visible in "ObjC" `{
93 [self makeKeyAndVisible];
94 `}
95 end
96
97 # Base class for contorl objects
98 extern class UIControl in "ObjC" `{ UIControl * `}
99 super UIView
100
101 # Wraps: `self.enabled`
102 fun enabled: Bool in "ObjC" `{
103 return self.enabled;
104 `}
105
106 # Wraps: `self.enabled =`
107 fun enabled=(enabled: Bool) in "ObjC" `{
108 self.enabled = enabled;
109 `}
110 end
111
112 # Button on the touch screen
113 extern class UIButton in "ObjC" `{ UIButton * `}
114 super UIControl
115
116 new(kind: UIButtonType) in "ObjC" `{ return [UIButton buttonWithType: kind]; `}
117
118 # Wraps: `[self titleLabel]`
119 fun title_label: UILabel in "ObjC" `{
120 return [self titleLabel];
121 `}
122
123 # Wraps: `[self setTitle forState]`
124 fun title=(text: NSString) in "ObjC" `{
125 [self setTitle:text forState:UIControlStateNormal];
126 `}
127
128 # Wraps: `[self currentTitle]`
129 fun current_title: NSString in "ObjC" `{
130 return [self currentTitle];
131 `}
132 end
133
134 # Style of `UIButton`
135 extern class UIButtonType in "ObjC" `{ UIButtonType `}
136 new custom in "ObjC" `{ return UIButtonTypeCustom; `}
137 new system in "ObjC" `{ return UIButtonTypeSystem; `}
138 new detail_disclosure in "ObjC" `{ return UIButtonTypeDetailDisclosure; `}
139 new info_light in "ObjC" `{ return UIButtonTypeInfoLight; `}
140 new info_dark in "ObjC" `{ return UIButtonTypeInfoDark; `}
141 new contact_add in "ObjC" `{ return UIButtonTypeContactAdd; `}
142 new rounded_rect in "ObjC" `{ return UIButtonTypeRoundedRect; `}
143 end
144
145 # Read-only text view
146 extern class UILabel in "ObjC" `{ UILabel * `}
147 super UIView
148
149 new in "ObjC" `{ return [[UILabel alloc] init]; `}
150
151 # Wraps: `UILabel.text`
152 fun text: NSString in "ObjC" `{
153 return [self text];
154 `}
155
156 # Wraps: `UILabel.text`
157 fun text=(text: NSString) in "ObjC" `{
158 self.text = text;
159 `}
160
161 # Wraps: `UILabel.font`
162 #fun font: UIFont in "ObjC" `{
163 # return [self font];
164 #`}
165
166 # Wraps: `UILabel.textColor`
167 fun text_color: UIColor in "ObjC" `{
168 return [self textColor];
169 `}
170
171 # Wraps: `UILabel.shadowColor`
172 fun shadow_color: UIColor in "ObjC" `{
173 return [self shadowColor];
174 `}
175
176 # Wraps: `UILabel.shadowOffset`
177 #fun shadow_offset: CGSize in "ObjC" `{
178 # return [self shadowOffset];
179 #`}
180
181 # Wraps: `UILabel.textAlignment`
182 #fun text_alignment: NSTextAlignment in "ObjC" `{
183 # return [self textAlignment];
184 #`}
185
186 # Wraps: `UILabel.lineBreakMode`
187 #fun line_break_mode: NSLineBreakMode in "ObjC" `{
188 # return [self lineBreakMode];
189 #`}
190
191 # Wraps: `UILabel.attributedText`
192 #fun attributed_text: NSAttributedString in "ObjC" `{
193 # return [self attributedText];
194 #`}
195
196 # Wraps: `UILabel.highlightedTextColor`
197 fun highlighted_text_color: UIColor in "ObjC" `{
198 return [self highlightedTextColor];
199 `}
200
201 # Wraps: `UILabel.highlighted`
202 #fun highlighted: Bool in "ObjC" `{
203 # return [self highlighted];
204 #`}
205
206 # Wraps: `UILabel.userInteractionEnabled`
207 #fun user_interaction_enabled: Bool in "ObjC" `{
208 # return [self userInteractionEnabled];
209 #`}
210
211 # Wraps: `UILabel.enabled`
212 #fun enabled: Bool in "ObjC" `{
213 # return [self enabled];
214 #`}
215
216 # Wraps: `UILabel.numberOfLines`
217 fun number_of_lines: Int in "ObjC" `{
218 return [self numberOfLines];
219 `}
220
221 # Wraps: `UILabel.adjustsFontSizeToFitWidth`
222 fun adjusts_font_size_to_fit_width: Bool in "ObjC" `{
223 return [self adjustsFontSizeToFitWidth];
224 `}
225
226 # Wraps: `UILabel.adjustsLetterSpacingToFitWidth`
227 # Depricated
228 #fun adjusts_letter_spacing_to_fit_width: Bool in "ObjC" `{
229 # return [self adjustsLetterSpacingToFitWidth];
230 #`}
231
232 # Wraps: `UILabel.minimumFontSize`
233 # Depricated
234 #fun minimum_font_size: Float in "ObjC" `{
235 # return [self minimumFontSize];
236 #`}
237
238 # Wraps: `UILabel.baselineAdjustment`
239 #fun baseline_adjustment: UIBaselineAdjustment in "ObjC" `{
240 # return [self baselineAdjustment];
241 #`}
242
243 # Wraps: `UILabel.minimumScaleFactor`
244 fun minimum_scale_factor: Float in "ObjC" `{
245 return [self minimumScaleFactor];
246 `}
247
248 # Wraps: `UILabel.preferredMaxLayoutWidth`
249 fun preferred_max_layout_width: Float in "ObjC" `{
250 return [self preferredMaxLayoutWidth];
251 `}
252
253 # Wraps: `[self textRectForBounds:(CGRect)bounds limitedToNumberOfLines:(NSInteger)numberOfLines]`
254 #fun text_rect_for_bounds_limited_to_number_of_lines(bounds: CGRect, number_of_lines: Int): CGRect in "ObjC" `{
255 # return [self textRectForBounds: bounds limitedToNumberOfLines: number_of_lines];
256 #`}
257
258 # Wraps: `[self drawTextInRect:(CGRect)rect]`
259 #fun draw_text_in_rect(rect: CGRect) in "ObjC" `{
260 # [self drawTextInRect: rect];
261 #`}
262 end
263
264 # Color data with opacity
265 extern class UIColor in "ObjC" `{ UIColor * `}
266 super NSObject
267
268 # Wraps: `[self initWithWhite:(CGFloat)white alpha:(CGFloat)alpha]`
269 new init_with_white_alpha(white, alpha: Float) in "ObjC" `{
270 return [[UIColor alloc] initWithWhite: white alpha: alpha];
271 `}
272
273 # Wraps: `[self initWithHue:(CGFloat)hue saturation:(CGFloat)saturation brightness:(CGFloat)brightness alpha:(CGFloat)alpha]`
274 new init_with_hue_saturation_brightness_alpha(hue, saturation, brightness, alpha: Float) in "ObjC" `{
275 return [[UIColor alloc] initWithHue: hue saturation: saturation brightness: brightness alpha: alpha];
276 `}
277
278 # Wraps: `[self initWithRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha]`
279 new init_with_red_green_blue_alpha(red, green, blue, alpha: Float) in "ObjC" `{
280 return [[UIColor alloc] initWithRed: red green: green blue: blue alpha: alpha];
281 `}
282
283 # Wraps: `[self initWithCGColor:(CGColorRef)cgColor]`
284 #new init_with_cg_color(cg_color: CGColorRef) in "ObjC" `{
285 # return [[UIColor alloc] initWithCGColor: cg_color];
286 #`}
287
288 # Wraps: `[self initWithPatternImage:(UIImage)image]`
289 #new init_with_pattern_image(image: UIImage) in "ObjC" `{
290 # return [[UIColor alloc] initWithPatternImage: image];
291 #`}
292
293 # Wraps: `[self initWithCIColor:(CIColor)ciColor]`
294 #new init_with_ci_color(ci_color: CIColor) in "ObjC" `{
295 # return [[UIColor alloc] initWithCIColor: ci_color];
296 #`}
297
298 # Wraps: `[UIColor blackColor]`
299 new black_color in "ObjC" `{ return [UIColor blackColor]; `}
300
301 # Wraps: `[UIColor darkGrayColor]`
302 new dark_gray_color in "ObjC" `{ return [UIColor darkGrayColor]; `}
303
304 # Wraps: `[UIColor lightGrayColor]`
305 new light_gray_color in "ObjC" `{ return [UIColor lightGrayColor]; `}
306
307 # Wraps: `[UIColor whiteColor]`
308 new white_color in "ObjC" `{ return [UIColor whiteColor]; `}
309
310 # Wraps: `[UIColor grayColor]`
311 new gray_color in "ObjC" `{ return [UIColor grayColor]; `}
312
313 # Wraps: `[UIColor redColor]`
314 new red_color in "ObjC" `{ return [UIColor redColor]; `}
315
316 # Wraps: `[UIColor greenColor]`
317 new green_color in "ObjC" `{ return [UIColor greenColor]; `}
318
319 # Wraps: `[UIColor blueColor]`
320 new blue_color in "ObjC" `{ return [UIColor blueColor]; `}
321
322 # Wraps: `[UIColor cyanColor]`
323 new cyan_color in "ObjC" `{ return [UIColor cyanColor]; `}
324
325 # Wraps: `[UIColor yellowColor]`
326 new yellow_color in "ObjC" `{ return [UIColor yellowColor]; `}
327
328 # Wraps: `[UIColor magentaColor]`
329 new magenta_color in "ObjC" `{ return [UIColor magentaColor]; `}
330
331 # Wraps: `[UIColor orangeColor]`
332 new orange_color in "ObjC" `{ return [UIColor orangeColor]; `}
333
334 # Wraps: `[UIColor purpleColor]`
335 new purple_color in "ObjC" `{ return [UIColor purpleColor]; `}
336
337 # Wraps: `[UIColor brownColor]`
338 new brown_color in "ObjC" `{ return [UIColor brownColor]; `}
339
340 # Wraps: `[UIColor clearColor]`
341 new clear_color in "ObjC" `{ return [UIColor clearColor]; `}
342
343 # Wraps: `UIColor.CGColor`
344 #fun cg_color: CGColorRef in "ObjC" `{
345 # return [self CGColor];
346 #`}
347
348 # Wraps: `UIColor.CIColor`
349 #fun ci_color: CIColor in "ObjC" `{
350 # return [self CIColor];
351 #`}
352
353 # Wraps: `[self set]`
354 fun set in "ObjC" `{ [self set]; `}
355
356 # Wraps: `[self setFill]`
357 fun set_fill in "ObjC" `{ [self setFill]; `}
358
359 # Wraps: `[self setStroke]`
360 fun set_stroke in "ObjC" `{ [self setStroke]; `}
361
362 # Wraps: `[self getWhite:(CGFloat)white alpha:(CGFloat)alpha]`
363 #fun get_white_alpha(white: Float, alpha: Float): Bool in "ObjC" `{
364 # return [self getWhite: white alpha: alpha];
365 #`}
366
367 # Wraps: `[self getHue:(CGFloat)hue saturation:(CGFloat)saturation brightness:(CGFloat)brightness alpha:(CGFloat)alpha]`
368 #fun get_hue_saturation_brightness_alpha(hue: Float, saturation: Float, brightness: Float, alpha: Float): Bool in "ObjC" `{
369 # return [self getHue: hue saturation: saturation brightness: brightness alpha: alpha];
370 #`}
371
372 # Wraps: `[self getRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha]`
373 #fun get_red_green_blue_alpha(red: Float, green: Float, blue: Float, alpha: Float): Bool in "ObjC" `{
374 # return [self getRed: red green: green blue: blue alpha: alpha];
375 #`}
376
377 # Wraps: `[self colorWithAlphaComponent:(CGFloat)alpha]`
378 fun color_with_alpha_component(alpha: Float): UIColor in "ObjC" `{
379 return [self colorWithAlphaComponent: alpha];
380 `}
381
382 # Wraps: `[self CGColor]`
383 #fun cg_color: CGColorRef in "ObjC" `{
384 # return [self CGColor];
385 #`}
386 end
387
388 # Wraps: `[UIColor colorWithWhite:(CGFloat)white alpha:(CGFloat)alpha]`
389 #fun ui_color_color_with_white_alpha(white: Float, alpha: Float): UIColor in "ObjC" `{
390 # return [UIColor colorWithWhite: white alpha: alpha];
391 #`}
392
393 # Wraps: `[UIColor colorWithHue:(CGFloat)hue saturation:(CGFloat)saturation brightness:(CGFloat)brightness alpha:(CGFloat)alpha]`
394 #fun ui_color_color_with_hue_saturation_brightness_alpha(hue: Float, saturation: Float, brightness: Float, alpha: Float): UIColor in "ObjC" `{
395 # return [UIColor colorWithHue: hue saturation: saturation brightness: brightness alpha: alpha];
396 #`}
397
398 # Wraps: `[UIColor colorWithRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha]`
399 #fun ui_color_color_with_red_green_blue_alpha(red: Float, green: Float, blue: Float, alpha: Float): UIColor in "ObjC" `{
400 # return [UIColor colorWithRed: red green: green blue: blue alpha: alpha];
401 #`}
402
403 # Wraps: `[UIColor colorWithCGColor:(CGColorRef)cgColor]`
404 #fun ui_color_color_with_cg_color(cg_color: CGColorRef): UIColor in "ObjC" `{
405 # return [UIColor colorWithCGColor: cg_color];
406 #`}
407
408 # Wraps: `[UIColor colorWithPatternImage:(UIImage)image]`
409 #fun ui_color_color_with_pattern_image(image: UIImage): UIColor in "ObjC" `{
410 # return [UIColor colorWithPatternImage: image];
411 #`}
412
413 # Wraps: `[UIColor colorWithCIColor:(CIColor)ciColor]`
414 #fun ui_color_color_with_ci_color(ci_color: CIColor): UIColor in "ObjC" `{
415 # return [UIColor colorWithCIColor: ci_color];
416 #`}
417
418 # Editable text view
419 extern class UITextField in "ObjC" `{ UITextField * `}
420 super UIControl
421
422 new in "ObjC" `{ return [[UITextField alloc] initWithFrame: [[UIScreen mainScreen] applicationFrame]]; `}
423
424 # Wraps: `UITextField.text`
425 fun text: NSString in "ObjC" `{
426 return [self text];
427 `}
428
429 # Wraps: `UITextField.text`
430 fun text=(text: NSString) in "ObjC" `{
431 self.text = text;
432 `}
433
434 # Wraps: `UITextField.secureTextEntry`
435 fun secure_text_entry=(value: Bool) in "ObjC" `{
436 self.secureTextEntry = value;
437 `}
438 end
439
440 # Lays out a collection of views in either a column or a row
441 extern class UIStackView in "ObjC" `{ UIStackView * `}
442 super UIView
443
444 new in "ObjC" `{
445 return [[UIStackView alloc] initWithArrangedSubviews: [NSArray array]];
446 `}
447
448 # Wraps: `[self addArrangedSubview:(UIView)view]`
449 fun add_arranged_subview(view: UIView) in "ObjC" `{
450 [self addArrangedSubview: view];
451 `}
452
453 # Wraps: `[self removeArrangedSubview:(UIView)view]`
454 fun remove_arranged_subview(view: UIView) in "ObjC" `{
455 [self removeArrangedSubview: view];
456 `}
457
458 # Wraps: `[self insertArrangedSubview:(UIView)view atIndex:(NSUInteger)stackIndex]`
459 fun insert_arranged_subview_at_index(view: UIView, stack_index: Int) in "ObjC" `{
460 [self insertArrangedSubview: view atIndex: stack_index];
461 `}
462
463 # Wraps: `[self initWithArrangedSubviews:(NSArray)views]`
464 #new init_with_arranged_subviews(views: NSArray) in "ObjC" `{
465 # return [[UIStackView alloc] initWithArrangedSubviews: views];
466 #`}
467
468 # Wraps: `UIStackView.arrangedSubviews`
469 #fun arranged_subviews: NSArray in "ObjC" `{
470 # return [self arrangedSubviews];
471 #`}
472
473 # Wraps: `UIStackView.axis`
474 fun axis: UILayoutConstraintAxis in "ObjC" `{ return [self axis]; `}
475
476 # Wraps: `UIStackView.axis =`
477 fun axis=(value: UILayoutConstraintAxis) in "ObjC" `{ self.axis = value; `}
478
479 # Wraps: `UIStackView.distribution`
480 fun distribution: UIStackViewDistribution in "ObjC" `{ return [self distribution]; `}
481
482 # Wraps: `UIStackView.distribution =`
483 fun distribution=(value: UIStackViewDistribution) in "ObjC" `{ self.distribution = value; `}
484
485 # Wraps: `UIStackView.alignment`
486 fun alignment: UIStackViewAlignment in "ObjC" `{ return [self alignment]; `}
487
488 # Wraps: `UIStackView.alignment =`
489 fun alignment=(value: UIStackViewAlignment) in "ObjC" `{ self.alignment = value; `}
490
491 # Wraps: `UIStackView.spacing`
492 fun spacing: Float in "ObjC" `{ return [self spacing]; `}
493
494 # Wraps: `UIStackView.spacing =`
495 fun spacing=(value: Float) in "ObjC" `{ self.spacing = value; `}
496
497 # Wraps: `UIStackView.baselineRelativeArrangement`
498 fun baseline_relative_arrangement: Bool in "ObjC" `{
499 return self.baselineRelativeArrangement;
500 `}
501
502 # Wraps: `UIStackView.baselineRelativeArrangement`
503 fun baseline_relative_arrangement=(value: Bool) in "ObjC" `{
504 self.baselineRelativeArrangement = value;
505 `}
506
507 # Wraps: `UIStackView.layoutMarginsRelativeArrangement`
508 fun layout_margins_relative_arrangement: Bool in "ObjC" `{
509 return self.layoutMarginsRelativeArrangement;
510 `}
511
512 # Wraps: `UIStackView.layoutMarginsRelativeArrangement`
513 fun layout_margins_relative_arrangement=(value: Bool) in "ObjC" `{
514 self.layoutMarginsRelativeArrangement = value;
515 `}
516 end
517
518 # Defines the orientation of the arranged views in `UIStackView`
519 extern class UILayoutConstraintAxis in "ObjC" `{ NSInteger `}
520 new horizontal in "ObjC" `{ return UILayoutConstraintAxisHorizontal; `}
521 new vertical in "ObjC" `{ return UILayoutConstraintAxisVertical; `}
522 end
523
524 # Defines the size and position of the arranged views along the `UIStackView`'s axis
525 extern class UIStackViewDistribution in "ObjC" `{ NSInteger `}
526 new horizontal in "ObjC" `{ return UILayoutConstraintAxisHorizontal; `}
527 new fill in "ObjC" `{ return UIStackViewDistributionFill; `}
528 new fill_equally in "ObjC" `{ return UIStackViewDistributionFillEqually; `}
529 new fill_proportionally in "ObjC" `{ return UIStackViewDistributionFillProportionally; `}
530 new equal_spacing in "ObjC" `{ return UIStackViewDistributionEqualSpacing; `}
531 new equal_centering in "ObjC" `{ return UIStackViewDistributionEqualCentering; `}
532 end
533
534 # Defines the layout of the arranged views perpendicular to the `UIStackView`'s axis
535 extern class UIStackViewAlignment in "ObjC" `{ NSInteger `}
536 new fill in "ObjC" `{ return UIStackViewAlignmentFill; `}
537 new leading in "ObjC" `{ return UIStackViewAlignmentLeading; `}
538 new top in "ObjC" `{ return UIStackViewAlignmentTop; `}
539 new baseline in "ObjC" `{ return UIStackViewAlignmentFirstBaseline; `}
540 new center in "ObjC" `{ return UIStackViewAlignmentCenter; `}
541 new trailing in "ObjC" `{ return UIStackViewAlignmentTrailing; `}
542 new bottom in "ObjC" `{ return UIStackViewAlignmentBottom; `}
543 new last_baseline in "ObjC" `{ return UIStackViewAlignmentLastBaseline; `}
544 end
545
546 # View to display and edit hierarchical lists of information
547 extern class UITableView in "ObjC" `{ UITableView * `}
548 super UIView
549
550 # Wraps: `[self initWithFrame:(CGRect)frame style:(UITableViewStyle)style]`
551 new (style: UITableViewStyle) in "ObjC" `{
552 return [[UITableView alloc] initWithFrame: [[UIScreen mainScreen] bounds] style:style];
553 `}
554
555 # Wraps: `[self reloadData]`
556 fun reload_data in "ObjC" `{ [self reloadData]; `}
557
558 # Wraps: `self.autoresizingMask =`
559 fun autoresizing_mask in "ObjC" `{
560 self.autoresizingMask = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth;
561 `}
562
563 # Wraps: `self.delegate =`
564 fun delegate=(delegate: UITableViewDelegate) in "ObjC" `{ self.delegate = delegate; `}
565
566 # Wraps: `self.dataSource =`
567 fun data_source=(source: UITableViewDataSource) in "ObjC" `{ self.dataSource = source; `}
568
569 # Wraps: `[self dequeueReusableCellWithIdentifier]`
570 fun dequeue_reusable_cell_with_identifier(identifier: NSString): UITableViewCell in "ObjC" `{
571 return [self dequeueReusableCellWithIdentifier:identifier];
572 `}
573 end
574
575 # Delegate for a `UITableView` to configure selection, sections, cells and more
576 extern class UITableViewDelegate in "ObjC" `{ id<UITableViewDelegate> `}
577 super NSObject
578 end
579
580 # Mediator the data model for a `UITableView`
581 extern class UITableViewDataSource in "ObjC" `{ id<UITableViewDataSource> `}
582 super NSObject
583 end
584
585 # Cell of a `UITableViewCell`
586 extern class UITableViewCell in "ObjC" `{ UITableViewCell * `}
587 super NSObject
588
589 new (identifier: NSString) in "ObjC" `{
590 return [[UITableViewCell alloc]
591 initWithStyle:UITableViewCellStyleDefault
592 reuseIdentifier:identifier];
593 `}
594
595 # Wraps: `[self textLabel]`
596 fun text_label: UILabel in "ObjC" `{ return [self textLabel]; `}
597
598 # Wraps: `[self contentView]`
599 fun content_view: UIView in "ObjC" `{ return [self contentView]; `}
600 end
601
602 # Style of a `UITableView`
603 extern class UITableViewStyle in "ObjC" `{ UITableViewStyle* `}
604 super NSObject
605
606 new plain in "ObjC" `{ return UITableViewStylePlain; `}
607 new grouped in "ObjC" `{ return UITableViewStyleGrouped; `}
608 end
609
610 # On/Off button
611 extern class UISwitch in "ObjC" `{ UISwitch * `}
612 super UIView
613
614 # Wraps: `[self initWithFrame:(CGRect)frame]`
615 new in "ObjC" `{ return [[UISwitch alloc] initWithFrame: [[UIScreen mainScreen] applicationFrame]]; `}
616
617 # Wraps: `UISwitch.onTintColor`
618 # fun on_tint_color: UIColor in "ObjC" `{
619 # return [self onTintColor];
620 # `}
621
622 # Wraps: `UISwitch.tintColor`
623 # fun tint_color: UIColor in "ObjC" `{
624 # return [self tintColor];
625 # `}
626
627 # Wraps: `UISwitch.thumbTintColor`
628 # fun thumb_tint_color: UIColor in "ObjC" `{
629 # return [self thumbTintColor];
630 # `}
631
632 # Wraps: `UISwitch.onImage`
633 # fun on_image: UIImage in "ObjC" `{
634 # return [self onImage];
635 # `}
636
637 # Wraps: `UISwitch.offImage`
638 # fun off_image: UIImage in "ObjC" `{
639 # return [self offImage];
640 # `}
641
642 # Wraps: `UISwitch.on`
643 fun on: Bool in "ObjC" `{
644 return self.on;
645 `}
646
647 # Wraps: `[self setOn:(BOOL)on animated:(BOOL)animated]`
648 fun set_on_animated(on: Bool, animated: Bool) in "ObjC" `{
649 [self setOn: on animated: animated];
650 `}
651 end