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
@propertyWrapper | |
public struct InvalidateBody<T> { | |
private var value: T | |
weak var storage: UIViewController? | |
let selector: Selector | |
public var wrappedValue: T { | |
get { value } | |
set { |
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 subprocess | |
def looksLikeBeginning(doc,seg,adr): | |
if isinstance(seg.getNameAtAddress(adr), str): | |
label = seg.getNameAtAddress(adr) | |
pos = label.find("_T") | |
if pos != -1: | |
return label[pos:] | |
return None |
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
public static func generateImageOfLetterInRectangleOfSize( | |
letter: Character, | |
backgroundColor: UIColor, | |
letterColor: UIColor, | |
width: CGFloat, | |
height: CGFloat | |
) -> UIImage { | |
let size = CGSize(width: width, height: height) | |
let renderer = UIGraphicsImageRenderer(size: size) | |
let image = renderer.image { context in |
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 | |
class ShapeView: UIView { | |
private var topTrapezoidPath: UIBezierPath! | |
private var bottomTrapezoidPath: UIBezierPath! | |
private var leftTrapezoidPath: UIBezierPath! | |
private var rightTrapezoidPath: UIBezierPath! | |
private var rectanglePath: UIBezierPath! | |
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
created_at: Sun, 11 Jun 2023 13:31:06 GMT, Xcode 15.0.0-beta | |
Swift-macros quick notes | |
Related videos: | |
- [WWDC23 What’s new in Swift](https://developer.apple.com/videos/play/wwdc2023/10164) | |
- [WWDC23 Write Swift macros](https://developer.apple.com/videos/play/wwdc2023/10166) | |
- [WWDC23 Expand on Swift macros](https://developer.apple.com/videos/play/wwdc2023/10167) | |
It looks like: |
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
// | |
// ViewController.swift | |
// pocUIViewBuilder | |
// | |
// Created by MaxAir on 26/05/2023. | |
// | |
import UIKit | |
@resultBuilder | |
struct SubviewBuilder { |
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 | |
@resultBuilder | |
struct SubviewBuilder { | |
static func buildEither(first component: UIView) -> UIView { | |
print(#function + "2") | |
return component | |
} | |
static func buildEither(second component: UIView) -> UIView { | |
print(#function + "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
git log --full-history -1 -- '*IdentifierTextField.swift' | |
usage examples: | |
- Find out in which commit a given file was deleted from project |
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
find . -type f -name '*.xib' | rev | cut -d '/' -f1 | rev | cut -d '.' -f1 |
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
[/]{2}\h*(lazy|private|let|var|func|struct|class|enum|case) |
NewerOlder