mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-12-01 18:10:16 +00:00
Move some things to RSCore.
This commit is contained in:
1 parent
1ae75ce24b
commit
e7ea5eb5e6
16 files changed
+38
-40
No files matched your search
@@ -1,27 +0,0 @@
|
||||
//
|
||||
// Animations.swift
|
||||
// NetNewsWire-iOS
|
||||
//
|
||||
// Created by Maurice Parker on 1/27/20.
|
||||
// Copyright © 2020 Ranchero Software. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
/// Used to select which animations should be performed
|
||||
public struct Animations: OptionSet, Sendable {
|
||||
|
||||
/// Selections and deselections will be animated.
|
||||
public static let select = Animations(rawValue: 1)
|
||||
|
||||
/// Scrolling will be animated
|
||||
public static let scroll = Animations(rawValue: 2)
|
||||
|
||||
/// Pushing and popping navigation view controllers will be animated
|
||||
public static let navigation = Animations(rawValue: 4)
|
||||
|
||||
public let rawValue: Int
|
||||
public init(rawValue: Int) {
|
||||
self.rawValue = rawValue
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
//
|
||||
// Array-Extensions.swift
|
||||
// NetNewsWire-iOS
|
||||
//
|
||||
// Created by Maurice Parker on 4/28/19.
|
||||
// Copyright © 2019 Ranchero Software. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
extension Array where Element == CGRect {
|
||||
|
||||
func maxY() -> CGFloat {
|
||||
|
||||
var y: CGFloat = 0.0
|
||||
self.forEach { y = Swift.max(y, $0.maxY) }
|
||||
return y
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
//
|
||||
// Bundle-Extensions.swift
|
||||
// NetNewsWire-iOS
|
||||
//
|
||||
// Created by Maurice Parker on 4/26/19.
|
||||
// Copyright © 2019 Ranchero Software. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
extension Bundle {
|
||||
|
||||
var appName: String {
|
||||
return infoDictionary?["CFBundleName"] as! String
|
||||
}
|
||||
|
||||
var versionNumber: String {
|
||||
return infoDictionary?["CFBundleShortVersionString"] as! String
|
||||
}
|
||||
|
||||
var buildNumber: String {
|
||||
return infoDictionary?["CFBundleVersion"] as! String
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
//
|
||||
// CroppingPreviewParameters.swift
|
||||
// NetNewsWire-iOS
|
||||
//
|
||||
// Created by Maurice Parker on 11/23/19.
|
||||
// Copyright © 2019 Ranchero Software. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
final class CroppingPreviewParameters: UIPreviewParameters {
|
||||
|
||||
override init() {
|
||||
super.init()
|
||||
}
|
||||
|
||||
init(view: UIView) {
|
||||
super.init()
|
||||
let newBounds = CGRect(x: 1, y: 1, width: view.bounds.width - 2, height: view.bounds.height - 2)
|
||||
let visiblePath = UIBezierPath(roundedRect: newBounds, cornerRadius: 10)
|
||||
self.visiblePath = visiblePath
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
//
|
||||
// ImageHeaderView.swift
|
||||
// NetNewsWire-iOS
|
||||
//
|
||||
// Created by Maurice Parker on 11/3/19.
|
||||
// Copyright © 2019 Ranchero Software. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
final class ImageHeaderView: UITableViewHeaderFooterView {
|
||||
|
||||
static let rowHeight = CGFloat(integerLiteral: 88)
|
||||
|
||||
var imageView = UIImageView()
|
||||
|
||||
override init(reuseIdentifier: String?) {
|
||||
super.init(reuseIdentifier: reuseIdentifier)
|
||||
commonInit()
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
super.init(coder: coder)
|
||||
commonInit()
|
||||
}
|
||||
|
||||
func commonInit() {
|
||||
imageView.tintColor = UIColor.label
|
||||
imageView.contentMode = .scaleAspectFit
|
||||
addSubview(imageView)
|
||||
}
|
||||
|
||||
override func layoutSubviews() {
|
||||
let x = (bounds.width - 48.0) / 2
|
||||
let y = (bounds.height - 48.0) / 2
|
||||
imageView.frame = CGRect(x: x, y: y, width: 48.0, height: 48.0)
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
import Foundation
|
||||
import UIKit
|
||||
import RSCore
|
||||
|
||||
extension UICollectionView {
|
||||
/**
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import RSCore
|
||||
|
||||
extension UITableView {
|
||||
|
||||
|
||||
Reference in new issue
Block a user