---
title: "GLKMatrix4SetRow(_:_:_:)"
framework: GLKit
role: symbol
role_heading: Function
platforms: [iOS 5.0+, iPadOS 5.0+, macOS 10.8+, tvOS 9.0+]
path: "glkit/glkmatrix4setrow(_:_:_:)"
---

# GLKMatrix4SetRow(_:_:_:)

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

## Declaration

```swift
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

Return Value A new matrix.

## Discussion

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

## See Also

### Working With Parts of a Matrix

- [GLKMatrix4GetMatrix2(_:)](glkit/glkmatrix4getmatrix2(_:).md)
- [GLKMatrix4GetMatrix3(_:)](glkit/glkmatrix4getmatrix3(_:).md)
- [GLKMatrix4GetColumn(_:_:)](glkit/glkmatrix4getcolumn(_:_:).md)
- [GLKMatrix4GetRow(_:_:)](glkit/glkmatrix4getrow(_:_:).md)
- [GLKMatrix4SetColumn(_:_:_:)](glkit/glkmatrix4setcolumn(_:_:_:).md)
