Skip to content

Instantly share code, notes, and snippets.

View Adobels's full-sized avatar
🎯
Focusing

Blazej SLEBODA Adobels

🎯
Focusing
View GitHub Profile
@Adobels
Adobels / gist:409261b06c4238e38f23a0475401cecd
Last active November 29, 2022 15:40
Xcode regex: find line with commented code
[/]{2}\h*(lazy|private|let|var|func|struct|class|enum|case)
@Adobels
Adobels / gist:5092ed12ddbe15e6fe03f1291213ae84
Created November 29, 2022 15:26
Xcode lldb console: cast object in memory
expr -l Swift -- import UIKit
expr -l Swift -- let $ca = unsafeBitCast(0x6000004c1dc0, to: CALayer.self)
expr -l Swift -- print($ca.borderWidth)
@Adobels
Adobels / gist:72649a612f2bf2913c1f3933c0f49ac9
Created October 8, 2021 12:53
@IBSegueAction method signature
@IBSegueAction private func showPerson(coder: NSCoder, sender: Any?, segueIdentifier: String?)
working variants:
@IBSegueAction private func showPerson(coder: NSCoder)
@IBSegueAction private func showPerson(_ coder: NSCoder, sender: Any?, segueIdentifier: String?)
@IBSegueAction private func showPerson(_ coder: NSCoder)
@IBSegueAction private func showPerson(coder: NSCoder)
2021-09-15 1A291f removes the deployment limit entirely, so all users should now be able to get the firmware update.
2021-09-07 1.0.291 1A291e changed nothing other than the rate limit on the percentage (25%) of ‌AirTags‌ users getting the update
2021-0x-xx 1A291c
@Adobels
Adobels / gist:b445ac17d9bfc3af4cfc977494fa3563
Last active August 27, 2021 08:44
What's new in Swift 5.5
Swift 5.5 Change log:
https://github.com/apple/swift/blob/main/CHANGELOG.md#swift-55
Collection of new features:
https://www.hackingwithswift.com/articles/233/whats-new-in-swift-5-5
https://medium.com/mindful-engineering/whats-new-in-swift-5-5-fb13f49bb728
Specific features:
Update git fork with tags
# Repo: someuser/myframework
# Fork: superteam/myframework
# Track:
git clone https://github.com/superteam/myframework.git
cd myframework
git remote add upstream https://github.com/someuser/myframework.git
@Adobels
Adobels / RxSwift5_0_1-SingleFile.swift
Last active February 12, 2020 14:35
RxSwift 5.0.1 Framework concatenated to a single file
//
// AddRef.swift
// RxSwift
//
// Created by Junior B. on 30/10/15.
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
//
final class AddRefSink<Observer: ObserverType> : Sink<Observer>, ObserverType {
@Adobels
Adobels / gist:cd6ee1455c96c8b86e959e1d3cc2803a
Last active February 6, 2020 14:24
NSOperation for an async code like URLSession data tasks
class OperationSource: Operation {
var state: Operation.OperationState = .inital
let newsApi: NewsApi
var data: Data?
init(newsApi: NewsApi) {
self.newsApi = newsApi
}
//
// EmojiFlag.swift
//
// Created by Blazej SLEBODA on 04/02/2020.
//
import Foundation
class EmojiFlag {
@Adobels
Adobels / UITimer
Last active January 29, 2020 15:42
Reusable and InterfaceBuilder friendly Timer
class UITimer: NSObject {
@IBInspectable
var timeInterval: Double = 1
@IBInspectable
var repeats: Bool = false
var timer: Timer?