mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-23 16:20:53 +01:00
f58ac4d160
Also removes `tel` scheme handling.
19 lines
410 B
Swift
19 lines
410 B
Swift
//
|
|
// URL-Extensions.swift
|
|
// NetNewsWire
|
|
//
|
|
// Created by Stuart Breckenridge on 03/05/2020.
|
|
// Copyright © 2020 Ranchero Software. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
extension URL {
|
|
|
|
/// Extracts email address from a `URL` with a `mailto` scheme, otherwise `nil`.
|
|
var emailAddress: String? {
|
|
scheme == "mailto" ? URLComponents(url: self, resolvingAgainstBaseURL: false)?.path : nil
|
|
}
|
|
|
|
}
|