---
title: "NSProtocolFromString(_:)"
framework: foundation
role: symbol
role_heading: Function
path: "foundation/nsprotocolfromstring(_:)"
---

# NSProtocolFromString(_:)

Returns a the protocol with a given name.

## Declaration

```swift
func NSProtocolFromString(_ namestr: String) -> Protocol?
```

## Parameters

- `namestr`: The name of a protocol.

## Return Value

Return Value The protocol object named by namestr, or nil if no protocol by that name is currently loaded. If namestr is nil, returns nil.

## See Also

### Type Lookup

- [NSClassFromString(_:)](foundation/nsclassfromstring(_:).md)
- [NSStringFromClass(_:)](foundation/nsstringfromclass(_:).md)
- [NSSelectorFromString(_:)](foundation/nsselectorfromstring(_:).md)
- [NSStringFromSelector(_:)](foundation/nsstringfromselector(_:).md)
- [NSStringFromProtocol(_:)](foundation/nsstringfromprotocol(_:).md)
