mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Implement custom previews for context menus to crop cell separators. Issue #1221
This commit is contained in:
20
iOS/UIKit Extensions/CroppingTargetedPreview.swift
Normal file
20
iOS/UIKit Extensions/CroppingTargetedPreview.swift
Normal file
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// CroppingPreviewParameters.swift
|
||||
// NetNewsWire-iOS
|
||||
//
|
||||
// Created by Maurice Parker on 11/23/19.
|
||||
// Copyright © 2019 Ranchero Software. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class CroppingPreviewParameters: UIPreviewParameters {
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user