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
You are an excellent, logical, programmer. You are currently acting as my programming assistant. | |
Please keep the initial response short and to the point. | |
If a more lengthy reply and more details are needed it will be asked for. | |
- Follow the user's requirements carefully & to the letter. | |
- First think step-by-step. | |
- Briefly describe your plan for what to build in psuedocode, written out in detail. | |
- Then output the code in a single codeblock. | |
- Minimize any other prose and try to answer concisely, while still fully answering the request. |
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
// | |
// TappableUILabelDemoViewController.swift | |
// Label Link Test | |
// | |
// Created by Kyle Howells on 2024-03-20. | |
// | |
import UIKit | |
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
// Setup Label | |
let label: UILabel = { | |
let label = UILabel() | |
label.isUserInteractionEnabled = true | |
label.adjustsFontSizeToFitWidth = true | |
label.numberOfLines = 0 | |
label.textColor = UIColor(white: 0, alpha: 1) |
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 | |
// MARK: - WaveView | |
class WaveView: UIView { | |
private var shapeLayer: CAShapeLayer = CAShapeLayer() | |
// MARK: - Animation Properties | |
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 SceneKit | |
struct SceneKitBoundingBox { | |
let backLeftTop: SCNVector3 | |
let backLeftBottom: SCNVector3 | |
let backRightTop: SCNVector3 | |
let backRightBottom: SCNVector3 | |
let frontLeftTop: SCNVector3 |
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 | |
extension UIResponder { | |
private weak static var _currentFirstResponder: UIResponder? = nil | |
public static var current: UIResponder? { | |
UIResponder._currentFirstResponder = nil | |
UIApplication.shared.sendAction(#selector(findFirstResponder(sender:)), to: nil, from: nil, for: nil) | |
return UIResponder._currentFirstResponder | |
} |
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
private func AVMakeRectFill(aspectRatio: CGSize, insideRect boundingRect: CGRect) -> CGRect { | |
let targetSize = boundingRect.size | |
if targetSize == .zero { | |
return .zero | |
} | |
let widthRatio = targetSize.width / aspectRatio.width | |
let heightRatio = targetSize.height / aspectRatio.height | |
let scalingFactor = max(widthRatio, heightRatio) | |
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
// | |
// MP4Exporter.swift | |
// Code Examples | |
// | |
// Created by Kyle Howells on 03/07/2022. | |
// | |
import Foundation | |
import UIKit | |
import AVFoundation |
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 CoreGraphics | |
import UIKit | |
import AVFoundation | |
extension UIImage { | |
func resized(within newSize: CGSize, outputScale: CGFloat? = nil) -> UIImage { | |
let originalSize = self.size | |
let withinBounds = CGRect(x: 0, y: 0, width: newSize.width, height: newSize.height) |
NewerOlder