SCNMaterial
Extends:
Implements:
A set of shading attributes that define the appearance of a geometry's surface when rendered.
Static Member Summary
Static Public Members | ||
public static get |
|
Constructor Summary
Public Constructor | ||
public |
constructor(mdlMaterial: MDLMaterial) The Model I/O framework provides universal support for import, export, description, and processing of several 3D asset file formats and related resources. |
Member Summary
Public Members | ||
public get |
Ambient shading describes the amount and color of ambient light reflected by the material. |
|
public get |
Use this property to assign an ambient occlusion texture map to a surface. |
|
public get |
This array contains all keys for which animations are attached to the object, or is empty if there are no attached animations. |
|
public |
The mode that determines how pixel colors rendered using this material blend with other pixel colors in the rendering target. |
|
public |
|
|
public |
The mode determining which faces of a surface SceneKit renders. |
|
public get |
|
|
public get |
Diffuse shading describes the amount and color of light reflected equally in all directions from each point on the material’s surface. |
|
public get |
|
|
public get |
You can use an emissive map texture to simulate parts of a surface that glow with their own light. |
|
public |
|
|
public |
A factor affecting the material’s reflectivity. |
|
public |
A Boolean value that determines whether SceneKit should render both front and back faces of a surface. |
|
public |
A Boolean value that determines whether SceneKit performs lighting calculations per vertex or per pixel. |
|
public |
The lighting formula that SceneKit uses to render the material. |
|
public |
A Boolean value that determines whether the material responds identically to both ambient and diffuse lighting. |
|
public get |
This property measures only the total intensity of color values; texture contents are best defined in grayscale.This property generally approximates aspects of a physical surface—such as index of refraction, tendency to produce sharp reflections, and tendency to produce Fresnel reflections at grazing angles—that together produce an overall metallic or nonmetallic (also called dielectric) appearance. |
|
public get |
After combining a material’s other visual properties with lighting and other information about a scene, Scene kit multiplies the color of each rendered pixel by the color this property provides. |
|
public |
A name associated with the material. |
|
public get |
Simulating the interaction of lights with a material requires information about the orientation of the surface at each point. |
|
public |
A program used when rendering the object. |
|
public |
A Boolean value that determines whether SceneKit uses depth information when rendering the material. |
|
public get |
You can simulate a mirrored or chromed finish on a surface by causing it to reflect its environment. |
|
public get |
This property measures only the total intensity of color values; texture contents are best defined in grayscale.This property approximates the level of microscopic detail—for example tiny bumps and cracks—in a surface. |
|
public get |
Self-illumination applies to all materials, but is especially useful for those using physically-based shading (see physicallyBased). |
|
public |
A dictionary of GLSL source code snippets for customizing the shader programs provided by SceneKit. |
|
public |
The sharpness of specular highlights. |
|
public get |
Specular shading describes the amount and color of light reflected by the material directly toward the viewer, forming a bright highlight on the surface and simulating a glossy or shiny appearance. |
|
public |
The uniform transparency of the material. |
|
public |
The mode SceneKit uses to calculate transparency for the material. |
|
public get |
Use this property to selectively make parts of a material appear transparent. |
|
public |
A Boolean value that determines whether SceneKit produces depth information when rendering the material. |
Method Summary
Public Methods | ||
public |
addAnimationForKey(animation: CAAnimation, key: string): void Newly added animations begin executing after the current run loop cycle ends.SceneKit does not define any requirements for the contents of the key parameter—it need only be unique among the keys for other animations you add. |
|
public |
animationForKey(key: string): CAAnimation Attempting to modify any properties of the returned object results in undefined behavior. |
|
public |
handleBindingOfSymbolHandler(symbol: string, block: SCNBindingBlock): void Use this method to associate a block with a SceneKit object (geometry or material) to handle setup of an attribute or uniform variable in a custom SCNProgram shader associated with that object. |
|
public |
handleUnbindingOfSymbolHandler(symbol: string, block: SCNBindingBlock): void Use this method to associate a block with a SceneKit object (geometry or material) to handle cleanup related to an attribute or uniform variable in a custom SCNProgram shader associated with that object. |
|
public |
isAnimationPausedForKey(key: string): boolean Required. |
|
public |
pauseAnimationForKey(key: string): void This method has no effect if no animation is attached to the object with the specified key. |
|
public |
removeAllAnimations(): void Required. |
|
public |
removeAnimationForKey(key: string): void Required. |
|
public |
removeAnimationForKeyFadeOutDuration(key: string, duration: number): void Use this method to create smooth transitions between the effects of multiple animations. |
|
public |
resumeAnimationForKey(key: string): void This method has no effect if no animation is attached to the object with the specified key or if the specified animation is not currently paused. |
|
public |
setAnimationSpeedForKey(speed: number, key: string): void Required. |
|
public |
setValueForUndefinedKey(value: Object, key: string): void Subclasses can override this method to handle the request in some other way. |
|
public |
valueForUndefinedKey(key: string): Object Subclasses can override this method to return an alternate value for undefined keys. |
Inherited Summary
From class NSObject | ||
public static get |
The default returns true. |
|
public static get |
|
|
public static get |
|
|
public static |
The default implementation returns true. |
|
public static |
cancelPreviousPerformRequestsWithTarget(aTarget: Object): void All perform requests having the same target aTarget are canceled. |
|
public static |
cancelPreviousPerformRequestsWithTargetSelectorObject(aTarget: Object, aSelector: function, anArgument: Object): void All perform requests are canceled that have the same target as aTarget, argument as anArgument, and selector as aSelector. |
|
public static |
NSKeyedArchiver calls this method and stores the result inside the archive. |
|
public static |
During keyed unarchiving, instances of the receiver will be decoded as members of the returned class. |
|
public static |
conformsTo(protocol: Object): boolean A class is said to “conform to” a protocol if it adopts the protocol or inherits from another class that adopts it. |
|
public static |
|
|
public static |
defaultPlaceholderForMarkerWithBinding(marker: Object, binding: string): Object The marker can be nil or one of the constants described in Selection Markers. |
|
public static |
The debugger’s print-object command invokes this method to produce a textual description of an object.NSObject's implementation of this method simply prints the name of the class. |
|
public static |
exposeBinding(binding: string): void The bound property will be accessed using key-value-coding compliant methods. |
|
public static |
|
|
public static |
initWithCoder(coder: *): * |
|
public static |
initialize(): void The runtime sends initialize() to each class in a program just before the class, or any class that inherits from it, is sent its first message from within the program. |
|
public static |
instanceMethodFor(aSelector: function): function An error is generated if instances of the receiver can’t respond to aSelector messages.Use this method to ask the class object for the implementation of instance methods only. |
|
public static |
instancesRespondTo(aSelector: function): boolean If aSelector messages are forwarded to other objects, instances of the class are able to receive those messages without error even though this method returns false.To ask the class whether it, rather than its instances, can respond to a particular message, send to the class instead the NSObject protocol instance method responds(to:). |
|
public static |
isKeyExcludedFromWebScript(name: UnsafePointer<Int8>): boolean The default value is true. |
|
public static |
isSelectorExcludedFromWebScript(selector: function): boolean Only methods with valid parameters and return types are exported to the WebKit JavaScript environment. |
|
public static |
isSubclassOf(aClass: Object): boolean Returns a Boolean value that indicates whether the receiving class is a subclass of, or identical to, a given class. |
|
public static |
When an observer for the key is registered with an instance of the receiving class, key-value observing itself automatically observes all of the key paths for the same instance, and sends change notifications for the key to the observer when the value for any of those key paths changes.The default implementation of this method searches the receiving class for a method whose name matches the pattern +keyPathsForValuesAffecting<Key>, and returns the result of invoking that method if it is found. |
|
public static |
load(): void The load() message is sent to classes and categories that are both dynamically loaded and statically linked, but only if the newly loaded class or category implements a method that can respond.The order of initialization is as follows:All initializers in any framework you link to.All +load methods in your image.All C++ static initializers and C/C++ attribute(constructor) functions in your image.All initializers in frameworks that link to you.In addition:A class’s +load method is called after all of its superclasses’ +load methods.A category +load method is called after the class’s own +load method.In a custom implementation of load() you can therefore safely message other unrelated classes from the same image, but any load() methods implemented by those classes may not have run yet.ImportantCustom implementations of the load method for Swift classes bridged to Objective-C are not called automatically. |
|
public static |
resolveClassMethod(sel: function): boolean This method allows you to dynamically provide an implementation for a given selector. |
|
public static |
resolveInstanceMethod(sel: function): boolean This method and resolveClassMethod(_:) allow you to dynamically provide an implementation for a given selector.An Objective-C method is simply a C function that take at least two arguments—self and _cmd. |
|
public static |
setDefaultPlaceholderForMarkerWithBinding(placeholder: Object, marker: Object, binding: string): void The marker can be nil or one of the constants described in Selection Markers. |
|
public static |
setVersion(aVersion: number): void The version number is helpful when instances of the class are to be archived and reused later. |
|
public static |
superclass(): Object Returns the class object for the receiver’s superclass. |
|
public static |
If no version has been set, the default is 0. |
|
public static |
webScriptNameFor(selector: function): string It is your responsibility to ensure that the returned name is unique to the script invoking this method. |
|
public static |
webScriptNameForKey(name: UnsafePointer<Int8>): string Returns the scripting environment name for an attribute specified by a key. |
|
public get |
You can assume that the search for the focus has already been narrowed down to the accessibility element. |
|
public get |
In macOS 10.9 and later, a custom accessibility object that is an NSObject subclass can post accessibility notifications if it meets the following criteria:The lifetime of the custom accessibility object must match the lifetime of the corresponding element in the app's UI.Typically, a custom accessibility object that acts as a proxy for an onscreen UI element gets autoreleased and deallocated immediately after the app responds to an accessibility request. Such an object can’t post accessibility notifications, because all registered observers get removed as soon as the object is deallocated. To correct this, an app must guarantee that a custom accessibility object remains allocated for as long as its corresponding UI element remains visible.The object must post the NSAccessibilityUIElementDestroyedNotification notification at the appropriate time. The appropriate time is most likely to be when the corresponding UI element is removed from the screen, but it can also be when the object itself is deallocated. The object must implement accessibilityNotifiesWhenDestroyed and return true. |
|
public get |
NSObject’s implementation of attributeKeys simply calls [[self classDescription] attributeKeys]. |
|
public get |
This property returns a proxy for the receiving object if the receiver adopts the NSDiscardableContent protocol and still has content that has not been discarded.The proxy calls beginContentAccess() on the receiver to keep the content available as long as the proxy lives, and calls endContentAccess() when the proxy is deallocated.The wrapper object is otherwise a subclass of NSProxy and forwards messages to the original receiver object as an NSProxy does.This method can be used to hide an NSDiscardableContent object's content volatility by creating an object that responds to the same messages but holds the contents of the original receiver available as long as the created proxy lives. Thus hidden, the NSDiscardableContent object (by way of the proxy) can be given out to unsuspecting recipients of the object who would otherwise not know they might have to call beginContentAccess() and endContentAccess() around particular usages (specific to each NSDiscardableContent object) of the NSDiscardableContent object. |
|
public get |
This property is used by Cocoa’s scripting support classes. |
|
public get |
classDescription: NSClassDescription |
|
public get |
|
|
public get |
This method is invoked by NSCoder. |
|
public get |
The object will be encoded as if it were a member of the class. |
|
public get |
|
|
public get |
A subclass can override this method to remove bindings that are exposed by a superclass that are not appropriate for the subclass. |
|
public get |
|
|
public get |
|
|
public get |
The methods of the object are exposed to the script environment. |
|
public get |
objectSpecifier: NSScriptObjectSpecifier |
|
public get |
|
|
public get |
|
|
public get |
webFrame: WebFrame Only implemented by containers that are based on the WebKit’s plug-in architecture. |
|
public get |
webPlugInContainerSelectionColor: CGColor The color should be used for any special drawing when the plug-in is selected. |
|
public |
[key]: * |
|
public |
The activation point for the accessibility element, in screen coordinates. |
|
public |
accessibilityCustomActions: UIAccessibilityCustomAction[] An array of custom actions to display along with the built-in actions. |
|
public |
accessibilityCustomRotors: UIAccessibilityCustomRotor[] |
|
public |
An array of the accessibility elements in the container. |
|
public |
A Boolean value indicating whether the accessibility elements contained within this accessibility element are hidden. |
|
public |
The frame of the accessibility element, in screen coordinates. |
|
public |
|
|
public |
A brief description of the result of performing an action on the accessibility element, in a localized string. |
|
public |
A succinct label that identifies the accessibility element, in a localized string. |
|
public |
The language in which to speak the accessibility element's label, value, and hint. |
|
public |
accessibilityNavigationStyle: UIAccessibilityNavigationStyle The navigation style to apply to the object and its elements. |
|
public |
accessibilityPath: UIBezierPath The path of the element, in screen coordinates. |
|
public |
accessibilityTraits: UIAccessibilityTraits The combination of accessibility traits that best characterize the accessibility element. |
|
public |
The value of the accessibility element, in a localized string. |
|
public |
A Boolean value indicating whether VoiceOver should ignore the elements within views that are siblings of the receiver. |
|
public |
A Boolean value indicating whether the receiver is an accessibility element that an assistive application can access. |
|
public |
Returns a pointer that identifies information about all of the observers that are registered with the observed object. |
|
public |
An NSString-keyed dictionary of the receiver's scriptable properties. |
|
public |
A Boolean value indicating whether VoiceOver should group together the elements that are children of the receiver, regardless of their positions on the screen. |
|
public |
acceptsPreviewPanelControl(panel: QLPreviewPanel): boolean |
|
public |
accessibilityActionDescription(action: string): string this method was deprecated.
User interface classes must implement this method to return descriptions for all actions returned from accessibilityActionNames(). |
|
public |
this method was deprecated.
User interface classes must implement this method. |
|
public |
You can use this method to make complex controls more readily accessible to users. |
|
public |
accessibilityArrayAttributeCount(attribute: string): number If attribute is not an array, an exception is raised. |
|
public |
accessibilityArrayAttributeValues(attribute: string, index: number, maxCount: number): Object[] Note that this method does not take a range. |
|
public |
|
|
public |
this method was deprecated.
User interface classes must implement this method. |
|
public |
accessibilityAttributeValue(attribute: string): Object this method was deprecated.
User interface classes must implement this method. |
|
public |
accessibilityAttributeValueForParameter(attribute: string, parameter: Object): Object this method was deprecated.
If you implement this method, also implement accessibilityParameterizedAttributeNames(). |
|
public |
accessibilityDecrement(): void If your element has the UIAccessibilityTraitAdjustable trait, you must implement this method. |
|
public |
accessibilityElementAt(index: number): Object Returns the accessibility element at the specified index. |
|
public |
Returns the number of accessibility elements in the container. |
|
public |
Override accessibilityElementDidBecomeFocused if you need to know when an assistive technology has set its virtual focus on an accessibility element. |
|
public |
accessibilityElementDidLoseFocus(): void Override accessibilityElementDidLoseFocus if you need to know when an assistive technology has removed its virtual focus from an accessibility element. |
|
public |
Returns a Boolean value indicating whether an assistive technology is focused on the accessibility element. |
|
public |
accessibilityHitTest(point: CGPoint): Object You can assume that the specified point has already been determined to lie within the accessibility element's frame. Override this method to do deeper hit-testing by identifying which child element, if any, contains the point. NSMatrix, for example, identifies which of its cells contains the point and propagates the hit-test to it. If the specified point is not contained within one of the accessibility element's children, either return self or, if available, invoke the superclass's implementation. The default NSView and NSCell implementations test whether the accessibility element is an ignored element and, if it is, return the receiver's first unignored parent; otherwise they return self. |
|
public |
accessibilityIncrement(): void If your element has the UIAccessibilityTraitAdjustable trait, you must implement this method. |
|
public |
accessibilityIndexOfChild(child: Object): number Returns the index of the specified accessibility child in the parent. |
|
public |
accessibilityIsAttributeSettable(attribute: string): boolean this method was deprecated.
User interface classes must implement this method. |
|
public |
this method was deprecated.
When asking for an object's children, do not include ignored children; instead, replace the ignored children with their own unignored children. The same applies when asking for an object's parent: skip the ignored parent and treat the first unignored ancestor as the real parent. |
|
public |
this method was deprecated.
If you implement this method, also implement accessibilityAttributeValue(_:forParameter:). |
|
public |
accessibilityPerformAction(action: string): void this method was deprecated.
User interface classes must implement this method to handle all the actions returned from accessibilityActionNames(). |
|
public |
Implement this method on an element or containing view that can be revealed modally or in a hierarchy. |
|
public |
The exact action performed by this method depends your app, typically toggling the most important state of the app. |
|
public |
accessibilityScroll(direction: UIAccessibilityScrollDirection): boolean Implement this method if a view in the view hierarchy supports a scroll by page action.If the scrolling action succeeds for the specified direction, return true and post the UIAccessibilityPageScrolledNotification notification. |
|
public |
accessibilitySetOverrideValueForAttribute(value: Object, attribute: string): boolean this method was deprecated.
This method is for changing the set of attributes on an instance, as an alternative to subclassing.This method works only on objects whose class already implements the NSAccessibility protocol. |
|
public |
accessibilitySetValueForAttribute(value: Object, attribute: string): void this method was deprecated.
User interface classes must implement this method if any of its attributes are settable. |
|
public |
See Table 1The documentation for property-list constants for the properties for person and group records. |
|
public |
addObserverForKeyPath(observer: NSObject, keyPath: string, options: NSKeyValueObservingOptions, context: Object): void Neither the object receiving this message, nor observer, are retained. |
|
public |
applicationDelegateHandlesKey(sender: NSApplication, key: string): boolean The method should return true if the delegate for the app sender handles the key specified by key, which means it can get or set the scriptable property or element that corresponds to that key. |
|
public |
attemptRecoveryFromErrorOptionIndex(error: Error, recoveryOptionIndex: number): boolean Invoked when an error alert is been presented to the user in an application-modal dialog, and the user has selected an error recovery option specified by error. |
|
public |
authorizationViewCreatedAuthorization(view: SFAuthorizationView): void Sent to the delegate to indicate the authorization object has been created or changed. |
|
public |
authorizationViewDidAuthorize(view: SFAuthorizationView): void Sent to the delegate to indicate the user was authorized and the authorization view was changed to unlocked. |
|
public |
authorizationViewDidDeauthorize(view: SFAuthorizationView): void Sent to the delegate to indicate the user was deauthorized and the authorization view was changed to locked. |
|
public |
authorizationViewDidHide(view: SFAuthorizationView): void This delegate method, if present, is called whenever the isHidden method is called to show or hide the view. |
|
public |
authorizationViewReleasedAuthorization(view: SFAuthorizationView): void This method is called after deauthorization has been approved (either you called the deauthorize: method, or the user clicked an open lock icon and the authorizationViewShouldDeauthorize: delegate method did not cancel the operation), and before the user is deauthorized (that is, before the authorizationViewDidDeauthorize: delegate method is called). |
|
public |
authorizationViewShouldDeauthorize(view: SFAuthorizationView): number The delegate can react to this before deauthorization happens and avoid it by returning false. |
|
public |
awakeAfterUsing(aDecoder: NSCoder): Object You can use this method to eliminate redundant objects created by the coder. |
|
public |
awakeFromNib(): void The nib-loading infrastructure sends an awakeFromNib message to each object recreated from a nib archive, but only after all the objects in the archive have been loaded and initialized. |
|
public |
beginPreviewPanelControl(panel: QLPreviewPanel): void |
|
public |
bindToWithKeyPath(binding: string, observable: Object, keyPath: string, options: Map<string, Object>): void Establishes a binding between a given property of the receiver and the property of a given object specified by a given key path. |
|
public |
candidates(sender: Object): Object[] An input method should look up its currently composed string and return a list of candidate strings that that string might map to. |
|
public |
certificatePanelShowHelp(sender: SFCertificatePanel): number You can use this delegate method to implement custom help if you call the setShowsHelp: method to display a help button in the sheet or panel. |
|
public |
changeColor(sender: Object): void When the user selects a color in an NSColorPanel object, the panel sends a changeColor(_:) action message to the first responder. |
|
public |
changeFont(sender: Object): void Generally this change is because the user changed the font either in the selection of a rich text field or in a whole plain text field. |
|
public |
chooseIdentityPanelShowHelp(sender: SFChooseIdentityPanel): number You can use this delegate method to implement custom help if you call the setShowsHelp: method to display a help button in the sheet or panel. |
|
public |
classForAnnotationClass(annotationClass: Object): Object this method was deprecated.
|
|
public |
this method was deprecated.
|
|
public |
coerceValueForKey(value: Object, key: string): Object The method coerceValueFor<Key>: is used if it exists. |
|
public |
commitComposition(sender: Object): void If an input method implements this method, it is called when the client wants to end the composition session immediately. |
|
public |
A commit is denied if the receiver fails to apply the changes to the model object, perhaps due to a validation error. |
|
public |
commitEditingAndReturnError(): void During autosaving, commit editing may fail, due to a pending edit. |
|
public |
commitEditingWithDelegateDidCommit(delegate: Object, didCommitSelector: function, contextInfo: Object): void The receiver must have been registered as the editor of an object using objectDidBeginEditing:, and has not yet been unregistered by a subsequent invocation of objectDidEndEditing:. |
|
public |
composedString(sender: Object): Object A composed string refers to the buffer that an input method typically maintains to mirror the text contained in the active inline area. |
|
public |
compositionParameterViewDidChangeParameterWithKey(parameterView: QCCompositionParameterView, portKey: string): void Called after an input parameter in the composition parameter view has been edited. |
|
public |
compositionParameterViewShouldDisplayParameterWithKeyAttributes(parameterView: QCCompositionParameterView, portKey: string, portAttributes: Map<AnyHashable, Object>): boolean Allows you to define which composition parameters are visible in the user interface when the composition parameter view refreshes. |
|
public |
compositionPickerViewDidSelect(pickerView: QCCompositionPickerView, composition: QCComposition): void Quartz Composer invokes this method when the selected composition in the composition picker view changes. |
|
public |
compositionPickerViewDidStartAnimating(pickerView: QCCompositionPickerView): void Quartz Composer invokes this method when the composition picker view starts animating a composition. |
|
public |
compositionPickerViewWillStopAnimating(pickerView: QCCompositionPickerView): void Quartz Composer invokes this method whenever the composition picker view stops animating a composition. |
|
public |
controlTextDidBeginEditing(obj: Notification): void This method is invoked when the user begins editing text in a control such as a text field or a form field. |
|
public |
controlTextDidChange(obj: Notification): void This method is invoked when text in a control such as a text field or form changes. |
|
public |
controlTextDidEndEditing(obj: Notification): void This method is invoked when the user stops editing text in a control such as a text field or form. |
|
public |
This is a convenience method for classes that adopt the NSCopying protocol. |
|
public |
copyScriptingValueForKeyWithProperties(value: Object, key: string, properties: Map<string, Object>): Object You can override the copyScriptingValue method to take more control when your application is sent a duplicate command. |
|
public |
dictionaryWithValuesForKeys(keys: string[]): Map<string, Object> The default implementation invokes value(forKey:) for each key in keys and substitutes NSNull values in the dictionary for returned nil values. |
|
public |
didChangeValueForKey(key: string): void Use this method when implementing key-value observer compliance manually to inform the observed object that the value at key has just changed. |
|
public |
didChangeValueForKeyWithSetMutationUsing(key: string, mutationKind: NSKeyValueSetMutationKind, objects: Set<AnyHashable>): void Use this method when implementing key-value observer compliance manually. |
|
public |
didChangeValuesAtForKey(changeKind: NSKeyValueChange, indexes: Set, key: string): void Use this method when implementing key-value-observing compliance manually.Special ConsiderationsYou rarely need to override this method in subclasses, but if you do, be sure to call super. |
|
public |
didCommandByClient(aSelector: function, sender: Object): boolean This method is called when the system binds a key down event to an action method. |
|
public |
didMatchString(instance: PDFSelection): void Called for every match found during a find operation. |
|
public |
discardEditing(): void Causes the receiver to discard any changes, restoring the previous values. |
|
public |
documentDidBeginDocumentFind(notification: Notification): void Called when the PDFDocumentDidBeginFindNotification notification is posted. |
|
public |
documentDidBeginPageFind(notification: Notification): void Called when the PDFDocumentDidBeginPageFindNotification notification is posted. |
|
public |
documentDidEndDocumentFind(notification: Notification): void Called when the PDFDocumentDidEndFindNotification notification is posted. |
|
public |
documentDidEndPageFind(notification: Notification): void Called when the PDFDocumentDidEndPageFindNotification notification is posted. |
|
public |
documentDidFindMatch(notification: Notification): void Called when the PDFDocumentDidFindMatchNotification notification is posted. |
|
public |
documentDidUnlock(notification: Notification): void Called when the PDFDocumentDidUnlockNotification notification is posted. |
|
public |
doesContain(object: Object): boolean Currently, doesContain(_:) messages are never sent to any object from within Cocoa itself. |
|
public |
doesNotRecognizeSelector(aSelector: function): void The runtime system invokes this method whenever an object receives an aSelector message it can’t respond to or forward. |
|
public |
endPreviewPanelControl(panel: QLPreviewPanel): void |
|
public |
exceptionHandlerShouldHandleMask(sender: NSExceptionHandler, exception: NSException, aMask: number): boolean Implemented by the delegate to evaluate whether the delegating NSExceptionHandler instance should handle a given exception. |
|
public |
exceptionHandlerShouldLogExceptionMask(sender: NSExceptionHandler, exception: NSException, aMask: number): boolean Implemented by the delegate to evaluate whether the delegating NSExceptionHandler instance should log a given exception. |
|
public |
fileManagerShouldProceedAfterError(fm: FileManager, errorInfo: Map<AnyHashable, Object>): boolean this method was deprecated.
An NSFileManager object, manager, sends this message for each error it encounters when copying, moving, removing, or linking files or directories. |
|
public |
fileManagerWillProcessPath(fm: FileManager, path: string): void this method was deprecated.
You can implement this method in your handler to monitor file operations. |
|
public |
fileTransferServicesAbortCompleteError(inServices: OBEXFileTransferServices, inError: OBEXError): void |
|
public |
fileTransferServicesConnectionCompleteError(inServices: OBEXFileTransferServices, inError: OBEXError): void |
|
public |
fileTransferServicesCopyRemoteFileCompleteError(inServices: OBEXFileTransferServices, inError: OBEXError): void |
|
public |
fileTransferServicesCopyRemoteFileProgressTransferProgress(inServices: OBEXFileTransferServices, inProgressDescription: Map<AnyHashable, Object>): void |
|
public |
fileTransferServicesCreateFolderCompleteErrorFolder(inServices: OBEXFileTransferServices, inError: OBEXError, inFolderName: string): void |
|
public |
fileTransferServicesDisconnectionCompleteError(inServices: OBEXFileTransferServices, inError: OBEXError): void |
|
public |
fileTransferServicesFilePreparationCompleteError(inServices: OBEXFileTransferServices, inError: OBEXError): void |
|
public |
fileTransferServicesPathChangeCompleteErrorFinalPath(inServices: OBEXFileTransferServices, inError: OBEXError, inPath: string): void |
|
public |
fileTransferServicesRemoveItemCompleteErrorRemovedItem(inServices: OBEXFileTransferServices, inError: OBEXError, inItemName: string): void |
|
public |
fileTransferServicesRetrieveFolderListingCompleteErrorListing(inServices: OBEXFileTransferServices, inError: OBEXError, inListing: Object[]): void |
|
public |
fileTransferServicesSendFileCompleteError(inServices: OBEXFileTransferServices, inError: OBEXError): void |
|
public |
fileTransferServicesSendFileProgressTransferProgress(inServices: OBEXFileTransferServices, inProgressDescription: Map<AnyHashable, Object>): void |
|
public |
finalize(): void this method was deprecated.
The garbage collector invokes this method on the receiver before disposing of the memory it uses. |
|
public |
finalizeForWebScript(): void This method is invoked on objects exposed to the scripting environment just before the scripting environment is reset. |
|
public |
fontManagerWillIncludeFont(sender: Object, fontName: string): boolean this method was deprecated.
In macOS versions 10.2 and earlier, this method is invoked repeatedly as necessary whenever the Font panel needs updating, such as when the Font panel is first loaded, and when the user selects a family name to see which typefaces in that family are available. |
|
public |
forwardingTargetFor(aSelector: function): Object If an object implements (or inherits) this method, and returns a non-nil (and non-self) result, that returned object is used as the new receiver object and the message dispatch resumes to that new object. |
|
public |
handleClient(event: NSEvent, sender: Object): boolean Handles key down and mouse events. |
|
public |
imageBrowserBackgroundWasRightClickedWith(aBrowser: IKImageBrowserView, event: NSEvent): void This method signals that the user either right-clicked the background or left-clicked it with the Alt key pressed. |
|
public |
imageBrowserCellWasDoubleClickedAt(aBrowser: IKImageBrowserView, index: number): void This method signals that the user double-clicked an item in the image browser view. |
|
public |
imageBrowserCellWasRightClickedAtWith(aBrowser: IKImageBrowserView, index: number, event: NSEvent): void This method signals that the user either right-clicked an item in the browser or left-clicked the item with the Alt key pressed. |
|
public |
imageBrowserGroupAt(aBrowser: IKImageBrowserView, index: number): Map<AnyHashable, Object> This method is optional. |
|
public |
imageBrowserItemAt(aBrowser: IKImageBrowserView, index: number): Object Your data source must implement this method. |
|
public |
imageBrowserMoveItemsAtTo(aBrowser: IKImageBrowserView, indexes: Set, destinationIndex: number): boolean This method is optional. |
|
public |
imageBrowserRemoveItemsAt(aBrowser: IKImageBrowserView, indexes: Set): void This method is optional. |
|
public |
imageBrowserSelectionDidChange(aBrowser: IKImageBrowserView): void This method signals that the user changes the selection in the image browser view. |
|
public |
imageBrowserWriteItemsAtTo(aBrowser: IKImageBrowserView, itemIndexes: Set, pasteboard: NSPasteboard): number This method is optional. |
|
public |
Your data source must implement this method. |
|
public |
Your data source must implement this method. |
|
public |
This method is optional. |
|
public |
imageTitle(): string This method is optional. |
|
public |
Your data source must implement this method. |
|
public |
This method is optional. |
|
public |
indexOfAccessibilityElement(element: Object): number Returns the index of the specified accessibility element. |
|
public |
indicesOfObjectsByEvaluatingObjectSpecifier(specifier: NSScriptObjectSpecifier): number[] Containers that want to evaluate some specifiers on their own should implement this method. |
|
public |
infoForBinding(binding: string): Map<string, Object> This method is mostly for use by subclasses which want to analyze the existing bindings of an object. |
|
public |
inputTextClient(string: string, sender: Object): boolean An input method should implement this method when using key binding (that is, it implements didCommand(by:client:)). |
|
public |
inputTextKeyModifiersClient(string: string, keyCode: number, flags: number, sender: Object): boolean Receives Unicode, the key code that generated it, and any modifier flags. |
|
public |
insertValueAtInPropertyWithKey(value: Object, index: number, key: string): void The method insertIn<Key>:atIndex: is invoked if it exists. |
|
public |
insertValueInPropertyWithKey(value: Object, key: string): void The method insertIn<Key>: is used if it exists. |
|
public |
inverseForRelationshipKey(relationshipKey: string): string NSObject’s implementation of inverseForRelationshipKey: simply invokes [[self classDescription] inverseForRelationshipKey:relationshipKey]. |
|
public |
invokeDefaultMethodWithArguments(_arguments: Object[]): Object Executes when a script attempts to invoke a method on an exposed object directly. |
|
public |
invokeUndefinedMethodFromWebScriptWithArguments(name: string, _arguments: Object[]): Object This method is invoked when a script attempts to invoke a method not directly exported to the scripting environment. |
|
public |
isCaseInsensitiveLike(object: string): boolean Currently, isCaseInsensitiveLike(_:) messages are never sent to any object from within Cocoa itself.The default implementation for this method provided by NSObject returns false. |
|
public |
During the evaluation of an NSWhoseSpecifier object that contains a test whose operator is NSEqualToComparison, an isEqual(to:) message may be sent to each potentially specified object, if neither the potentially specified object nor the object being tested against implements a scriptingIsEqual(to:) method.The default implementation for this method provided by NSObject returns true if an isEqualTo: message sent to the same object would return true. |
|
public |
isGreaterThan(object: Object): boolean During the evaluation of an NSWhoseSpecifier object that contains a test whose operator is NSGreaterThanComparison, an isGreaterThan(:) message may be sent to each potentially specified object, if the potentially specified object does not implement a scriptingIsGreaterThan(:) method and the object being tested against does not implement a scriptingIsLessThanOrEqual(to:) method.The default implementation for this method provided by NSObject returns true if a compare: message sent to the same object would return NSOrderedDescending. |
|
public |
isGreaterThanOrEqualTo(object: Object): boolean During the evaluation of an NSWhoseSpecifier object that contains a test whose operator is NSGreaterThanOrEqualToComparison, anisGreaterThanOrEqual(to:) message may be sent to each potentially specified object, if the potentially specified object does not implement a scriptingIsGreaterThanOrEqual(to:) method and the object being tested against does not implement a scriptingIsLessThan(_:) method.The default implementation for this method provided by NSObject returns true if a compare: message sent to the same object would return NSOrderedSame or NSOrderedDescending. |
|
public |
isInstanceOf(aClass: Object): boolean |
|
public |
isLessThan(object: Object): boolean During the evaluation of an NSWhoseSpecifier object that contains a test whose operator is NSLessThanComparison, an isLessThan(:) message may be sent to each potentially specified object, if the potentially specified object does not implement a scriptingIsLessThan(:) method and the object being tested against does not implement a scriptingIsGreaterThanOrEqual(to:) method.The default implementation for this method provided by NSObject method returns true if a compare: message sent to the same object would return NSOrderedAscending. |
|
public |
isLessThanOrEqualTo(object: Object): boolean During the evaluation of an NSWhoseSpecifier object that contains a test whose operator is NSLessThanOrEqualToComparison, an isLessThanOrEqual(to:) message may be sent to each potentially specified object, if the potentially specified object does not implement a scriptingIsLessThanOrEqual(to:) method and the object being tested against does not implement a scriptingIsGreaterThan(_:) method.The default implementation for this method provided by NSObject method returns true if a compare: message sent to the same object would return NSOrderedAscending or NSOrderedSame. |
|
public |
Currently, isLike(_:) messages are never sent to any object from within Cocoa itself.The default implementation for this method provided by NSObject method returns false. |
|
public |
isNotEqualTo(object: Object): boolean Currently, isNotEqual(to:) messages are never sent to any object from within Cocoa itself.The default implementation for this method provided by NSObject method returns true if an isEqual: message sent to the same object would return false. |
|
public |
layerShouldInheritContentsScaleFrom(layer: CALayer, newScale: number, window: NSWindow): boolean When a resolution change occurs for a given window, the system traverses the layer trees in that window to decide what action, if any, to take for each layer. |
|
public |
If the receiver is an instance, aSelector should refer to an instance method; if the receiver is a class, it should refer to a class method. |
|
public |
mutableArrayValueForKey(key: string): Array Objects added to the mutable array become related to the receiver, and objects removed from the mutable array become unrelated. |
|
public |
mutableArrayValueForKeyPath(keyPath: string): Array See mutableArrayValue(forKey:) for additional details. |
|
public |
This is a convenience method for classes that adopt the NSMutableCopying protocol. |
|
public |
Objects added to the mutable set proxy become related to the receiver, and objects removed from the mutable set become unrelated. |
|
public |
mutableOrderedSetValueForKeyPath(keyPath: string): Set See mutableOrderedSetValue(forKey:) for additional details. |
|
public |
mutableSetValueForKey(key: string): Set Objects added to the mutable set proxy become related to the receiver, and objects removed from the mutable set become unrelated. |
|
public |
mutableSetValueForKeyPath(keyPath: string): Set See mutableSetValue(forKey:) for additional details. |
|
public |
namesOfPromisedFilesDroppedAtDestination(dropDestination: string): string[] this method was deprecated.
This method is invoked when the drop has been accepted by the destination and the destination, in the case of another Cocoa application, invokes the NSDraggingInfo method namesOfPromisedFilesDropped(atDestination:). |
|
public |
newScriptingObjectOfForValueForKeyWithContentsValue(objectClass: Object, key: string, contentsValue: Object, properties: Map<string, Object>): Object You can override the newScriptingObjectOfClass method to take more control when your application is sent a make command. |
|
public |
numberOfGroupsInImageBrowser(aBrowser: IKImageBrowserView): number This method is optional. |
|
public |
numberOfItemsInImageBrowser(aBrowser: IKImageBrowserView): number Your data source must implement this method. |
|
public |
objectDidBeginEditing(editor: Object): void This message should be sent to the receiver when editor has uncommitted changes that can affect the receiver. |
|
public |
objectDidEndEditing(editor: Object): void This message should be sent to the receiver when editor has finished editing a property belonging to the receiver. |
|
public |
observeValueForKeyPathOf(keyPath: string, object: Object, change: Map<NSKeyValueChangeKey, Object>, context: Object): void For an object to begin sending change notification messages for the value at keyPath, you send it an addObserver(_:forKeyPath:options:context:) message, naming the observing object that should receive the messages. |
|
public |
optionDescriptionsForBinding(binding: string): NSAttributeDescription[] The NSAttributeDescription instances in the array are used by Interface Builder to build the options editor user interface of the bindings inspector.The option name displayed for the option in the bindings inspector is based on the value of the NSAttributeDescription method name. |
|
public |
originalString(sender: Object): string Return the a string that consists of the precomposed unicode characters. |
|
public |
pasteboardChangedOwner(sender: NSPasteboard): void Pasteboard owners only need to implement this method if they need to know when they have lost ownership.The owner is not able to read the contents of the pasteboard when responding to this method. |
|
public |
pasteboardProvideDataForType(sender: NSPasteboard, type: string): void The receiver should have been previously declared in a declareTypes(:owner:) message.The requested data should be written to sender using the setData(:forType:), setPropertyList(:forType:), or setString(:forType:) method. |
|
public |
performActionFor(person: ABPerson, identifier: string): void If the property returned by actionProperty() is a multivalue property, identifier contains the unique identifier of the value selected. |
|
public |
performOnWithWaitUntilDone(aSelector: function, thr: Thread, arg: Object, wait: boolean): void You can use this method to deliver messages to other threads in your application. |
|
public |
performOnWithWaitUntilDoneModes(aSelector: function, thr: Thread, arg: Object, wait: boolean, array: string[]): void You can use this method to deliver messages to other threads in your application. |
|
public |
performSelectorInBackgroundWith(aSelector: function, arg: Object): void This method creates a new thread in your application, putting your application into multithreaded mode if it was not already. |
|
public |
performSelectorOnMainThreadWithWaitUntilDone(aSelector: function, arg: Object, wait: boolean): void You can use this method to deliver messages to the main thread of your application. |
|
public |
performSelectorOnMainThreadWithWaitUntilDoneModes(aSelector: function, arg: Object, wait: boolean, array: string[]): void You can use this method to deliver messages to the main thread of your application. |
|
public |
performWithAfterDelay(aSelector: function, anArgument: Object, delay: number): void This method sets up a timer to perform the aSelector message on the current thread’s run loop. |
|
public |
performWithAfterDelayInModes(aSelector: function, anArgument: Object, delay: number, modes: RunLoopMode[]): void This method sets up a timer to perform the aSelector message on the current thread’s run loop. |
|
public |
prepareForInterfaceBuilder(): void When Interface Builder instantiates a class with the IB_DESIGNABLE attribute, it calls this method to let the resulting object know that it was created at design time. |
|
public |
provideImageDataBytesPerRowOriginSizeUserInfo(data: Object, rowbytes: number, x: number, y: number, width: number, height: number, info: Object): void You can supply the image provider to these methods of the CIImage class: imageWithImageProvider:size::format:colorSpace:options: to create a CIImage object from image datainit(imageProvider:size:_:format:colorSpace:options:) to initialize an existing CIImage with dataYou initialize the given bitmap with the subregion specified by the arguments x, y, width, and height. |
|
public |
quartzFilterManagerDidAdd(sender: QuartzFilterManager, filter: QuartzFilter): void |
|
public |
quartzFilterManagerDidModifyFilter(sender: QuartzFilterManager, filter: QuartzFilter): void |
|
public |
quartzFilterManagerDidRemove(sender: QuartzFilterManager, filter: QuartzFilter): void |
|
public |
quartzFilterManagerDidSelect(sender: QuartzFilterManager, filter: QuartzFilter): void |
|
public |
readLinkQualityForDeviceComplete(controller: Object, device: IOBluetoothDevice, info: UnsafeMutablePointer<BluetoothHCILinkQualityInfo>, error: IOReturn): void This delegate gets invoked when an read link quality command complete event occurs. |
|
public |
readRSSIForDeviceComplete(controller: Object, device: IOBluetoothDevice, info: UnsafeMutablePointer<BluetoothHCIRSSIInfo>, error: IOReturn): void This delegate gets invoked when an RSSI command complete event occurs. |
|
public |
removeObserverForKeyPath(observer: NSObject, keyPath: string): void It is an error to call removeObserver(:forKeyPath:) for an object that has not previously been registered as an observer.Be sure to invoke this method (or removeObserver(:forKeyPath:context:)) before any object specified in addObserver(_:forKeyPath:options:context:) is deallocated. |
|
public |
removeValueAtFromPropertyWithKey(index: number, key: string): void The method removeFrom<Key>AtIndex: is invoked if it exists. |
|
public |
replaceValueAtInPropertyWithKeyWithValue(index: number, key: string, value: Object): void The method replaceIn<Key>:atIndex: is invoked if it exists. |
|
public |
replacementObjectFor(aCoder: NSCoder): Object An object might encode itself into an archive, but encode a proxy for itself if it’s being encoded for distribution. |
|
public |
saveOptionsShouldShowUTType(saveOptions: IKSaveOptions, utType: string): boolean Called to determine if the specified uniform type identifier should be shown in the save panel. |
|
public |
scriptingBeginsWith(object: Object): boolean Returns true if, in a scripting comparison, the compared object matches the beginning of object. |
|
public |
scriptingContains(object: Object): boolean Returns true if, in a scripting comparison, the compared object contains object. |
|
public |
scriptingEndsWith(object: Object): boolean Returns true if, in a scripting comparison, the compared object matches the end of object. |
|
public |
scriptingIsEqualTo(object: Object): boolean Returns true if, in a scripting comparison, the compared object is equal to object. |
|
public |
scriptingIsGreaterThan(object: Object): boolean Returns true if, in a scripting comparison, the compared object is greater than object. |
|
public |
scriptingIsGreaterThanOrEqualTo(object: Object): boolean Returns true if, in a scripting comparison, the compared object is greater than or equal to object. |
|
public |
scriptingIsLessThan(object: Object): boolean Returns true if, in a scripting comparison, the compared object is less than object. |
|
public |
scriptingIsLessThanOrEqualTo(object: Object): boolean Returns true if, in a scripting comparison, the compared object is less than or equal to object. |
|
public |
scriptingValueFor(objectSpecifier: NSScriptObjectSpecifier): Object You can override this method to customize the evaluation of object specifiers without requiring that the scripting container make up indexes for contained objects that don't naturally have indexes (as can be the case if you implement indicesOfObjects(byEvaluatingObjectSpecifier:) instead).Your override of this method doesn't need to also invoke any of the NSScriptCommand error signaling methods, though it can, to record very specific information. |
|
public |
setNilValueForKey(key: string): void Subclasses can override this method to handle the request in some other way, such as by substituting 0 or a sentinel value for nil and invoking setValue(_:forKey:) again or setting the variable directly. |
|
public |
setValueForKey(value: Object, key: string): void If key identifies a to-one relationship, relate the object specified by value to the receiver, unrelating the previously related object if there was one. |
|
public |
setValueForKeyPath(value: Object, keyPath: string): void The default implementation of this method gets the destination object for each relationship using value(forKey:), and sends the final object a setValue(_:forKey:) message.Special ConsiderationsWhen using this method, and the destination object does not implement an accessor for the value, the default behavior is for that object to retain value rather than copy or assign value. |
|
public |
setValueForUndefinedKey(value: Object, key: string): void Subclasses can override this method to handle the request in some other way. |
|
public |
setValuesForKeys(keyedValues: Map<string, Object>): void The default implementation invokes setValue(_:forKey:) for each key-value pair, substituting nil for NSNull values in keyedValues. |
|
public |
shouldEnableActionFor(person: ABPerson, identifier: string): boolean If the property returned by actionProperty() is a multivalue property, identifier contains the unique identifier of the value selected. |
|
public |
textStorageDidProcessEditing(notification: Notification): void this method was deprecated.
|
|
public |
textStorageWillProcessEditing(notification: Notification): void this method was deprecated.
|
|
public |
If the property returned by actionProperty() is a multivalue property, identifier contains the unique identifier of the value selected. |
|
public |
Removes a given binding between the receiver and a controller. |
|
public |
validModesForFontPanel(fontPanel: NSFontPanel): number The mode masks are defined in Mode Masks. |
|
public |
validateMenuItem(menuItem: NSMenuItem): boolean The object implementing this method must be the target of menuItem. |
|
public |
validateToolbarItem(item: NSToolbarItem): boolean NSToolbar only calls this method for image items.Note validateToolbarItem(_:) is called very frequently, so it must be efficient.If the receiver is the target for the actions of multiple toolbar items, it’s necessary to determine which toolbar item theItem refers to by testing the itemIdentifier.-(BOOL)validateToolbarItem:(NSToolbarItem )toolbarItem { BOOL enable = NO; if ([[toolbarItem itemIdentifier] isEqual:SaveDocToolbarItemIdentifier]) { // We will return YES (enable the save item) // only when the document is dirty and needs saving enable = [self isDocumentEdited]; } else if ([[toolbarItem itemIdentifier] isEqual:NSToolbarPrintItemIdentifier]) { // always enable print for this window enable = YES; } return enable; } -(BOOL)validateToolbarItem:(NSToolbarItem )toolbarItem { BOOL enable = NO; if ([[toolbarItem itemIdentifier] isEqual:SaveDocToolbarItemIdentifier]) { // We will return YES (enable the save item) // only when the document is dirty and needs saving enable = [self isDocumentEdited]; } else if ([[toolbarItem itemIdentifier] isEqual:NSToolbarPrintItemIdentifier]) { // always enable print for this window enable = YES; } return enable; } |
|
public |
validateValueForKey(ioValue: AutoreleasingUnsafeMutablePointer<AnyObject?>, inKey: string): void The default implementation of this method searches the class of the receiver for a validation method whose name matches the pattern validate<Key>:error:. |
|
public |
validateValueForKeyPath(ioValue: AutoreleasingUnsafeMutablePointer<AnyObject?>, inKeyPath: string): void The default implementation gets the destination object for each relationship using value(forKey:) and returns the result of a validateValue(_:forKey:) message to the final object.Handling Errors in Swift: In Swift, this method returns Void and is marked with the throws keyword to indicate that it throws an error in cases of failure. |
|
public |
valueAtInPropertyWithKey(index: number, key: string): Object This actually works with a single-value key as well if index is 0. |
|
public |
valueClassForBinding(binding: string): Object This method is used by Interface Builder to determine the appropriate transformers for a binding. |
|
public |
valueForKey(key: string): Object The search pattern that valueForKey: uses to find the correct value to return is described in Accessor Search Patterns in Key-Value Coding Programming Guide. |
|
public |
valueForKeyPath(keyPath: string): Object The default implementation gets the destination object for each relationship using value(forKey:) and returns the result of a value(forKey:) message to the final object. |
|
public |
valueForUndefinedKey(key: string): Object Subclasses can override this method to return an alternate value for undefined keys. |
|
public |
valueWithNameInPropertyWithKey(name: string, key: string): Object The method valueIn<Key>WithName: is used if it exists. |
|
public |
valueWithUniqueIDInPropertyWithKey(uniqueID: Object, key: string): Object The method valueIn<Key>WithUniqueID: is invoked if it exists. |
|
public |
viewStringForToolTipUserData(view: NSView, tag: NSToolTipTag, point: CGPoint, data: Object): string userData is additional information provided by the creator of the tool tip rectangle. |
|
public |
webPlugInContainerLoadInFrame(request: URLRequest, target: string): void If the frame specified by target is not found, a new window is opened, loaded with the URL request, and given the specified frame name. |
|
public |
webPlugInContainerShowStatus(message: string): void Tells the container to show a status message. |
|
public |
webPlugInDestroy(): void Typically, this method frees the memory and other resources used by the plug-in. |
|
public |
webPlugInInitialize(): void Tells the plug-in to perform one-time initialization. |
|
public |
webPlugInMainResourceDidFailWithError(error: Error): void This message is invoked when the underlying NSURLConnection object for the main resource sends the connection:didFailWithError: message to its delegate. |
|
public |
This message is invoked when the WebPlugInShouldLoadMainResourceKey plug-in command-line argument is set to false and the underlying NSURLConnection object for the main resource sends the connectionDidFinishLoading: message to its delegate. |
|
public |
webPlugInMainResourceDidReceive(response: URLResponse): void This message is invoked when the WebPlugInShouldLoadMainResourceKey plug-in command-line argument is set to false and the underlying NSURLConnection object for the main resource sends the connection:didReceiveResponse: message to its delegate. |
|
public |
webPlugInSetIsSelected(isSelected: boolean): void This may be used, for example, to change the plug-in’s appearance when it is selected by the user. |
|
public |
webPlugInStart(): void The plug-in usually begins its primary task (such as drawing, playing sounds, or animating) in this method. |
|
public |
webPlugInStop(): void This method may be called more than once, provided that the application has already called webPlugInInitialize() and that each call to this method is preceded by a call to webPlugInStart(). |
|
public |
willChangeValueForKey(key: string): void Use this method when implementing key-value observer compliance manually to inform the observed object that the value at key is about to change.The change type of this method is NSKeyValueChangeSetting.ImportantAfter the values have been changed, a corresponding didChangeValue(forKey:) must be invoked with the same parameter. |
|
public |
willChangeValueForKeyWithSetMutationUsing(key: string, mutationKind: NSKeyValueSetMutationKind, objects: Set<AnyHashable>): void Use this method when implementing key-value observer compliance manually.ImportantAfter the values have been changed, a corresponding didChangeValue(forKey:withSetMutation:using:) must be invoked with the same parameters.Special ConsiderationsYou rarely need to override this method in subclasses, but if you do, be sure to call super. |
|
public |
willChangeValuesAtForKey(changeKind: NSKeyValueChange, indexes: Set, key: string): void Use this method when implementing key-value-observing compliance manually.ImportantAfter the values have been changed, a corresponding didChange(_:valuesAt:forKey:) must be invoked with the same parameters.Special ConsiderationsYou rarely need to override this method in subclasses, but if you do, be sure to call super. |
|
public |
workflowControllerDidError(controller: AMWorkflowController, error: Error): void Invoked when the receiver's workflow encounters an error. |
|
public |
workflowControllerDidRun(controller: AMWorkflowController, action: AMAction): void Invoked when an action in the receiver's workflow is finished running. |
|
public |
workflowControllerDidStop(controller: AMWorkflowController): void Tells the delegate that the workflow controller object has stopped. |
|
public |
workflowControllerWillRun(controller: AMWorkflowController, action: AMAction): void Invoked when an action in the receiver's workflow is about to run. |
|
public |
workflowControllerWillStop(controller: AMWorkflowController): void Tells the delegate that the workflow controller object is about to stop. |
Static Public Members
public static get LightingModel: Object source
Properties:
Name | Type | Attribute | Description |
blinn | string | Shading that incorporates ambient, diffuse, and specular properties, where specular highlights are calculated using the Blinn-Phong formula. |
|
constant | string | Uniform shading that incorporates ambient lighting only. |
|
lambert | string | Shading that incorporates ambient and diffuse properties only. |
|
phong | string | Shading that incorporates ambient, diffuse, and specular properties, where specular highlights are calculated using the Phong formula. |
|
physicallyBased | string | Shading based on a realistic abstraction of physical lights and materials. |
Public Constructors
public constructor(mdlMaterial: MDLMaterial) source
The Model I/O framework provides universal support for import, export, description, and processing of several 3D asset file formats and related resources. (For details, see Model I/O.) The MDLMaterial class is a generic description of surface rendering to be used in rendering 3D object, supporting a superset of the attributes described by the SCNMaterial class.
Override:
NSObject#constructorParams:
Name | Type | Attribute | Description |
mdlMaterial | MDLMaterial | A Model I/O material object. |
Public Members
public get ambient: SCNMaterialProperty source
Ambient shading describes the amount and color of ambient light reflected by the material. Ambient shading is uniform in all directions at all points on a surface. If a scene does not contain lights whose type is ambient, this property has no effect on a material’s appearance. By default, the ambient property’s contents object is a dark gray color. Changing the ambient property’s contents lets you specify a different color or texture for the areas of a surface not directly illuminated by lights in a scene. To make the material respond identically to both ambient and diffuse light, set its locksAmbientWithDiffuse property to true. Figure 1 shows a material (with a texture for its diffuse property) before and after setting the ambient property’s contents to a solid color.Figure 1 Adding an ambient color to a materialThe material’s lightingModel property determines the formula SceneKit uses to combine its ambient color and other visual properties with lights and other contents in a scene to produce the final color for each rendered pixel in the rendered scene. For details, see Lighting Models.This material property does not apply to physically-based materials (see physicallyBased).Adding an ambient color to a material
public get ambientOcclusion: SCNMaterialProperty source
Use this property to assign an ambient occlusion texture map to a surface. This property has no effect if there is no ambient light in the scene. If this property is not nil, SceneKit ignores the ambient property.When using physically-based shading (see physicallyBased), ambient occlusion approximates large-scale surface details that obscure global illumination.
public get animationKeys: string[] source
This array contains all keys for which animations are attached to the object, or is empty if there are no attached animations. The ordering of animation keys in the array is arbitrary.
public blendMode: SCNBlendMode source
The mode that determines how pixel colors rendered using this material blend with other pixel colors in the rendering target.
public colorBufferWriteMask: SCNColorMask source
public cullMode: SCNCullMode source
The mode determining which faces of a surface SceneKit renders. Animatable.
public get diffuse: SCNMaterialProperty source
Diffuse shading describes the amount and color of light reflected equally in all directions from each point on the material’s surface. The diffuse color of a pixel is independent of the point of view, so it can be thought of as a material’s “base” color or texture. By default, the diffuse property’s contents object is a white color. Figure 1 shows the effect of setting the diffuse property’s contents to a texture image on a material whose other properties have default contents.Figure 1 Adding a diffuse texture to a materialThe material’s lightingModel property determines the formula SceneKit uses to combine its diffuse color and other visual properties with lights and other contents in a scene to produce the final color for each rendered pixel in the rendered scene. For details, see Lighting Models.Adding a diffuse texture to a material
public get displacement: SCNMaterialProperty source
public get emission: SCNMaterialProperty source
You can use an emissive map texture to simulate parts of a surface that glow with their own light. SceneKit does not treat the material as a light source—rather, the emission property determines colors for a material independent of lighting. (To create an object that appears to glow, you may wish to combine a geometry with an emissive map and additional SCNLight objects added to the scene.)By default, the emissive property’s contents object is a black color, causing the property to have no visible effect. Setting the emissive property’s contents to any solid color adds a uniform color to the material independent of lighting. To create a selective glow effect, set the property’s contents to an image or other texture-mapped content whose glowing areas use bright colors and whose other areas use darker colors. In the darker-colored portions of the emissive map (and portions with reduced opacity), the other visual properties of the material contribute to its appearance under scene lighting.Figure 1 shows a material (with a texture for its diffuse property) before and after providing an emissive map image.Figure 1 Adding an emissive map to a materialAdding an emissive map to a material
public fillMode: SCNFillMode source
public isDoubleSided: boolean source
A Boolean value that determines whether SceneKit should render both front and back faces of a surface. Animatable.
public isLitPerPixel: boolean source
A Boolean value that determines whether SceneKit performs lighting calculations per vertex or per pixel. Animatable.
public lightingModel: LightingModel source
The lighting formula that SceneKit uses to render the material.
public locksAmbientWithDiffuse: boolean source
A Boolean value that determines whether the material responds identically to both ambient and diffuse lighting. Animatable.
public get metalness: SCNMaterialProperty source
This property measures only the total intensity of color values; texture contents are best defined in grayscale.This property generally approximates aspects of a physical surface—such as index of refraction, tendency to produce sharp reflections, and tendency to produce Fresnel reflections at grazing angles—that together produce an overall metallic or nonmetallic (also called dielectric) appearance. Lower values (darker colors) cause the material to appear more like a dielectric surface. Higher values (brighter colors) cause the surface to appear more metallic.This property applies only when the material’s lightingModel value is physicallyBased.
public get multiply: SCNMaterialProperty source
After combining a material’s other visual properties with lighting and other information about a scene, Scene kit multiplies the color of each rendered pixel by the color this property provides. You can use this property to darken or tint a surface independent of the effects of lighting and other properties, or to add precomputed lighting to a scene via a shadow map.By default, the multiply property’s contents object is a white color, causing the property to have no visible effect.Figure 1 shows a material (with textures for its diffuse and emission properties) before and after setting the multiply property’s contents to a solid color. Notice that the multiply color modulates even the bright areas added by the emissive map.Figure 1 Adding a multiply color to a materialAdding a multiply color to a material
public get normal: SCNMaterialProperty source
Simulating the interaction of lights with a material requires information about the orientation of the surface at each point. Typically, normal vectors provided by a geometry object provide this information. However, this limits the level of detail for surface contours because a geometry can only provide one unique surface normal vector per vertex (and increasing vertex count to model a highly detailed surface exacts a high performance cost).Alternatively, you can use a texture image as a normal map that describes the orientation of a surface for each pixel in the texture. When SceneKit uses an image, it treats the R, G, and B components of each as the X, Y, and Z components of a surface normal vector. Because a normal map texture can store much more detailed surface information than a geometry, you can use a material’s normal property to simulate rough surfaces such as stone or add embossed or engraved designs to an otherwise smooth surface.By default, the normal property’s contents object is a white color. Setting the normal property’s contents to any solid color disables normal mapping, causing SceneKit to shade the material using only the surface normal information provided by its geometry. Setting the normal property’s contents to an image or other texture-mapped content enables normal mapping, which also automatically sets the material’s isLitPerPixel property to true. Figure 1 shows the effect of setting the normal property’s contents to a texture image on a material whose other properties have default contents.Figure 1 Adding a normal map to a materialThe material’s lightingModel property determines the formula SceneKit uses to combine its surface normals and other visual properties with lights and other contents in a scene to produce the final color for each rendered pixel in the rendered scene. For details, see Lighting Models.Adding a normal map to a material
public readsFromDepthBuffer: boolean source
A Boolean value that determines whether SceneKit uses depth information when rendering the material.
public get reflective: SCNMaterialProperty source
You can simulate a mirrored or chromed finish on a surface by causing it to reflect its environment. SceneKit does not render real-time reflections of the objects in a scene, but it can use an environment map texture to simulate reflection of a static or animated image. When rendering each pixel on the surface, SceneKit traces the light from that point to a pixel in the environment map as if the surface was reflecting that image.By default, the reflective property’s contents object is a white color, causing the property to have no visible effect. Setting the reflective property’s contents to any solid color adds uniform shading to the material. To create a reflective effect, set the property’s contents to an image or other texture-mapped content.To produce a mirror-finish effect using an environment map, the texture image should take one of two forms:A sphere map, a square image whose content depicts an environment as reflected by a mirrored sphere.A cube map, an array of six square images which together form an imaginary cube enclosing the scene, whose inner surfaces are reflected by the material. You create a cube map by setting the reflective property’s contents object to an NSArray instance containing six images, each corresponding to a direction in the scene’s world coordinate space in the following order: +X, -X, +Y, -Y, +Z, -Z (or Right, Left, Top, Bottom, Near, Far).Figure 1 shows a material (with a texture for its normal property) before and after providing a cube map for the reflective property.Figure 1 Adding a reflective cube map to a materialThis material property does not apply to physically-based materials (see physicallyBased). Instead, such materials reflect environment-based lighting (see the SCNScene lightingEnvironment property) based on their metalness and roughness properties.Adding a reflective cube map to a material
public get roughness: SCNMaterialProperty source
This property measures only the total intensity of color values; texture contents are best defined in grayscale.This property approximates the level of microscopic detail—for example tiny bumps and cracks—in a surface. By approximating these “microfacets” as a single term, this property helps produce lighting calculations that resemble the energy-conserving laws of real-world physics, resulting in more realistic variation between matte and shiny surfaces. Lower values (darker colors) cause the material to appear shiny, with well-defined specular highlights. Higher values (brighter colors) cause specular highlights to spread out and the diffuse color of the material to become more retroreflective.This property applies only when the material’s lightingModel value is physicallyBased.
public get selfIllumination: SCNMaterialProperty source
Self-illumination applies to all materials, but is especially useful for those using physically-based shading (see physicallyBased). Physically-based materials work best with environment-based lighting (see the SCNScene property lightingEnvironment), but for some materials it can be useful to let a surface itself define part of its lighting—for example, an object whose position obscures it from the “sky” that provides the main lighting environment. When you assign contents to this property, they override the environmental lighting contribution to diffuse shading, but environmental lighting still contributes to specular effects.
public shaderModifiers: Map<SCNShaderModifierEntryPoint, string> source
A dictionary of GLSL source code snippets for customizing the shader programs provided by SceneKit.
public get specular: SCNMaterialProperty source
Specular shading describes the amount and color of light reflected by the material directly toward the viewer, forming a bright highlight on the surface and simulating a glossy or shiny appearance. You adjust the sharpness of specular highlights using the material’s shininess property.By default, the specular property’s contents object is a black color, causing the material to appear dull or matte. Changing the specular property’s contents to a brighter color causes specular highlights to appear in that color, making the surface appear shiny. When you apply a texture to the specular property, the texture image becomes a specular map—the brightness of each pixel in the image determines the tendency of each point on the material’s surface to create specular highlights when lit. Figure 1 shows a material (with a texture for its diffuse property) before and after providing a specular map image. Notice that the bright specular highlights appear only on portions of the surface where the specular map image is white.Figure 1 Adding a specular map to a materialThe material’s lightingModel property determines the formula SceneKit uses to combine its specularity and other visual properties with lights and other contents in a scene to produce the final color for each rendered pixel in the rendered scene. For details, see Lighting Models.This material property does not apply to physically-based materials (see physicallyBased).Adding a specular map to a material
public transparencyMode: SCNTransparencyMode source
The mode SceneKit uses to calculate transparency for the material.
public get transparent: SCNMaterialProperty source
Use this property to selectively make parts of a material appear transparent. You can uniformly adjust the opacity of a material using its transparency property, or of all the content attached to a node using the node’s opacity property.By default, the transparent property’s contents object is a fully opaque black color, causing the property to have no visible effect. Setting the transparent property’s contents to any solid color uniformly fades the opacity of the material based on that color’s opacity value. To make parts of a material appear transparent, set the property’s contents to an image or other texture-mapped content whose alpha channel defines areas of full or partial opacity.Figure 1 shows a semitransparent material before and after providing a texture image for its transparent property. (To make the transparency effect more visible, a blue sphere is shown behind the transparent material.)Figure 1 Adding a transparent texture to a materialThe transparencyMode property controls how SceneKit interprets color information from the transparent property’s contents.Adding a transparent texture to a material
Public Methods
public addAnimationForKey(animation: CAAnimation, key: string): void source
Newly added animations begin executing after the current run loop cycle ends.SceneKit does not define any requirements for the contents of the key parameter—it need only be unique among the keys for other animations you add. If you add an animation with an existing key, this method overwrites the existing animation.
Params:
Name | Type | Attribute | Description |
animation | CAAnimation | The animation object to be added. |
|
key | string |
|
An string identifying the animation for later retrieval. You may pass nil if you don’t need to reference the animation later. |
Return:
void |
public animationForKey(key: string): CAAnimation source
Attempting to modify any properties of the returned object results in undefined behavior.
Params:
Name | Type | Attribute | Description |
key | string | A string identifying a previously added animation. |
public handleBindingOfSymbolHandler(symbol: string, block: SCNBindingBlock): void source
Use this method to associate a block with a SceneKit object (geometry or material) to handle setup of an attribute or uniform variable in a custom SCNProgram shader associated with that object. SceneKit calls your block before rendering the object. In the block, you can execute any OpenGL commands or other code necessary for preparing your custom shader. For example, the following block updates the time uniform variable in a custom fragment shader for producing animated effects:CFTimeInterval startTime = CFAbsoluteTimeGetCurrent(); [myNode.geometry.firstMaterial handleBindingOfSymbol:@"time" usingBlock: ^(unsigned int programID, unsigned int location, SCNNode renderedNode, SCNRenderer renderer) { glUniform1f(location, CFAbsoluteTimeGetCurrent() - startTime); }]; This method is for OpenGL shader programs only. To bind custom variable data for Metal shader programs, use the handleBinding(ofBufferNamed:frequency:handler:) method.CFTimeInterval startTime = CFAbsoluteTimeGetCurrent(); [myNode.geometry.firstMaterial handleBindingOfSymbol:@"time" usingBlock: ^(unsigned int programID, unsigned int location, SCNNode renderedNode, SCNRenderer renderer) { glUniform1f(location, CFAbsoluteTimeGetCurrent() - startTime); }];
Params:
Name | Type | Attribute | Description |
symbol | string | A GLSL uniform variable or attribute name. |
|
block | SCNBindingBlock |
|
A block to be called by SceneKit. |
Return:
void |
public handleUnbindingOfSymbolHandler(symbol: string, block: SCNBindingBlock): void source
Use this method to associate a block with a SceneKit object (geometry or material) to handle cleanup related to an attribute or uniform variable in a custom SCNProgram shader associated with that object. SceneKit will call your block after rendering the object. In the block, you can execute any OpenGL commands or other code necessary for post-rendering tasks.This method is for OpenGL shader programs only. To bind custom variable data for Metal shader programs, use the handleBinding(ofBufferNamed:frequency:handler:) method.
Params:
Name | Type | Attribute | Description |
symbol | string | A GLSL uniform variable or attribute name. |
|
block | SCNBindingBlock |
|
A block to be called by SceneKit. |
Return:
void |
public isAnimationPausedForKey(key: string): boolean source
Required. Returns a Boolean value indicating whether the animation attached to the object with the specified key is paused.
Params:
Name | Type | Attribute | Description |
key | string | A string identifying an attached animation. |
public pauseAnimationForKey(key: string): void source
This method has no effect if no animation is attached to the object with the specified key.
Params:
Name | Type | Attribute | Description |
key | string | A string identifying an attached animation. |
Return:
void |
public removeAllAnimations(): void source
Required. Removes all the animations currently attached to the object.
Return:
void |
public removeAnimationForKey(key: string): void source
Required. Removes the animation attached to the object with the specified key.
Params:
Name | Type | Attribute | Description |
key | string | A string identifying an attached animation to remove. |
Return:
void |
public removeAnimationForKeyFadeOutDuration(key: string, duration: number): void source
Use this method to create smooth transitions between the effects of multiple animations. For example, the geometry loaded from a scene file for a game character may have associated animations for player actions such as walking and jumping. When the player lands from a jump, you remove the jump animation so the character continues walking. If you use the removeAnimation(forKey:) method to remove the jump animation, SceneKit abruptly switches from the current frame of the jump animation to the current frame of the walk animation. If you use the removeAnimation(forKey:fadeOutDuration:) method instead, SceneKit plays both animations at once during that duration and interpolates vertex positions from one animation to the other, creating a smooth transition.
Return:
void |
public resumeAnimationForKey(key: string): void source
This method has no effect if no animation is attached to the object with the specified key or if the specified animation is not currently paused.
Params:
Name | Type | Attribute | Description |
key | string | A string identifying an attached animation. |
Return:
void |
public setValueForUndefinedKey(value: Object, key: string): void source
Subclasses can override this method to handle the request in some other way. The default implementation raises an NSUndefinedKeyException.
Override:
NSObject#setValueForUndefinedKeyReturn:
void |
public valueForUndefinedKey(key: string): Object source
Subclasses can override this method to return an alternate value for undefined keys. The default implementation raises an NSUndefinedKeyException.
Override:
NSObject#valueForUndefinedKeyParams:
Name | Type | Attribute | Description |
key | string | A string that is not equal to the name of any of the receiver's properties. |