The scheme URL component, or nil
if not present.
SDKs
- iOS 7.0+
- macOS 10.9+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Foundation
Declaration
@property(copy) NSString *scheme;
Discussion
For example, in the URL http://www
, the scheme is http
.
If you attempt to set the scheme to an invalid scheme string, this class throws an exception.
Note
The term “protocol” is also sometimes used when talking about network-based URL schemes. However, not all URL schemes are networking protocols—data://
URLs, for example.