mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Merge branch 'ios-release'
This commit is contained in:
18
Shared/Extensions/URL-Extensions.swift
Normal file
18
Shared/Extensions/URL-Extensions.swift
Normal file
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// 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
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user