mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-02-02 20:16:54 +01:00
Update for pending RSCore String updates
This commit is contained in:
parent
3c1668c178
commit
b35215d03b
@ -69,10 +69,10 @@ private extension FeedSpecifier {
|
|||||||
score = score + 50
|
score = score + 50
|
||||||
}
|
}
|
||||||
|
|
||||||
if urlString.rs_caseInsensitiveContains("comments") {
|
if urlString.caseInsensitiveContains("comments") {
|
||||||
score = score - 10
|
score = score - 10
|
||||||
}
|
}
|
||||||
if urlString.rs_caseInsensitiveContains("rss") {
|
if urlString.caseInsensitiveContains("rss") {
|
||||||
score = score + 5
|
score = score + 5
|
||||||
}
|
}
|
||||||
if urlString.hasSuffix("/feed/") {
|
if urlString.hasSuffix("/feed/") {
|
||||||
@ -81,15 +81,15 @@ private extension FeedSpecifier {
|
|||||||
if urlString.hasSuffix("/feed") {
|
if urlString.hasSuffix("/feed") {
|
||||||
score = score + 4
|
score = score + 4
|
||||||
}
|
}
|
||||||
if urlString.rs_caseInsensitiveContains("json") {
|
if urlString.caseInsensitiveContains("json") {
|
||||||
score = score + 6
|
score = score + 6
|
||||||
}
|
}
|
||||||
|
|
||||||
if let title = title {
|
if let title = title {
|
||||||
if title.rs_caseInsensitiveContains("comments") {
|
if title.caseInsensitiveContains("comments") {
|
||||||
score = score - 10
|
score = score - 10
|
||||||
}
|
}
|
||||||
if title.rs_caseInsensitiveContains("json") {
|
if title.caseInsensitiveContains("json") {
|
||||||
score = score + 1
|
score = score + 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ class HTMLFeedFinder {
|
|||||||
for oneBodyLink in bodyLinks {
|
for oneBodyLink in bodyLinks {
|
||||||
|
|
||||||
if linkMightBeFeed(oneBodyLink) {
|
if linkMightBeFeed(oneBodyLink) {
|
||||||
let normalizedURL = oneBodyLink.urlString.rs_normalizedURL()
|
let normalizedURL = oneBodyLink.urlString.normalizedURL
|
||||||
let oneFeedSpecifier = FeedSpecifier(title: oneBodyLink.text, urlString: normalizedURL, source: .HTMLLink)
|
let oneFeedSpecifier = FeedSpecifier(title: oneBodyLink.text, urlString: normalizedURL, source: .HTMLLink)
|
||||||
addFeedSpecifier(oneFeedSpecifier)
|
addFeedSpecifier(oneFeedSpecifier)
|
||||||
}
|
}
|
||||||
|
@ -183,9 +183,9 @@ extension Folder: OPMLRepresentable {
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
let escapedTitle = nameForDisplay.rs_stringByEscapingSpecialXMLCharacters()
|
let escapedTitle = nameForDisplay.escapingSpecialXMLCharacters
|
||||||
var s = "<outline text=\"\(escapedTitle)\" title=\"\(escapedTitle)\"\(attrExternalID)>\n"
|
var s = "<outline text=\"\(escapedTitle)\" title=\"\(escapedTitle)\"\(attrExternalID)>\n"
|
||||||
s = s.rs_string(byPrependingNumberOfTabs: indentLevel)
|
s = s.prepending(tabCount: indentLevel)
|
||||||
|
|
||||||
var hasAtLeastOneChild = false
|
var hasAtLeastOneChild = false
|
||||||
|
|
||||||
@ -196,11 +196,11 @@ extension Folder: OPMLRepresentable {
|
|||||||
|
|
||||||
if !hasAtLeastOneChild {
|
if !hasAtLeastOneChild {
|
||||||
s = "<outline text=\"\(escapedTitle)\" title=\"\(escapedTitle)\"\(attrExternalID)/>\n"
|
s = "<outline text=\"\(escapedTitle)\" title=\"\(escapedTitle)\"\(attrExternalID)/>\n"
|
||||||
s = s.rs_string(byPrependingNumberOfTabs: indentLevel)
|
s = s.prepending(tabCount: indentLevel)
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
s = s + NSString.rs_string(withNumberOfTabs: indentLevel) + "</outline>\n"
|
s = s + String(tabCount: indentLevel) + "</outline>\n"
|
||||||
|
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
@ -125,7 +125,7 @@ private extension OPMLFile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func opmlDocument() -> String {
|
func opmlDocument() -> String {
|
||||||
let escapedTitle = account.nameForDisplay.rs_stringByEscapingSpecialXMLCharacters()
|
let escapedTitle = account.nameForDisplay.escapingSpecialXMLCharacters
|
||||||
let openingText =
|
let openingText =
|
||||||
"""
|
"""
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
@ -43,7 +43,7 @@ public final class WebFeed: Feed, Renamable, Hashable {
|
|||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
if let url = newValue, !url.isEmpty {
|
if let url = newValue, !url.isEmpty {
|
||||||
metadata.homePageURL = url.rs_normalizedURL()
|
metadata.homePageURL = url.normalizedURL
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
metadata.homePageURL = nil
|
metadata.homePageURL = nil
|
||||||
@ -256,16 +256,16 @@ extension WebFeed: OPMLRepresentable {
|
|||||||
if nameToUse == nil {
|
if nameToUse == nil {
|
||||||
nameToUse = ""
|
nameToUse = ""
|
||||||
}
|
}
|
||||||
let escapedName = nameToUse!.rs_stringByEscapingSpecialXMLCharacters()
|
let escapedName = nameToUse!.escapingSpecialXMLCharacters
|
||||||
|
|
||||||
var escapedHomePageURL = ""
|
var escapedHomePageURL = ""
|
||||||
if let homePageURL = homePageURL {
|
if let homePageURL = homePageURL {
|
||||||
escapedHomePageURL = homePageURL.rs_stringByEscapingSpecialXMLCharacters()
|
escapedHomePageURL = homePageURL.escapingSpecialXMLCharacters
|
||||||
}
|
}
|
||||||
let escapedFeedURL = url.rs_stringByEscapingSpecialXMLCharacters()
|
let escapedFeedURL = url.escapingSpecialXMLCharacters
|
||||||
|
|
||||||
var s = "<outline text=\"\(escapedName)\" title=\"\(escapedName)\" description=\"\" type=\"rss\" version=\"RSS\" htmlUrl=\"\(escapedHomePageURL)\" xmlUrl=\"\(escapedFeedURL)\"/>\n"
|
var s = "<outline text=\"\(escapedName)\" title=\"\(escapedName)\" description=\"\" type=\"rss\" version=\"RSS\" htmlUrl=\"\(escapedHomePageURL)\" xmlUrl=\"\(escapedFeedURL)\"/>\n"
|
||||||
s = s.rs_string(byPrependingNumberOfTabs: indentLevel)
|
s = s.prepending(tabCount: indentLevel)
|
||||||
|
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ public func databaseIDWithString(_ s: String) -> String {
|
|||||||
return identifier
|
return identifier
|
||||||
}
|
}
|
||||||
|
|
||||||
let identifier = (s as NSString).rs_md5Hash()
|
let identifier = s.md5HashString
|
||||||
databaseIDCache[s] = identifier
|
databaseIDCache[s] = identifier
|
||||||
return identifier
|
return identifier
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ final class ArticleSearchInfo: Hashable {
|
|||||||
|
|
||||||
lazy var bodyForIndex: String = {
|
lazy var bodyForIndex: String = {
|
||||||
let s = preferredText.rsparser_stringByDecodingHTMLEntities()
|
let s = preferredText.rsparser_stringByDecodingHTMLEntities()
|
||||||
return s.rs_string(byStrippingHTML: 0).rs_stringWithCollapsedWhitespace()
|
return s.strippingHTML().collapsingWhitespace
|
||||||
}()
|
}()
|
||||||
|
|
||||||
init(articleID: String, title: String?, contentHTML: String?, contentText: String?, summary: String?, searchRowID: Int?) {
|
init(articleID: String, title: String?, contentHTML: String?, contentText: String?, summary: String?, searchRowID: Int?) {
|
||||||
|
@ -30,7 +30,7 @@ struct CrashLog {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
self.content = s
|
self.content = s
|
||||||
self.contentHash = s.rs_md5Hash()
|
self.contentHash = s.md5HashString
|
||||||
self.path = path
|
self.path = path
|
||||||
self.modificationDate = modificationDate
|
self.modificationDate = modificationDate
|
||||||
}
|
}
|
||||||
|
@ -99,7 +99,7 @@ private extension AddFeedController {
|
|||||||
|
|
||||||
var urlStringFromPasteboard: String? {
|
var urlStringFromPasteboard: String? {
|
||||||
if let urlString = NSPasteboard.urlString(from: NSPasteboard.general) {
|
if let urlString = NSPasteboard.urlString(from: NSPasteboard.general) {
|
||||||
return urlString.rs_normalizedURL()
|
return urlString.normalizedURL
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ class AddFeedWindowController : NSWindowController {
|
|||||||
|
|
||||||
private var userEnteredTitle: String? {
|
private var userEnteredTitle: String? {
|
||||||
var s = nameTextField.stringValue
|
var s = nameTextField.stringValue
|
||||||
s = s.rs_stringWithCollapsedWhitespace()
|
s = s.collapsingWhitespace
|
||||||
if s.isEmpty {
|
if s.isEmpty {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -93,7 +93,7 @@ class AddFeedWindowController : NSWindowController {
|
|||||||
|
|
||||||
@IBAction func addFeed(_ sender: Any?) {
|
@IBAction func addFeed(_ sender: Any?) {
|
||||||
let urlString = urlTextField.stringValue
|
let urlString = urlTextField.stringValue
|
||||||
let normalizedURLString = (urlString as NSString).rs_normalizedURL()
|
let normalizedURLString = urlString.normalizedURL
|
||||||
|
|
||||||
if normalizedURLString.isEmpty {
|
if normalizedURLString.isEmpty {
|
||||||
cancelSheet()
|
cancelSheet()
|
||||||
@ -130,7 +130,7 @@ class AddFeedWindowController : NSWindowController {
|
|||||||
private extension AddFeedWindowController {
|
private extension AddFeedWindowController {
|
||||||
|
|
||||||
private func updateUI() {
|
private func updateUI() {
|
||||||
addButton.isEnabled = urlTextField.stringValue.rs_stringMayBeURL()
|
addButton.isEnabled = urlTextField.stringValue.mayBeURL
|
||||||
}
|
}
|
||||||
|
|
||||||
func cancelSheet() {
|
func cancelSheet() {
|
||||||
|
@ -67,7 +67,7 @@ private extension DetailStatusBarView {
|
|||||||
|
|
||||||
func updateLinkForDisplay() {
|
func updateLinkForDisplay() {
|
||||||
if let mouseoverLink = mouseoverLink, !mouseoverLink.isEmpty {
|
if let mouseoverLink = mouseoverLink, !mouseoverLink.isEmpty {
|
||||||
linkForDisplay = (mouseoverLink as NSString).rs_stringByStrippingHTTPOrHTTPSScheme()
|
linkForDisplay = mouseoverLink.strippingHTTPOrHTTPSScheme
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
linkForDisplay = nil
|
linkForDisplay = nil
|
||||||
|
@ -95,18 +95,18 @@ private struct NNW3Folder {
|
|||||||
extension NNW3Folder: OPMLRepresentable {
|
extension NNW3Folder: OPMLRepresentable {
|
||||||
|
|
||||||
func OPMLString(indentLevel: Int, allowCustomAttributes: Bool) -> String {
|
func OPMLString(indentLevel: Int, allowCustomAttributes: Bool) -> String {
|
||||||
let t = title?.rs_stringByEscapingSpecialXMLCharacters() ?? ""
|
let t = title?.escapingSpecialXMLCharacters ?? ""
|
||||||
guard let children = children else {
|
guard let children = children else {
|
||||||
// Empty folder.
|
// Empty folder.
|
||||||
return "<outline text=\"\(t)\" title=\"\(t)\" />\n".rs_string(byPrependingNumberOfTabs: indentLevel)
|
return "<outline text=\"\(t)\" title=\"\(t)\" />\n".prepending(tabCount: indentLevel)
|
||||||
}
|
}
|
||||||
|
|
||||||
var s = "<outline text=\"\(t)\" title=\"\(t)\">\n".rs_string(byPrependingNumberOfTabs: indentLevel)
|
var s = "<outline text=\"\(t)\" title=\"\(t)\">\n".prepending(tabCount: indentLevel)
|
||||||
for child in children {
|
for child in children {
|
||||||
s += child.OPMLString(indentLevel: indentLevel + 1)
|
s += child.OPMLString(indentLevel: indentLevel + 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
s += "</outline>\n".rs_string(byPrependingNumberOfTabs: indentLevel)
|
s += "</outline>\n".prepending(tabCount: indentLevel)
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -131,12 +131,12 @@ private struct NNW3Feed {
|
|||||||
extension NNW3Feed: OPMLRepresentable {
|
extension NNW3Feed: OPMLRepresentable {
|
||||||
|
|
||||||
func OPMLString(indentLevel: Int, allowCustomAttributes: Bool) -> String {
|
func OPMLString(indentLevel: Int, allowCustomAttributes: Bool) -> String {
|
||||||
let t = title?.rs_stringByEscapingSpecialXMLCharacters() ?? ""
|
let t = title?.escapingSpecialXMLCharacters ?? ""
|
||||||
let p = homePageURL?.rs_stringByEscapingSpecialXMLCharacters() ?? ""
|
let p = homePageURL?.escapingSpecialXMLCharacters ?? ""
|
||||||
let f = feedURL?.rs_stringByEscapingSpecialXMLCharacters() ?? ""
|
let f = feedURL?.escapingSpecialXMLCharacters ?? ""
|
||||||
|
|
||||||
var s = "<outline text=\"\(t)\" title=\"\(t)\" description=\"\" type=\"rss\" version=\"RSS\" htmlUrl=\"\(p)\" xmlUrl=\"\(f)\"/>\n"
|
var s = "<outline text=\"\(t)\" title=\"\(t)\" description=\"\" type=\"rss\" version=\"RSS\" htmlUrl=\"\(p)\" xmlUrl=\"\(f)\"/>\n"
|
||||||
s = s.rs_string(byPrependingNumberOfTabs: indentLevel)
|
s = s.prepending(tabCount: indentLevel)
|
||||||
|
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
@ -37,9 +37,9 @@ struct PasteboardWebFeed: Hashable {
|
|||||||
let isLocalFeed: Bool
|
let isLocalFeed: Bool
|
||||||
|
|
||||||
init(url: String, webFeedID: String?, homePageURL: String?, name: String?, editedName: String?, accountID: String?, accountType: AccountType?) {
|
init(url: String, webFeedID: String?, homePageURL: String?, name: String?, editedName: String?, accountID: String?, accountType: AccountType?) {
|
||||||
self.url = url.rs_normalizedURL()
|
self.url = url.normalizedURL
|
||||||
self.webFeedID = webFeedID
|
self.webFeedID = webFeedID
|
||||||
self.homePageURL = homePageURL?.rs_normalizedURL()
|
self.homePageURL = homePageURL?.normalizedURL
|
||||||
self.name = name
|
self.name = name
|
||||||
self.editedName = editedName
|
self.editedName = editedName
|
||||||
self.accountID = accountID
|
self.accountID = accountID
|
||||||
@ -93,7 +93,7 @@ struct PasteboardWebFeed: Hashable {
|
|||||||
}
|
}
|
||||||
if let foundType = pasteboardType {
|
if let foundType = pasteboardType {
|
||||||
if let possibleURLString = pasteboardItem.string(forType: foundType) {
|
if let possibleURLString = pasteboardItem.string(forType: foundType) {
|
||||||
if possibleURLString.rs_stringMayBeURL() {
|
if possibleURLString.mayBeURL {
|
||||||
self.init(url: possibleURLString, webFeedID: nil, homePageURL: nil, name: nil, editedName: nil, accountID: nil, accountType: nil)
|
self.init(url: possibleURLString, webFeedID: nil, homePageURL: nil, name: nil, editedName: nil, accountID: nil, accountType: nil)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ private extension ArticlePasteboardWriter {
|
|||||||
s += "\(summary)\n\n"
|
s += "\(summary)\n\n"
|
||||||
}
|
}
|
||||||
else if let html = article.contentHTML {
|
else if let html = article.contentHTML {
|
||||||
let convertedHTML = html.rs_stringByConvertingToPlainText()
|
let convertedHTML = html.convertingToPlainText()
|
||||||
s += "\(convertedHTML)\n\n"
|
s += "\(convertedHTML)\n\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,7 +177,7 @@ private struct RSSReader: Hashable {
|
|||||||
let name = (path as NSString).lastPathComponent
|
let name = (path as NSString).lastPathComponent
|
||||||
self.name = name
|
self.name = name
|
||||||
if name.hasSuffix(".app") {
|
if name.hasSuffix(".app") {
|
||||||
self.nameMinusAppSuffix = name.rs_string(byStrippingSuffix: ".app", caseSensitive: false)
|
self.nameMinusAppSuffix = name.stripping(suffix: ".app")
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
self.nameMinusAppSuffix = name
|
self.nameMinusAppSuffix = name
|
||||||
|
@ -44,8 +44,8 @@ extension AppDelegate : AppDelegateAppleEvents {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
let normalizedURLString = urlString.rs_normalizedURL()
|
let normalizedURLString = urlString.normalizedURL
|
||||||
if !normalizedURLString.rs_stringMayBeURL() {
|
if !normalizedURLString.mayBeURL {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -159,7 +159,7 @@ private func filenameWithStyleSuffixRemoved(_ filename: String) -> String {
|
|||||||
|
|
||||||
for oneSuffix in styleSuffixes {
|
for oneSuffix in styleSuffixes {
|
||||||
if filename.hasSuffix(oneSuffix) {
|
if filename.hasSuffix(oneSuffix) {
|
||||||
return (filename as NSString).rs_string(byStrippingSuffix: oneSuffix, caseSensitive: false)
|
return filename.stripping(suffix: oneSuffix)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,8 +65,8 @@ struct ArticleStringFormatter {
|
|||||||
s = s.replacingOccurrences(of: "\r", with: "")
|
s = s.replacingOccurrences(of: "\r", with: "")
|
||||||
s = s.replacingOccurrences(of: "\t", with: "")
|
s = s.replacingOccurrences(of: "\t", with: "")
|
||||||
s = s.rsparser_stringByDecodingHTMLEntities()
|
s = s.rsparser_stringByDecodingHTMLEntities()
|
||||||
s = s.rs_stringByTrimmingWhitespace()
|
s = s.trimmingWhitespace
|
||||||
s = s.rs_stringWithCollapsedWhitespace()
|
s = s.collapsingWhitespace
|
||||||
|
|
||||||
let maxLength = 1000
|
let maxLength = 1000
|
||||||
if s.count < maxLength {
|
if s.count < maxLength {
|
||||||
@ -89,9 +89,9 @@ struct ArticleStringFormatter {
|
|||||||
return cachedBody
|
return cachedBody
|
||||||
}
|
}
|
||||||
var s = body.rsparser_stringByDecodingHTMLEntities()
|
var s = body.rsparser_stringByDecodingHTMLEntities()
|
||||||
s = s.rs_string(byStrippingHTML: 250)
|
s = s.strippingHTML(maxCharacters: 250)
|
||||||
s = s.rs_stringByTrimmingWhitespace()
|
s = s.trimmingWhitespace
|
||||||
s = s.rs_stringWithCollapsedWhitespace()
|
s = s.collapsingWhitespace
|
||||||
if s == "Comments" { // Hacker News.
|
if s == "Comments" { // Hacker News.
|
||||||
s = ""
|
s = ""
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ struct OPMLExporter {
|
|||||||
|
|
||||||
static func OPMLString(with account: Account, title: String) -> String {
|
static func OPMLString(with account: Account, title: String) -> String {
|
||||||
|
|
||||||
let escapedTitle = title.rs_stringByEscapingSpecialXMLCharacters()
|
let escapedTitle = title.escapingSpecialXMLCharacters
|
||||||
let openingText =
|
let openingText =
|
||||||
"""
|
"""
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
@ -6,7 +6,12 @@
|
|||||||
// Copyright © 2019 Ranchero Software. All rights reserved.
|
// Copyright © 2019 Ranchero Software. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
#if os(macOS)
|
||||||
|
import AppKit
|
||||||
|
#else
|
||||||
|
import UIKit
|
||||||
|
#endif
|
||||||
|
|
||||||
import RSCore
|
import RSCore
|
||||||
|
|
||||||
extension RSImage {
|
extension RSImage {
|
||||||
|
@ -114,7 +114,7 @@ final class FaviconDownloader {
|
|||||||
|
|
||||||
func favicon(withHomePageURL homePageURL: String) -> IconImage? {
|
func favicon(withHomePageURL homePageURL: String) -> IconImage? {
|
||||||
|
|
||||||
let url = homePageURL.rs_normalizedURL()
|
let url = homePageURL.normalizedURL
|
||||||
|
|
||||||
if let url = URL(string: homePageURL) {
|
if let url = URL(string: homePageURL) {
|
||||||
if url.host == "nnw.ranchero.com" {
|
if url.host == "nnw.ranchero.com" {
|
||||||
|
@ -34,7 +34,7 @@ final class SingleFaviconDownloader {
|
|||||||
private let queue: DispatchQueue
|
private let queue: DispatchQueue
|
||||||
|
|
||||||
private var diskKey: String {
|
private var diskKey: String {
|
||||||
return (faviconURL as NSString).rs_md5Hash()
|
return faviconURL.md5HashString
|
||||||
}
|
}
|
||||||
|
|
||||||
init(faviconURL: String, homePageURL: String?, diskCache: BinaryDiskCache, queue: DispatchQueue) {
|
init(faviconURL: String, homePageURL: String?, diskCache: BinaryDiskCache, queue: DispatchQueue) {
|
||||||
|
@ -128,7 +128,7 @@ private extension ImageDownloader {
|
|||||||
|
|
||||||
func diskKey(_ url: String) -> String {
|
func diskKey(_ url: String) -> String {
|
||||||
|
|
||||||
return (url as NSString).rs_md5Hash()
|
return url.md5HashString
|
||||||
}
|
}
|
||||||
|
|
||||||
func postImageDidBecomeAvailableNotification(_ url: String) {
|
func postImageDidBecomeAvailableNotification(_ url: String) {
|
||||||
|
@ -30,9 +30,9 @@ class AddWebFeedViewController: UITableViewController, AddContainerViewControlle
|
|||||||
|
|
||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
|
|
||||||
if initialFeed == nil, let urlString = UIPasteboard.general.string as NSString? {
|
if initialFeed == nil, let urlString = UIPasteboard.general.string {
|
||||||
if urlString.rs_stringMayBeURL() {
|
if urlString.mayBeURL {
|
||||||
initialFeed = urlString.rs_normalizedURL()
|
initialFeed = urlString.normalizedURL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ class AddWebFeedViewController: UITableViewController, AddContainerViewControlle
|
|||||||
func add() {
|
func add() {
|
||||||
|
|
||||||
let urlString = urlTextField.text ?? ""
|
let urlString = urlTextField.text ?? ""
|
||||||
let normalizedURLString = (urlString as NSString).rs_normalizedURL()
|
let normalizedURLString = urlString.normalizedURL
|
||||||
|
|
||||||
guard !normalizedURLString.isEmpty, let url = URL(string: normalizedURLString) else {
|
guard !normalizedURLString.isEmpty, let url = URL(string: normalizedURLString) else {
|
||||||
delegate?.processingDidCancel()
|
delegate?.processingDidCancel()
|
||||||
@ -118,7 +118,7 @@ class AddWebFeedViewController: UITableViewController, AddContainerViewControlle
|
|||||||
}
|
}
|
||||||
|
|
||||||
@objc func textDidChange(_ note: Notification) {
|
@objc func textDidChange(_ note: Notification) {
|
||||||
delegate?.readyToAdd(state: urlTextField.text?.rs_stringMayBeURL() ?? false)
|
delegate?.readyToAdd(state: urlTextField.text?.mayBeURL ?? false)
|
||||||
}
|
}
|
||||||
|
|
||||||
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user