a_star: don't crash on deserialization errors and limit static types
[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] init]; `}
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] init]; `}
90
91 # Wraps: `[self makeKeyAndVisible]`
92 fun make_key_and_visible in "ObjC" `{
93 [self makeKeyAndVisible];
94 `}
95 end
96
97 # Manages a set of views
98 extern class UIViewController in "ObjC" `{ UIViewController * `}
99 super NSObject
100
101 new in "ObjC" `{
102 return [[UIViewController alloc]initWithNibName:nil bundle:nil];
103 `}
104
105 # Wraps: `self.view`
106 fun view: UIView in "ObjC" `{ return self.view; `}
107
108 # Wraps: `self.view`
109 fun view=(view: UIView) in "ObjC" `{ self.view = view; `}
110
111 # Wraps: `self.title`
112 fun title: NSString in "ObjC" `{ return self.title; `}
113
114 # Wraps: `self.title`
115 fun title=(title: NSString) in "ObjC" `{ self.title = title; `}
116 end
117
118 # Base class for control objects
119 extern class UIControl in "ObjC" `{ UIControl * `}
120 super UIView
121
122 # Wraps: `self.enabled`
123 fun enabled: Bool in "ObjC" `{
124 return self.enabled;
125 `}
126
127 # Wraps: `self.enabled =`
128 fun enabled=(enabled: Bool) in "ObjC" `{
129 self.enabled = enabled;
130 `}
131 end
132
133 # Button on the touch screen
134 extern class UIButton in "ObjC" `{ UIButton * `}
135 super UIControl
136
137 new(kind: UIButtonType) in "ObjC" `{ return [UIButton buttonWithType: kind]; `}
138
139 # Wraps: `[self titleLabel]`
140 fun title_label: UILabel in "ObjC" `{
141 return [self titleLabel];
142 `}
143
144 # Wraps: `[self setTitle forState]`
145 fun title=(text: NSString) in "ObjC" `{
146 [self setTitle:text forState:UIControlStateNormal];
147 `}
148
149 # Wraps: `[self currentTitle]`
150 fun current_title: NSString in "ObjC" `{
151 return [self currentTitle];
152 `}
153 end
154
155 # Style of `UIButton`
156 extern class UIButtonType in "ObjC" `{ UIButtonType `}
157 new custom in "ObjC" `{ return UIButtonTypeCustom; `}
158 new system in "ObjC" `{ return UIButtonTypeSystem; `}
159 new detail_disclosure in "ObjC" `{ return UIButtonTypeDetailDisclosure; `}
160 new info_light in "ObjC" `{ return UIButtonTypeInfoLight; `}
161 new info_dark in "ObjC" `{ return UIButtonTypeInfoDark; `}
162 new contact_add in "ObjC" `{ return UIButtonTypeContactAdd; `}
163 new rounded_rect in "ObjC" `{ return UIButtonTypeRoundedRect; `}
164 end
165
166 # Read-only text view
167 extern class UILabel in "ObjC" `{ UILabel * `}
168 super UIView
169
170 new in "ObjC" `{ return [[UILabel alloc] init]; `}
171
172 # Wraps: `UILabel.text`
173 fun text: NSString in "ObjC" `{
174 return [self text];
175 `}
176
177 # Wraps: `UILabel.text`
178 fun text=(text: NSString) in "ObjC" `{
179 self.text = text;
180 `}
181
182 # Wraps: `UILabel.font`
183 #fun font: UIFont in "ObjC" `{
184 # return [self font];
185 #`}
186
187 # Wraps: `UILabel.textColor`
188 fun text_color: UIColor in "ObjC" `{
189 return [self textColor];
190 `}
191
192 # Wraps: `UILabel.textColor`
193 fun text_color=(color: UIColor) in "ObjC" `{
194 self.textColor = color;
195 `}
196
197 # Wraps: `UILabel.shadowColor`
198 fun shadow_color: UIColor in "ObjC" `{
199 return [self shadowColor];
200 `}
201
202 # Wraps: `UILabel.shadowOffset`
203 #fun shadow_offset: CGSize in "ObjC" `{
204 # return [self shadowOffset];
205 #`}
206
207 # Wraps: `UILabel.textAlignment`
208 #fun text_alignment: NSTextAlignment in "ObjC" `{
209 # return [self textAlignment];
210 #`}
211
212 # Wraps: `UILabel.lineBreakMode`
213 #fun line_break_mode: NSLineBreakMode in "ObjC" `{
214 # return [self lineBreakMode];
215 #`}
216
217 # Wraps: `UILabel.attributedText`
218 #fun attributed_text: NSAttributedString in "ObjC" `{
219 # return [self attributedText];
220 #`}
221
222 # Wraps: `UILabel.highlightedTextColor`
223 fun highlighted_text_color: UIColor in "ObjC" `{
224 return [self highlightedTextColor];
225 `}
226
227 # Wraps: `UILabel.highlighted`
228 #fun highlighted: Bool in "ObjC" `{
229 # return [self highlighted];
230 #`}
231
232 # Wraps: `UILabel.userInteractionEnabled`
233 #fun user_interaction_enabled: Bool in "ObjC" `{
234 # return [self userInteractionEnabled];
235 #`}
236
237 # Wraps: `UILabel.enabled`
238 #fun enabled: Bool in "ObjC" `{
239 # return [self enabled];
240 #`}
241
242 # Wraps: `UILabel.numberOfLines`
243 fun number_of_lines: Int in "ObjC" `{
244 return [self numberOfLines];
245 `}
246
247 # Wraps: `UILabel.adjustsFontSizeToFitWidth`
248 fun adjusts_font_size_to_fit_width: Bool in "ObjC" `{
249 return [self adjustsFontSizeToFitWidth];
250 `}
251
252 # Wraps: `UILabel.adjustsLetterSpacingToFitWidth`
253 # Depricated
254 #fun adjusts_letter_spacing_to_fit_width: Bool in "ObjC" `{
255 # return [self adjustsLetterSpacingToFitWidth];
256 #`}
257
258 # Wraps: `UILabel.minimumFontSize`
259 # Depricated
260 #fun minimum_font_size: Float in "ObjC" `{
261 # return [self minimumFontSize];
262 #`}
263
264 # Wraps: `UILabel.baselineAdjustment`
265 #fun baseline_adjustment: UIBaselineAdjustment in "ObjC" `{
266 # return [self baselineAdjustment];
267 #`}
268
269 # Wraps: `UILabel.minimumScaleFactor`
270 fun minimum_scale_factor: Float in "ObjC" `{
271 return [self minimumScaleFactor];
272 `}
273
274 # Wraps: `UILabel.preferredMaxLayoutWidth`
275 fun preferred_max_layout_width: Float in "ObjC" `{
276 return [self preferredMaxLayoutWidth];
277 `}
278
279 # Wraps: `[self textRectForBounds:(CGRect)bounds limitedToNumberOfLines:(NSInteger)numberOfLines]`
280 #fun text_rect_for_bounds_limited_to_number_of_lines(bounds: CGRect, number_of_lines: Int): CGRect in "ObjC" `{
281 # return [self textRectForBounds: bounds limitedToNumberOfLines: number_of_lines];
282 #`}
283
284 # Wraps: `[self drawTextInRect:(CGRect)rect]`
285 #fun draw_text_in_rect(rect: CGRect) in "ObjC" `{
286 # [self drawTextInRect: rect];
287 #`}
288 end
289
290 # Color data with opacity
291 extern class UIColor in "ObjC" `{ UIColor * `}
292 super NSObject
293
294 # Wraps: `[self initWithWhite:(CGFloat)white alpha:(CGFloat)alpha]`
295 new init_with_white_alpha(white, alpha: Float) in "ObjC" `{
296 return [[UIColor alloc] initWithWhite: white alpha: alpha];
297 `}
298
299 # Wraps: `[self initWithHue:(CGFloat)hue saturation:(CGFloat)saturation brightness:(CGFloat)brightness alpha:(CGFloat)alpha]`
300 new init_with_hue_saturation_brightness_alpha(hue, saturation, brightness, alpha: Float) in "ObjC" `{
301 return [[UIColor alloc] initWithHue: hue saturation: saturation brightness: brightness alpha: alpha];
302 `}
303
304 # Wraps: `[self initWithRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha]`
305 new init_with_red_green_blue_alpha(red, green, blue, alpha: Float) in "ObjC" `{
306 return [[UIColor alloc] initWithRed: red green: green blue: blue alpha: alpha];
307 `}
308
309 # Wraps: `[self initWithCGColor:(CGColorRef)cgColor]`
310 #new init_with_cg_color(cg_color: CGColorRef) in "ObjC" `{
311 # return [[UIColor alloc] initWithCGColor: cg_color];
312 #`}
313
314 # Wraps: `[self initWithPatternImage:(UIImage)image]`
315 #new init_with_pattern_image(image: UIImage) in "ObjC" `{
316 # return [[UIColor alloc] initWithPatternImage: image];
317 #`}
318
319 # Wraps: `[self initWithCIColor:(CIColor)ciColor]`
320 #new init_with_ci_color(ci_color: CIColor) in "ObjC" `{
321 # return [[UIColor alloc] initWithCIColor: ci_color];
322 #`}
323
324 # Wraps: `[UIColor blackColor]`
325 new black_color in "ObjC" `{ return [UIColor blackColor]; `}
326
327 # Wraps: `[UIColor darkGrayColor]`
328 new dark_gray_color in "ObjC" `{ return [UIColor darkGrayColor]; `}
329
330 # Wraps: `[UIColor lightGrayColor]`
331 new light_gray_color in "ObjC" `{ return [UIColor lightGrayColor]; `}
332
333 # Wraps: `[UIColor whiteColor]`
334 new white_color in "ObjC" `{ return [UIColor whiteColor]; `}
335
336 # Wraps: `[UIColor grayColor]`
337 new gray_color in "ObjC" `{ return [UIColor grayColor]; `}
338
339 # Wraps: `[UIColor redColor]`
340 new red_color in "ObjC" `{ return [UIColor redColor]; `}
341
342 # Wraps: `[UIColor greenColor]`
343 new green_color in "ObjC" `{ return [UIColor greenColor]; `}
344
345 # Wraps: `[UIColor blueColor]`
346 new blue_color in "ObjC" `{ return [UIColor blueColor]; `}
347
348 # Wraps: `[UIColor cyanColor]`
349 new cyan_color in "ObjC" `{ return [UIColor cyanColor]; `}
350
351 # Wraps: `[UIColor yellowColor]`
352 new yellow_color in "ObjC" `{ return [UIColor yellowColor]; `}
353
354 # Wraps: `[UIColor magentaColor]`
355 new magenta_color in "ObjC" `{ return [UIColor magentaColor]; `}
356
357 # Wraps: `[UIColor orangeColor]`
358 new orange_color in "ObjC" `{ return [UIColor orangeColor]; `}
359
360 # Wraps: `[UIColor purpleColor]`
361 new purple_color in "ObjC" `{ return [UIColor purpleColor]; `}
362
363 # Wraps: `[UIColor brownColor]`
364 new brown_color in "ObjC" `{ return [UIColor brownColor]; `}
365
366 # Wraps: `[UIColor clearColor]`
367 new clear_color in "ObjC" `{ return [UIColor clearColor]; `}
368
369 # Wraps: `UIColor.CGColor`
370 #fun cg_color: CGColorRef in "ObjC" `{
371 # return [self CGColor];
372 #`}
373
374 # Wraps: `UIColor.CIColor`
375 #fun ci_color: CIColor in "ObjC" `{
376 # return [self CIColor];
377 #`}
378
379 # Wraps: `[self set]`
380 fun set in "ObjC" `{ [self set]; `}
381
382 # Wraps: `[self setFill]`
383 fun set_fill in "ObjC" `{ [self setFill]; `}
384
385 # Wraps: `[self setStroke]`
386 fun set_stroke in "ObjC" `{ [self setStroke]; `}
387
388 # Wraps: `[self getWhite:(CGFloat)white alpha:(CGFloat)alpha]`
389 #fun get_white_alpha(white: Float, alpha: Float): Bool in "ObjC" `{
390 # return [self getWhite: white alpha: alpha];
391 #`}
392
393 # Wraps: `[self getHue:(CGFloat)hue saturation:(CGFloat)saturation brightness:(CGFloat)brightness alpha:(CGFloat)alpha]`
394 #fun get_hue_saturation_brightness_alpha(hue: Float, saturation: Float, brightness: Float, alpha: Float): Bool in "ObjC" `{
395 # return [self getHue: hue saturation: saturation brightness: brightness alpha: alpha];
396 #`}
397
398 # Wraps: `[self getRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha]`
399 #fun get_red_green_blue_alpha(red: Float, green: Float, blue: Float, alpha: Float): Bool in "ObjC" `{
400 # return [self getRed: red green: green blue: blue alpha: alpha];
401 #`}
402
403 # Wraps: `[self colorWithAlphaComponent:(CGFloat)alpha]`
404 fun color_with_alpha_component(alpha: Float): UIColor in "ObjC" `{
405 return [self colorWithAlphaComponent: alpha];
406 `}
407
408 # Wraps: `[self CGColor]`
409 #fun cg_color: CGColorRef in "ObjC" `{
410 # return [self CGColor];
411 #`}
412
413 # Wraps: `[UIColor groupTableViewBackgroundColor]`
414 new group_table_view_background_color in "ObjC" `{ return [UIColor groupTableViewBackgroundColor]; `}
415
416 # Wraps: `[UIColor lightTextColor]`
417 new light_text_color in "ObjC" `{ return [UIColor lightTextColor]; `}
418
419 # Wraps: `[UIColor darkTextColor]`
420 new dark_text_color in "ObjC" `{ return [UIColor darkTextColor]; `}
421 end
422
423 # Wraps: `[UIColor colorWithWhite:(CGFloat)white alpha:(CGFloat)alpha]`
424 #fun ui_color_color_with_white_alpha(white: Float, alpha: Float): UIColor in "ObjC" `{
425 # return [UIColor colorWithWhite: white alpha: alpha];
426 #`}
427
428 # Wraps: `[UIColor colorWithHue:(CGFloat)hue saturation:(CGFloat)saturation brightness:(CGFloat)brightness alpha:(CGFloat)alpha]`
429 #fun ui_color_color_with_hue_saturation_brightness_alpha(hue: Float, saturation: Float, brightness: Float, alpha: Float): UIColor in "ObjC" `{
430 # return [UIColor colorWithHue: hue saturation: saturation brightness: brightness alpha: alpha];
431 #`}
432
433 # Wraps: `[UIColor colorWithRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha]`
434 #fun ui_color_color_with_red_green_blue_alpha(red: Float, green: Float, blue: Float, alpha: Float): UIColor in "ObjC" `{
435 # return [UIColor colorWithRed: red green: green blue: blue alpha: alpha];
436 #`}
437
438 # Wraps: `[UIColor colorWithCGColor:(CGColorRef)cgColor]`
439 #fun ui_color_color_with_cg_color(cg_color: CGColorRef): UIColor in "ObjC" `{
440 # return [UIColor colorWithCGColor: cg_color];
441 #`}
442
443 # Wraps: `[UIColor colorWithPatternImage:(UIImage)image]`
444 #fun ui_color_color_with_pattern_image(image: UIImage): UIColor in "ObjC" `{
445 # return [UIColor colorWithPatternImage: image];
446 #`}
447
448 # Wraps: `[UIColor colorWithCIColor:(CIColor)ciColor]`
449 #fun ui_color_color_with_ci_color(ci_color: CIColor): UIColor in "ObjC" `{
450 # return [UIColor colorWithCIColor: ci_color];
451 #`}
452
453 # Editable text view
454 extern class UITextField in "ObjC" `{ UITextField * `}
455 super UIControl
456
457 new in "ObjC" `{ return [[UITextField alloc] init]; `}
458
459 # Wraps: `UITextField.text`
460 fun text: NSString in "ObjC" `{
461 return [self text];
462 `}
463
464 # Wraps: `UITextField.text`
465 fun text=(text: NSString) in "ObjC" `{
466 self.text = text;
467 `}
468
469 # Wraps: `UITextField.secureTextEntry`
470 fun secure_text_entry=(value: Bool) in "ObjC" `{
471 self.secureTextEntry = value;
472 `}
473
474 # Wraps: `UITextField.placeholder`
475 fun placeholder=(text: NSString) in "ObjC" `{ self.placeholder = text; `}
476 end
477
478 # Lays out a collection of views in either a column or a row
479 extern class UIStackView in "ObjC" `{ UIStackView * `}
480 super UIView
481
482 new in "ObjC" `{
483 return [[UIStackView alloc] init];
484 `}
485
486 # Wraps: `[self addArrangedSubview:(UIView)view]`
487 fun add_arranged_subview(view: UIView) in "ObjC" `{
488 [self addArrangedSubview: view];
489 `}
490
491 # Wraps: `[self removeArrangedSubview:(UIView)view]`
492 fun remove_arranged_subview(view: UIView) in "ObjC" `{
493 [self removeArrangedSubview: view];
494 `}
495
496 # Wraps: `[self insertArrangedSubview:(UIView)view atIndex:(NSUInteger)stackIndex]`
497 fun insert_arranged_subview_at_index(view: UIView, stack_index: Int) in "ObjC" `{
498 [self insertArrangedSubview: view atIndex: stack_index];
499 `}
500
501 # Wraps: `[self initWithArrangedSubviews:(NSArray)views]`
502 #new init_with_arranged_subviews(views: NSArray) in "ObjC" `{
503 # return [[UIStackView alloc] initWithArrangedSubviews: views];
504 #`}
505
506 # Wraps: `UIStackView.arrangedSubviews`
507 #fun arranged_subviews: NSArray in "ObjC" `{
508 # return [self arrangedSubviews];
509 #`}
510
511 # Wraps: `UIStackView.axis`
512 fun axis: UILayoutConstraintAxis in "ObjC" `{ return [self axis]; `}
513
514 # Wraps: `UIStackView.axis =`
515 fun axis=(value: UILayoutConstraintAxis) in "ObjC" `{ self.axis = value; `}
516
517 # Wraps: `UIStackView.distribution`
518 fun distribution: UIStackViewDistribution in "ObjC" `{ return [self distribution]; `}
519
520 # Wraps: `UIStackView.distribution =`
521 fun distribution=(value: UIStackViewDistribution) in "ObjC" `{ self.distribution = value; `}
522
523 # Wraps: `UIStackView.alignment`
524 fun alignment: UIStackViewAlignment in "ObjC" `{ return [self alignment]; `}
525
526 # Wraps: `UIStackView.alignment =`
527 fun alignment=(value: UIStackViewAlignment) in "ObjC" `{ self.alignment = value; `}
528
529 # Wraps: `UIStackView.spacing`
530 fun spacing: Float in "ObjC" `{ return [self spacing]; `}
531
532 # Wraps: `UIStackView.spacing =`
533 fun spacing=(value: Float) in "ObjC" `{ self.spacing = value; `}
534
535 # Wraps: `UIStackView.baselineRelativeArrangement`
536 fun baseline_relative_arrangement: Bool in "ObjC" `{
537 return self.baselineRelativeArrangement;
538 `}
539
540 # Wraps: `UIStackView.baselineRelativeArrangement`
541 fun baseline_relative_arrangement=(value: Bool) in "ObjC" `{
542 self.baselineRelativeArrangement = value;
543 `}
544
545 # Wraps: `UIStackView.layoutMarginsRelativeArrangement`
546 fun layout_margins_relative_arrangement: Bool in "ObjC" `{
547 return self.layoutMarginsRelativeArrangement;
548 `}
549
550 # Wraps: `UIStackView.layoutMarginsRelativeArrangement`
551 fun layout_margins_relative_arrangement=(value: Bool) in "ObjC" `{
552 self.layoutMarginsRelativeArrangement = value;
553 `}
554 end
555
556 # Defines the orientation of the arranged views in `UIStackView`
557 extern class UILayoutConstraintAxis in "ObjC" `{ NSInteger `}
558 new horizontal in "ObjC" `{ return UILayoutConstraintAxisHorizontal; `}
559 new vertical in "ObjC" `{ return UILayoutConstraintAxisVertical; `}
560 end
561
562 # Defines the size and position of the arranged views along the `UIStackView`'s axis
563 extern class UIStackViewDistribution in "ObjC" `{ NSInteger `}
564 new horizontal in "ObjC" `{ return UILayoutConstraintAxisHorizontal; `}
565 new fill in "ObjC" `{ return UIStackViewDistributionFill; `}
566 new fill_equally in "ObjC" `{ return UIStackViewDistributionFillEqually; `}
567 new fill_proportionally in "ObjC" `{ return UIStackViewDistributionFillProportionally; `}
568 new equal_spacing in "ObjC" `{ return UIStackViewDistributionEqualSpacing; `}
569 new equal_centering in "ObjC" `{ return UIStackViewDistributionEqualCentering; `}
570 end
571
572 # Defines the layout of the arranged views perpendicular to the `UIStackView`'s axis
573 extern class UIStackViewAlignment in "ObjC" `{ NSInteger `}
574 new fill in "ObjC" `{ return UIStackViewAlignmentFill; `}
575 new leading in "ObjC" `{ return UIStackViewAlignmentLeading; `}
576 new top in "ObjC" `{ return UIStackViewAlignmentTop; `}
577 new baseline in "ObjC" `{ return UIStackViewAlignmentFirstBaseline; `}
578 new center in "ObjC" `{ return UIStackViewAlignmentCenter; `}
579 new trailing in "ObjC" `{ return UIStackViewAlignmentTrailing; `}
580 new bottom in "ObjC" `{ return UIStackViewAlignmentBottom; `}
581 new last_baseline in "ObjC" `{ return UIStackViewAlignmentLastBaseline; `}
582 end
583
584 # View to display and edit hierarchical lists of information
585 extern class UITableView in "ObjC" `{ UITableView * `}
586 super UIView
587
588 # Wraps: `[self initWithFrame:(CGRect)frame style:(UITableViewStyle)style]`
589 new (style: UITableViewStyle) in "ObjC" `{
590 return [[UITableView alloc] initWithFrame: [[UIScreen mainScreen] bounds] style:style];
591 `}
592
593 # Wraps: `[self reloadData]`
594 fun reload_data in "ObjC" `{ [self reloadData]; `}
595
596 # Wraps: `self.autoresizingMask =`
597 fun autoresizing_mask in "ObjC" `{
598 self.autoresizingMask = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth;
599 `}
600
601 # Wraps: `self.delegate =`
602 fun delegate=(delegate: UITableViewDelegate) in "ObjC" `{ self.delegate = delegate; `}
603
604 # Wraps: `self.dataSource =`
605 fun data_source=(source: UITableViewDataSource) in "ObjC" `{ self.dataSource = source; `}
606
607 # Wraps: `[self dequeueReusableCellWithIdentifier]`
608 fun dequeue_reusable_cell_with_identifier(identifier: NSString): UITableViewCell in "ObjC" `{
609 return [self dequeueReusableCellWithIdentifier:identifier];
610 `}
611 end
612
613 # Delegate for a `UITableView` to configure selection, sections, cells and more
614 extern class UITableViewDelegate in "ObjC" `{ id<UITableViewDelegate> `}
615 super NSObject
616 end
617
618 # Mediator the data model for a `UITableView`
619 extern class UITableViewDataSource in "ObjC" `{ id<UITableViewDataSource> `}
620 super NSObject
621 end
622
623 # Cell of a `UITableViewCell`
624 extern class UITableViewCell in "ObjC" `{ UITableViewCell * `}
625 super NSObject
626
627 new (identifier: NSString) in "ObjC" `{
628 return [[UITableViewCell alloc]
629 initWithStyle:UITableViewCellStyleDefault
630 reuseIdentifier:identifier];
631 `}
632
633 # Wraps: `[self textLabel]`
634 fun text_label: UILabel in "ObjC" `{ return [self textLabel]; `}
635
636 # Wraps: `[self contentView]`
637 fun content_view: UIView in "ObjC" `{ return [self contentView]; `}
638 end
639
640 # Style of a `UITableView`
641 extern class UITableViewStyle in "ObjC" `{ UITableViewStyle* `}
642 super NSObject
643
644 new plain in "ObjC" `{ return UITableViewStylePlain; `}
645 new grouped in "ObjC" `{ return UITableViewStyleGrouped; `}
646 end
647
648 # On/Off button
649 extern class UISwitch in "ObjC" `{ UISwitch * `}
650 super UIView
651
652 new in "ObjC" `{ return [[UISwitch alloc] init]; `}
653
654 # Wraps: `UISwitch.onTintColor`
655 # fun on_tint_color: UIColor in "ObjC" `{
656 # return [self onTintColor];
657 # `}
658
659 # Wraps: `UISwitch.tintColor`
660 # fun tint_color: UIColor in "ObjC" `{
661 # return [self tintColor];
662 # `}
663
664 # Wraps: `UISwitch.thumbTintColor`
665 # fun thumb_tint_color: UIColor in "ObjC" `{
666 # return [self thumbTintColor];
667 # `}
668
669 # Wraps: `UISwitch.onImage`
670 # fun on_image: UIImage in "ObjC" `{
671 # return [self onImage];
672 # `}
673
674 # Wraps: `UISwitch.offImage`
675 # fun off_image: UIImage in "ObjC" `{
676 # return [self offImage];
677 # `}
678
679 # Wraps: `UISwitch.on`
680 fun on: Bool in "ObjC" `{
681 return self.on;
682 `}
683
684 # Wraps: `[self setOn:(BOOL)on animated:(BOOL)animated]`
685 fun set_on_animated(on: Bool, animated: Bool) in "ObjC" `{
686 [self setOn: on animated: animated];
687 `}
688 end
689
690 # Support for displaying content larger than the window
691 extern class UIScrollView in "ObjC" `{ UIScrollView* `}
692 super UIView
693
694 new in "ObjC" `{ return [[UIScrollView alloc] init]; `}
695 end