<!--
{
  "availability" : [
    "iOS: 5.0.0 -",
    "iPadOS: 5.0.0 -",
    "macOS: 10.8.0 -",
    "tvOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GLKit",
  "identifier" : "/documentation/GLKit/GLKMatrix4SetRow(_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "GLKit"
    ],
    "preciseIdentifier" : "c:@F@GLKMatrix4SetRow"
  },
  "title" : "GLKMatrix4SetRow(_:_:_:)"
}
-->

# GLKMatrix4SetRow(_:_:_:)

Returns a new `4x4` matrix with one row replaced by a new vector.

```
func GLKMatrix4SetRow(_ matrix: GLKMatrix4, _ row: Int32, _ vector: GLKVector4) -> GLKMatrix4
```

## Parameters

`matrix`

The source matrix.

`row`

The index of the row to replace, which must be a number between `0` and `3`, inclusive.

`vector`

A vector holding the replacement component values.

## Return Value

A new matrix.

## Discussion

The last component of rows `0` through `2` correspond to the translation values `tx`, `ty`, and `tz`, respectively.

---

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)