/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SwiftUI.framework/Modules/SwiftUI.swiftmodule/arm64-apple-ios.swiftinterface
This file contains 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 | |
@available(iOS 15, *) | |
struct Slider: View { | |
enum SliderPreferenceKey: PreferenceKey { | |
static var defaultValue: CGRect = .zero |
This file contains 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 UIKit | |
// http://easings.net/ | |
@available(iOS 10.0, *) | |
extension UICubicTimingParameters { | |
public class func easeInSine() -> UICubicTimingParameters { return UICubicTimingParameters(0.47, 0, 0.745, 0.715) } | |
public class func easeOutSine() -> UICubicTimingParameters { return UICubicTimingParameters(0.39, 0.575, 0.565, 1) } | |
public class func easeInOutSine() -> UICubicTimingParameters { return UICubicTimingParameters(0.445, 0.05, 0.55, 0.95) } | |
public class func easeInQuad() -> UICubicTimingParameters { return UICubicTimingParameters(0.55, 0.085, 0.68, 0.53) } |
This file contains 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
- (void)bounceAnimation:(void (^)())completion | |
{ | |
CGRect rect = self.frame; | |
CGRect insetRect = CGRectInset(rect, 10, 10); | |
self.frame = insetRect; | |
[UIView animateWithDuration:1 delay:0 usingSpringWithDamping:0.4 initialSpringVelocity:0 options:UIViewAnimationOptionCurveEaseOut animations:^{ | |
self.frame = rect; | |
} completion:^(BOOL finished) { |
This file contains 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 UIView { | |
public class func findByAccessibilityIdentifier(identifier: String) -> UIView? { | |
guard let window = UIApplication.sharedApplication().keyWindow else { | |
return nil | |
} | |
func findByID(view: UIView, _ id: String) -> UIView? { | |
if view.accessibilityIdentifier == id { return view } | |
for v in view.subviews { |
This file contains 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
// | |
// MTKCIImageView.swift | |
// Fil | |
// | |
// Created by Muukii on 9/27/15. | |
// Copyright © 2015 muukii. All rights reserved. | |
// | |
import Foundation | |
import Metal |
This file contains 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 | |
import Foundation | |
extension View { | |
func snapshot(scale: CGFloat) -> UIImage { | |
let controller = UIHostingController(rootView: self) | |
let view = controller.view | |
let targetSize = controller.view.intrinsicContentSize | |
view?.bounds = CGRect(origin: .zero, size: targetSize) |
This file contains 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
let backgroundView = UIView.mock(backgroundColor: .neon(.violet)) | |
let box1 = UIView.mock(backgroundColor: .neon(.red), preferredSize: .largeSquare) | |
let box2 = UIView.mock(backgroundColor: .neon(.yellow), preferredSize: .largeSquare) | |
view.addSubview(backgroundView) | |
view.addSubview(box1) | |
view.addSubview(box2) | |
mondrianBatchLayout { |
This file contains 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
HStackBlock(spacing: 10) { | |
box2 | |
box1 | |
} |
This file contains 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
let backgroundView = UIView.mock(backgroundColor: .neon(.violet)) | |
let box1 = UIView.mock(backgroundColor: .neon(.red), preferredSize: .largeSquare) | |
let box2 = UIView.mock(backgroundColor: .neon(.yellow), preferredSize: .largeSquare) | |
view.mondrian.buildSubviews { | |
HStackBlock(spacing: 10) { | |
box1 | |
box2 | |
} | |
.padding(10) |
NewerOlder