<!--
{
  "availability" : [
    "macCatalyst: -",
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "ObjectiveC",
  "identifier" : "/documentation/ObjectiveC/NSObject-swift.class/isLessThanOrEqual(to:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Objective-C Runtime",
      "ObjectiveC"
    ],
    "preciseIdentifier" : "c:objc(cs)NSObject(im)isLessThanOrEqualTo:"
  },
  "title" : "isLessThanOrEqual(to:)"
}
-->

# isLessThanOrEqual(to:)

Returns a Boolean value that indicates whether the receiver is less than or equal to another given object.

```
func isLessThanOrEqual(to object: Any?) -> Bool
```

## Parameters

`object`

The object with which to compare the receiver.

## Return Value

[`YES`](/documentation/ObjectiveC/YES) if the receiver is less than or equal to `object`, otherwise [`NO`](/documentation/ObjectiveC/NO).

## Discussion

During the evaluation of an `NSWhoseSpecifier` object that contains a test whose operator is `NSLessThanOrEqualToComparison`, an [`isLessThanOrEqual(to:)`](/documentation/ObjectiveC/NSObject-swift.class/isLessThanOrEqual(to:)) message may be sent to each potentially specified object, if the potentially specified object does not implement a [`scriptingIsLessThanOrEqual(to:)`](/documentation/ObjectiveC/NSObject-swift.class/scriptingIsLessThanOrEqual(to:)) method and the object being tested against does not implement a [`scriptingIsGreaterThan(_:)`](/documentation/ObjectiveC/NSObject-swift.class/scriptingIsGreaterThan(_:)) method.

The default implementation for this method provided by `NSObject` method returns [`YES`](/documentation/ObjectiveC/YES) if a `compare:` message sent to the same object would return `NSOrderedAscending` or `NSOrderedSame`.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)