app.dhover×64 error×6all
// Minimal iOS/UIKit window — the UIKit object graph a real app builds: a `UIWindow`
// sized to the screen, a root `UIViewController`, then `makeKeyAndVisible`. Bound
// through D's built-in `extern(Objective-C)` + `@selector` (same mechanism the
// objective-d package wraps). See ../index.md (the iOS/UIKit OS-API survey).
//
// > [!IMPORTANT] A real iOS app is launched by `UIApplicationMain`, which
// > instantiates an **app-delegate Objective-C class**. D's interop can *call*
// > Objective-C but cannot *define* new Objective-C classes, so a pure-D UIKit app
// > can't supply the delegate — the delegate is normally written in Objective-C or
// > Swift and calls into D. This file therefore demonstrates the UIKit bindings and
// > the window/VC construction; it is **cross-compiled for the iOS Simulator** for
// > verification (`ldc2 -mtriple=arm64-apple-ios<ver>-simulator`). A full Simulator
// > run (app bundle + `simctl`) is documented in the survey as a manual step.
module 
(module) app
app
;
import
(package) core
core
.
(module) core.attribute

This module contains UDA's (User Defined Attributes) either used in the runtime or special UDA's recognized by compiler.

Attribute Name, Linkage, Description

gnuAbiTag, C++, Declares an ABI tag on a C++ symbol. mustuse,, Ensures that values of a struct or union type are not discarded. optional, Objective-C, Makes an Objective-C interface method optional. selector, Objective-C, Attaches an Objective-C selector to a method. standalone,, Marks a shared module constructor as not depending on any other module constructor being run first. weak,, Specifies that a global symbol should be emitted with weak linkage.

Source

core/attribute.d

@copyrightCopyright Jacob Carlborg 2015.@licenseBoost License 1.0@authorsJacob Carlborg
attribute
: selector;
module `core.attribute` import `selector` not found
import
(package) core
core
.
(package) core.stdc
stdc
.
(module) core.stdc.stdio

D header file for C99 <stdio.h>

pubs.opengroup.org/onlinepubs/009695399/basedefs/stdio.h.html, stdio.h

Source

core/stdc/stdio.d

@copyrightCopyright Sean Kelly 2005 - 2009.@licenseDistributed under the Boost Software License 1.0. (See accompanying file LICENSE)@authorsSean Kelly, Alex Rønne Petersen@standardsISO/IEC 9899:1999 (E)
stdio
:
(alias) app.printf = int core.stdc.stdio.printf(scope const(char*) format, scope const ...) nothrow @nogc
printf
;
// Core Graphics geometry (CGFloat == double on 64-bit arm). extern (C) struct
(struct) app.CGPoint
CGPoint
{ double
(field) double app.CGPoint.x
x
,
(field) double app.CGPoint.y
y
;
} extern (C) struct
(struct) app.CGSize
CGSize
{ double
(field) double app.CGSize.width
width
,
(field) double app.CGSize.height
height
;
} extern (C) struct
(struct) app.CGRect
CGRect
{
(struct) app.CGPoint
CGPoint
(field) app.CGPoint app.CGRect.origin
origin
;
(struct) app.CGSize
CGSize
(field) app.CGSize app.CGRect.size
size
;
} extern (Objective-C): extern class
(class) app.NSObject
NSObject
class `app.NSObject` Objective-C classes not supported
{ } extern class
(class) app.UIResponder
UIResponder
:
(class) app.NSObject
NSObject
class `app.UIResponder` Objective-C classes not supported
{ } extern class
(class) app.UIScreen
UIScreen
:
(class) app.NSObject
NSObject
class `app.UIScreen` Objective-C classes not supported
{ static
(class) app.UIScreen
UIScreen
app.UIScreen app.UIScreen.mainScreen()
mainScreen
() @selector("mainScreen");
(struct) app.CGRect
CGRect
app.CGRect app.UIScreen.bounds()
bounds
() @selector("bounds");
} extern class
(class) app.UIViewController
UIViewController
:
(class) app.UIResponder
UIResponder
class `app.UIViewController` Objective-C classes not supported
{ static
(class) app.UIViewController
UIViewController
app.UIViewController app.UIViewController.alloc()
alloc
() @selector("alloc");
(class) app.UIViewController
UIViewController
app.UIViewController app.UIViewController.init()
init
() @selector("init");
} extern class
(class) app.UIWindow
UIWindow
:
(class) app.UIResponder
UIResponder
class `app.UIWindow` Objective-C classes not supported
{ static
(class) app.UIWindow
UIWindow
app.UIWindow app.UIWindow.alloc()
alloc
() @selector("alloc");
(class) app.UIWindow
UIWindow
app.UIWindow app.UIWindow.initWithFrame(app.CGRect frame)
initWithFrame
(
(struct) app.CGRect
CGRect
(parameter) app.CGRect frame
frame
) @selector("initWithFrame:");
void
void app.UIWindow.setRootViewController(app.UIViewController vc)
setRootViewController
(
(class) app.UIViewController
UIViewController
(parameter) app.UIViewController vc
vc
) @selector("setRootViewController:");
void
void app.UIWindow.makeKeyAndVisible()
makeKeyAndVisible
() @selector("makeKeyAndVisible");
} extern (D): // back to D linkage int
int D main()
main
()
{ // Build the minimal UIKit window/VC graph. On the Simulator this is driven from // an Objective-C app delegate (see the note above); here it exercises the // bindings and is cross-compiled for the iOS Simulator target.
(unresolved type) CGRect
CGRect
_error_ bounds
bounds
= UIScreen.
UIScreen.mainScreen
mainScreen
().
UIScreen.mainScreen().bounds
bounds
();
(unresolved type) UIWindow
UIWindow
_error_ win
win
= UIWindow.
UIWindow.alloc
alloc
().
UIWindow.alloc().initWithFrame
initWithFrame
(bounds);
(unresolved type) UIViewController
UIViewController
_error_ root
root
= UIViewController.
UIViewController.alloc
alloc
().
UIViewController.alloc().init
init
();
win.
win.setRootViewController
setRootViewController
(root);
win.
win.makeKeyAndVisible
makeKeyAndVisible
();
printf("ok: built a UIWindow + root UIViewController (%.0fx%.0f)\n", bounds.
bounds.size
size
.
bounds.size.width
width
, bounds.
bounds.size
size
.
bounds.size.height
height
);
return 0; }