This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension XCTestCase { | |
func isDeallocated<T: AnyObject>(_ object: inout T?) -> Bool { | |
weak var _object: T? | |
autoreleasepool { | |
_object = object | |
object = nil |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func allocationViewModel<T: AnyObject>(_ viewModel: inout T?, as name: String) { | |
weak var _viewModel: T? | |
autoreleasepool { | |
_viewModel = viewModel | |
viewModel = nil | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct FrameLayout: Layout { | |
let frame: CGRect | |
func sizeThatFits(proposal: ProposedViewSize, subviews: Subviews, cache: inout ()) -> CGSize { | |
CGSize( | |
width: proposal.width ?? 0.0, | |
height: proposal.height ?? 0.0 | |
) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct ContentView: View { | |
@State private var contentMode: ContentMode = .fit | |
var body: some View { | |
ZStack { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct ContentView: View { | |
@State private var isDragging: Bool = false | |
@GestureState private var isDraggingActive: Bool = false | |
var body: some View { | |
ZStack { | |
if isDragging { |
OlderNewer