ios :: AppDelegate
ios :: AppDelegate :: defaultinit
ios :: AppDelegate :: window
The main application window, must be set byApp::on_create
ios :: AppDelegate :: window=
The main application window, must be set byApp::on_create
ios $ AppDelegate :: SELF
Type of this instance, automatically specialized in every classcore :: Pointer :: address_is_null
Is the address behind this Object at NULL?core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
core :: Pointer :: defaultinit
ios :: AppDelegate :: defaultinit
core :: Object :: defaultinit
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
core :: Object :: output_class_name
Display class name on stdout (debug only).ios :: AppDelegate :: window
The main application window, must be set byApp::on_create
ios :: AppDelegate :: window=
The main application window, must be set byApp::on_create
# Application interface to the iOS system
extern class AppDelegate in "ObjC" `{ AppDelegate * `}
end
lib/ios/app.nit:83,1--85,3
redef class AppDelegate
# Print and show "Hello World!"
private fun hello_world: Bool in "ObjC" `{
// Print to the console
NSLog(@"Hello World!");
// Display "Hello world!" on the screen
CGRect frame = [[UIScreen mainScreen] bounds];
self.window = [[UIWindow alloc] initWithFrame: frame];
self.window.backgroundColor = [UIColor whiteColor];
UILabel *label = [[UILabel alloc] init];
label.text = @"Hello World!";
label.center = CGPointMake(100, 100);
[label sizeToFit];
// As with `self.window` we must set a `rootViewController`
self.window.rootViewController = [[UIViewController alloc]initWithNibName:nil bundle:nil];
self.window.rootViewController.view = label;
[self.window addSubview: label];
[self.window makeKeyAndVisible];
return YES;
`}
end
lib/ios/examples/hello_ios.nit:32,1--59,3
redef class AppDelegate
# The main application window, must be set by `App::on_create`
fun window: UIWindow in "ObjC" `{ return [self window]; `}
# The main application window, must be set by `App::on_create`
fun window=(window: UIWindow) in "ObjC" `{ self.window = window; `}
end
lib/ios/ui/ui.nit:159,1--166,3