aa072b861870596eb8aebd588e86d2c18cf8b8fb
[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 end
434
435 # Lays out a collection of views in either a column or a row
436 extern class UIStackView in "ObjC" `{ UIStackView * `}
437 super UIView
438
439 new in "ObjC" `{
440 return [[UIStackView alloc] initWithArrangedSubviews: [NSArray array]];
441 `}
442
443 # Wraps: `[self addArrangedSubview:(UIView)view]`
444 fun add_arranged_subview(view: UIView) in "ObjC" `{
445 [self addArrangedSubview: view];
446 `}
447
448 # Wraps: `[self removeArrangedSubview:(UIView)view]`
449 fun remove_arranged_subview(view: UIView) in "ObjC" `{
450 [self removeArrangedSubview: view];
451 `}
452
453 # Wraps: `[self insertArrangedSubview:(UIView)view atIndex:(NSUInteger)stackIndex]`
454 fun insert_arranged_subview_at_index(view: UIView, stack_index: Int) in "ObjC" `{
455 [self insertArrangedSubview: view atIndex: stack_index];
456 `}
457
458 # Wraps: `[self initWithArrangedSubviews:(NSArray)views]`
459 #new init_with_arranged_subviews(views: NSArray) in "ObjC" `{
460 # return [[UIStackView alloc] initWithArrangedSubviews: views];
461 #`}
462
463 # Wraps: `UIStackView.arrangedSubviews`
464 #fun arranged_subviews: NSArray in "ObjC" `{
465 # return [self arrangedSubviews];
466 #`}
467
468 # Wraps: `UIStackView.axis`
469 fun axis: UILayoutConstraintAxis in "ObjC" `{ return [self axis]; `}
470
471 # Wraps: `UIStackView.axis =`
472 fun axis=(value: UILayoutConstraintAxis) in "ObjC" `{ self.axis = value; `}
473
474 # Wraps: `UIStackView.distribution`
475 fun distribution: UIStackViewDistribution in "ObjC" `{ return [self distribution]; `}
476
477 # Wraps: `UIStackView.distribution =`
478 fun distribution=(value: UIStackViewDistribution) in "ObjC" `{ self.distribution = value; `}
479
480 # Wraps: `UIStackView.alignment`
481 fun alignment: UIStackViewAlignment in "ObjC" `{ return [self alignment]; `}
482
483 # Wraps: `UIStackView.alignment =`
484 fun alignment=(value: UIStackViewAlignment) in "ObjC" `{ self.alignment = value; `}
485
486 # Wraps: `UIStackView.spacing`
487 fun spacing: Float in "ObjC" `{ return [self spacing]; `}
488
489 # Wraps: `UIStackView.spacing =`
490 fun spacing=(value: Float) in "ObjC" `{ self.spacing = value; `}
491
492 # Wraps: `UIStackView.baselineRelativeArrangement`
493 #fun baseline_relative_arrangement: Bool in "ObjC" `{
494 # return [self baselineRelativeArrangement];
495 #`}
496
497 # Wraps: `UIStackView.layoutMarginsRelativeArrangement`
498 #fun layout_margins_relative_arrangement: Bool in "ObjC" `{
499 # return [self layoutMarginsRelativeArrangement];
500 #`}
501 end
502
503 # Defines the orientation of the arranged views in `UIStackView`
504 extern class UILayoutConstraintAxis in "ObjC" `{ NSInteger `}
505 new horizontal in "ObjC" `{ return UILayoutConstraintAxisHorizontal; `}
506 new vertical in "ObjC" `{ return UILayoutConstraintAxisVertical; `}
507 end
508
509 # Defines the size and position of the arranged views along the `UIStackView`'s axis
510 extern class UIStackViewDistribution in "ObjC" `{ NSInteger `}
511 new horizontal in "ObjC" `{ return UILayoutConstraintAxisHorizontal; `}
512 new fill in "ObjC" `{ return UIStackViewDistributionFill; `}
513 new fill_equally in "ObjC" `{ return UIStackViewDistributionFillEqually; `}
514 new fill_proportionally in "ObjC" `{ return UIStackViewDistributionFillProportionally; `}
515 new equal_spacing in "ObjC" `{ return UIStackViewDistributionEqualSpacing; `}
516 new equal_centering in "ObjC" `{ return UIStackViewDistributionEqualCentering; `}
517 end
518
519 # Defines the layout of the arranged views perpendicular to the `UIStackView`'s axis
520 extern class UIStackViewAlignment in "ObjC" `{ NSInteger `}
521 new fill in "ObjC" `{ return UIStackViewAlignmentFill; `}
522 new leading in "ObjC" `{ return UIStackViewAlignmentLeading; `}
523 new top in "ObjC" `{ return UIStackViewAlignmentTop; `}
524 new baseline in "ObjC" `{ return UIStackViewAlignmentFirstBaseline; `}
525 new center in "ObjC" `{ return UIStackViewAlignmentCenter; `}
526 new trailing in "ObjC" `{ return UIStackViewAlignmentTrailing; `}
527 new bottom in "ObjC" `{ return UIStackViewAlignmentBottom; `}
528 new last_baseline in "ObjC" `{ return UIStackViewAlignmentLastBaseline; `}
529 end
530
531 # View to display and edit hierarchical lists of information
532 extern class UITableView in "ObjC" `{ UITableView * `}
533 super UIView
534
535 # Wraps: `[self initWithFrame:(CGRect)frame style:(UITableViewStyle)style]`
536 new (style: UITableViewStyle) in "ObjC" `{
537 return [[UITableView alloc] initWithFrame: [[UIScreen mainScreen] bounds] style:style];
538 `}
539
540 # Wraps: `[self reloadData]`
541 fun reload_data in "ObjC" `{ [self reloadData]; `}
542
543 # Wraps: `self.autoresizingMask =`
544 fun autoresizing_mask in "ObjC" `{
545 self.autoresizingMask = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth;
546 `}
547
548 # Wraps: `self.delegate =`
549 fun delegate=(delegate: UITableViewDelegate) in "ObjC" `{ self.delegate = delegate; `}
550
551 # Wraps: `self.dataSource =`
552 fun data_source=(source: UITableViewDataSource) in "ObjC" `{ self.dataSource = source; `}
553
554 # Wraps: `[self dequeueReusableCellWithIdentifier]`
555 fun dequeue_reusable_cell_with_identifier(identifier: NSString): UITableViewCell in "ObjC" `{
556 return [self dequeueReusableCellWithIdentifier:identifier];
557 `}
558 end
559
560 # Delegate for a `UITableView` to configure selection, sections, cells and more
561 extern class UITableViewDelegate in "ObjC" `{ id<UITableViewDelegate> `}
562 super NSObject
563 end
564
565 # Mediator the data model for a `UITableView`
566 extern class UITableViewDataSource in "ObjC" `{ id<UITableViewDataSource> `}
567 super NSObject
568 end
569
570 # Cell of a `UITableViewCell`
571 extern class UITableViewCell in "ObjC" `{ UITableViewCell * `}
572 super NSObject
573
574 new (identifier: NSString) in "ObjC" `{
575 return [[UITableViewCell alloc]
576 initWithStyle:UITableViewCellStyleDefault
577 reuseIdentifier:identifier];
578 `}
579
580 # Wraps: `[self textLabel]`
581 fun text_label: UILabel in "ObjC" `{ return [self textLabel]; `}
582
583 # Wraps: `[self contentView]`
584 fun content_view: UIView in "ObjC" `{ return [self contentView]; `}
585 end
586
587 # Style of a `UITableView`
588 extern class UITableViewStyle in "ObjC" `{ UITableViewStyle* `}
589 super NSObject
590
591 new plain in "ObjC" `{ return UITableViewStylePlain; `}
592 new grouped in "ObjC" `{ return UITableViewStyleGrouped; `}
593 end