#development
1 messages · Page 243 of 1
are they swift flags or c flags im confused i can't pass them into xcode's scheme directly i'd have to put it in build settings
ima assume its c
c and swift
alr
does the scheme options all say release or debug
change build config in archive
dysm's iirc are based off the libraries that are linked at build time
i copy in my custom Swift 5.1.5 dylibs after build time
think i might have figured it out but im unsure
about to test
i need to be able to get the error to occur on command
rip
it might be weak self idk
im removing all weak selfs
well not all but the ones that are called by refcount
maybe bcus it's a weak self it tries and does atomic store im not quite sure but theres no harm testing
LMAO
LMAO
THAT WAS WHY LOL
COOKED
welp i guess just dont use weak self
i mean you can actually it works fine i guess it just breaks sometimes
oddly
maybe its when it has to deal w special cases idk
welp im giving up on swiftui for ios 6-8
at least, this repo isn't gonna happen on it
guess what, I restored Launchpad by using macOS 15's Dock.app instead, it also reverts liquid glass from the dock
doesn't that require amfi off though
I have amfi_allow_any_signature=1
yeah would have imagined so
would be cool if there was a way to revert without also disabling amfi/sip
I have all protections off always
I had sip enabled / no amfi exceptions
someone automated the process since then, it’s on GitHub somewhere
Stopping at 15.6 is a wise choice.
didn't 15.7 come out
nvm
it was 15.6.1
no it did come out
just ota only
There were compilation issues with Xcode 14.3 on macOS 15.7, so I downgraded back to 15.6.
why are you using 14.3
Xcode 14 is really good
sure, but whats wrong with xcode 26
or xcode 16
I barely have the stability issues that people complain about
Xcode 16 is decent but it's extremely heavy
in which way
If you use modern Apple Silicon there's enough overhead to never notice
Basically how all Apple software is in 2025
yeah I do worry about this, I run on a m4 pro
so im def not the best example for a lower end machine
Xcode no longer likes to remember how I like my tabs laid out, and hotkey changes
Yeah exactly
Xcode never used to be targeted for the best machines
It used to run well even on low end machines
idk
Even the freaking sims did
The iOS 26 simulator is heavy as fuck
I just couldn't
live previews were so slow and poor for me on my intel machines
accidentally opening a preview was a death sentence
I wrote my SwiftUI game on a hackintosh using 2017 hardware
Laptop
lol
And yeah
I had a 2015 mba
That's why you use the iOS 15 simulator

Last optimised version of iOS
i unfortunately cannot use the sim
i have to get real data from the gyro and cameras
The iOS 26 simulator is a joke
It's actually so poorly optimised that it's not even funny
i have noticed this during unit tests
unit tests run so poorly in xcode now
but doing it in the cli is fine
its only an issue when using the xcode gui
Why do I have access here lmao
why shouldnt u
Everyone does besides 1 person
2 actually
No idea I want to update from Ventura soon to get it
the dude who was just complaining about random bs
wait no
he was just widly off topic
always
good old days
dude larping as pwn
oh right i remember
yeah the guy who harassed me in general 
he was just widly off topic
Tbf that accurate of the real pwn too
lol
I think Capt also lost channel perms at one point
Capt being not banned is a real Christmas miracle
He's been gone
Cause he finally got a life tbf
Alright so
Overview of Swift rn is erm
I don't know what calls atomic_store
I cannot reproduce it outside the code I have in the library
If you remove weak self it works
But weak self works pretty much everywhere else i tried it
DispatchData's unmap method is, broken. As is expected. But then again, in a regular swift app, or really, any app at all, are you ever calling that?
Probably not
Alright so
Overview of Swift rn is erm
I don't know what calls atomic_store
I cannot reproduce it outside the code I have in the library
If you remove weak self it works
But weak self works pretty much everywhere else i tried it
DispatchData's unmap method is, broken. As is expected. But then again, in a regular swift app, or really, any app at all, are you ever calling that?
Probably not
lmao
oh good to know
Okay so update on Swift: On iOS 12>, try not to use @MainActor, @Sendable, etc, although in general you can, it's just best practice to not do so since concurrency ranges from completely cooked to partially working on those versions
extension UIButton {
public convenience init(type: UIButton.ButtonType = .system,
title: String,
forState state: UIControl.State = .normal,
font: UIFont = .systemFont(ofSize: 17),
titleColor: UIColor = .black,
useAutoResizingMask: Bool = false
) {
self.init(type: type)
self.setTitle(title, for: state)
self.titleLabel?.font = font
self.setTitleColor(titleColor, for: .normal)
self.translatesAutoresizingMaskIntoConstraints = useAutoResizingMask
}
public convenience init(type: UIButton.ButtonType = .system,
titleForState: [String: UIControl.State],
font: UIFont = .systemFont(ofSize: 17),
titleColorForState: [UIColor: UIControl.State],
useAutoResizingMask: Bool = false
) {
self.init(type: type)
for (title, state) in titleForState {
self.setTitle(title, for: state)
}
self.titleLabel?.font = font
for (titleColor, state) in titleColorForState {
self.setTitleColor(titleColor, for: state)
}
self.translatesAutoresizingMaskIntoConstraints = useAutoResizingMask
}
}```
Cooking up some nicer UIKit inits
I hate how verbose UIKit is
But I actually like a LOT about UIKit now I'm using it more
So I'm gonna try and make a library that does the best of both worlds
anybody knows what api i have to use to change current processes audio/volume level ?
without affecting it systemwide
i mean you can change an internal audio source's audio level?
idk about the entire applications audio level
extension OAStackView {
public convenience init(arrangedSubviews: [UIView] = [],
axis: NSLayoutConstraint.Axis,
alignment: OAStackViewAlignment,
distribution: OAStackViewDistribution,
spacing: CGFloat = 0
) {
self.init(arrangedSubviews: arrangedSubviews)
self.axis = axis
self.alignment = alignment
self.distribution = distribution
}
public func addArrangedSubviews(_ views: [UIView]) {
for view in views {
self.addArrangedSubview(view)
}
}
```
what does the OA stand for
I could not tell you
It’s an objective c library someone made for iOS 7
It’s quite excellent
oh lol
It’s very large though
whats the end goal here
icl i vastly prefer it being more verbose
I would like SwiftUI but I’ve grown to like parts of UIKit and I alrady have SwiftUI on iOS 9+
it makes it so clear to both you and other developers working on the codebase exactly what is happening on each line of code
Yeah but it also makes it so hard to navigate that code
Because it’s huge chunks of repetitive layouts and property setting
Something like this just makes sense
Being able to initialise all those properties at creation
fair
The fact there’s no function called “pin to edges” actually dumbfounds me
First thing I added
idk im just so used to like
private lazy var stackView: UIStackView = {
let stackView = UIStackView(frame: .zero)
// Config stack view
return stackView
}()
as a really easy way to keep everything enclosed and together
and then you can just fold all of your initializers
i did have to make a macro for this a long time ago
that is a crazy one
It’s literally the first thing you do in a ui view
The fact it’s not automated is cooked
Every library in existence that deals with auto layout has some kind of functio
Ngl auto layout is super old and clunky
It’s too repetitive
Yeah that’s true but how much nicer would it be to have a one liner
So easy to read
And understand
I’m doing it for all those
Types
Buttons
Labels
Etc
One line inits
For all those times you really don’t want to have to use like 6 lines of code and 10 lines of layout for a basic ahh button
you know
there might be a way
for you to automate this entire thiing
as in, write one extension
and have this done for literally every class
if you write an extension for UIView that has an initialiser that takes vargs of keypaths and keypath values
and then in the init you could just loop over each arg and assign the value to the keypath
What would that look like
I don’t know anything about keypaths Bcus I mainly use swift 5.1> features
fuck i know why thiss comes to mind now
fucking fluent uses it
the swift serverside db library
Surely gib code
but the result would be like
let view = UIStackView(\.axis = .vertical, \.spacing = 10.0)
Errr
I dislike it’s aesthetic
But if I can do it in a single extension I might let it pass perchance
It’s not super swifty
I feel like there is gonna be some really funny way of doing this
i'll play around with it later
Much appreciated
idk how to react to this lmao
wdym
fair
man i hate games that use caps lock as something
the lazy var is only needed because you're probably going to be referencing self
i.e. view.addArrangedSubview(self.title)
its how i write all my uikit code
i just don’t use caps lock
useless in game and mostly outside of the game world for me 😭
i like
right
ykw, fair enough, I can't even say it's bad
I guess I'm just not really used to it
mhm
I've written UIKit in objc more than Swift
i cant remember where I picked this up
when I write Swift I do SwiftUI so it looks odd to me lol
I'm really inclined to say I fiirst saw it in the og sileo code base
yeah I feel like I've seen this type of code somewhere, it has to be a pattern somewhere that someone adopted
idk
I agree with what I wrote there
???
that's the only upside
just bought an iphone 16 with the new camera control
if only there was an app i could use to test its functionality
Hey i know of an app
Its only on testflight though
But the build might have expired
Also i dont think the testflight is public
wasnt it by that jelbrek guy or wtv, he got banned from #development right
yeah
@grim sparrow
let startButton = UIButton(type: .custom,
titleForState: ["Touch to continue": .normal],
font: .systemFont(ofSize: 17),
titleColorForState: [.init(red: 0, green: 0.47, blue: 1, alpha: 1): .normal, .init(red: 0, green: 0.47, blue: 1, alpha: 0.5): .highlighted],
useAutoResizingMask: false)```
I'm pretty proud of my titleForState method
It's really concise and it makes perfect sense
it's cool except that formatting is awful lol
^ yeah I’m not a fan
Wdym
It took me way too long to figure out what was going on
the indentation
let startButton = UIButton(
type: .custom,
titleForState: [
"Touch to continue": .normal
],
font: .systemFont(ofSize: 17),
titleColorForState: [
.init(red: 0, green: 0.47, blue: 1, alpha: 1): .normal,
.init(red: 0, green: 0.47, blue: 1, alpha: 0.5): .highlighted
],
useAutoResizingMask: false
)
I would've done something like this
Isn't that the same thing
lmao
Can I say something terrible
right I meant the indentation
you’re filling the same line count as doing this the standard way
You're not
This is
Oh yeah right but it's way cleaner bcus the methods follow swift's guidelines
"Omit needless words"
let startButton = UIButton(type: .custom)
startButton.setTitle("Touch to continue", for: .normal)
startButton.titleLabel?.font = UIFont.systemFont(ofSize: 17)
startButton.setTitleColor(UIColor(red: 0, green: 0.47, blue: 1, alpha: 1), for: .normal)
startButton.setTitleColor(UIColor(red: 0, green: 0.47, blue: 1, alpha: 0.5), for: .highlighted)
startButton.translatesAutoresizingMaskIntoConstraints = false
vs
Infinitely cleaner
The first one looks like an unreadable block of code, the 2nd is nicely spaced, each type is clearly defined
You don't say "startbutton" so much
That's my biggest annoyance
From Swift 3, the rule has ALWAYS been "omit needless words"
startbutton is needless!!!
I feel like it's more of a problem with you being more of a SwiftUI dev, which is fine, but to me that code looks just fine lol
^
It looks nearly identical to it's Objective C counterpart
You said it yourself, UIKit is more verbose
Nothing wrong with being verbose
You’re trying to convert UIKit to not being verbose, and eventually you’re gonna land on recreating SwiftUI
a wrapper around UIKit that programs in a very different way
is it harder to read for a non-accustomed dev compared to SwiftUI? probably
is it bad that it's verbose? not necessarily, just different
It's not the same though, it's not gonna be declarative UI, it's just shorter inits
UIKit can and should have both
It doesn't HAVE to be both short and declarative
you would sit there for years to make all the initializers
That's what I'm currently concerned about
There’s a lot more properties and methods you need to call during init though
You’re init methods are gonna end up 300 parameters long
I think from what @magic hazel is saying he would not be opposed to something like this
let startButton = UIButton(type: .custom)
.setTitle("Touch to continue", for: .normal)
.titleLabel?.font = UIFont.systemFont(ofSize: 17)
.setTitleColor(UIColor(red: 0, green: 0.47, blue: 1, alpha: 1), for: .normal)
.setTitleColor(UIColor(red: 0, green: 0.47, blue: 1, alpha: 0.5), for: .highlighted)
.translatesAutoresizingMaskIntoConstraints = false
Obviously some stuff doesn't have to be included
Yeah
I mean that's basically SwiftUI but yeah
It's nicer
Still a bit long
But nicer
Although that one there wouldn't work
I don't think
Idk how to do that rn
it wouldn't, I'm just mentioning what you mean
I wonder if something like that could be achieved with a macro
Possibly
idk
100%
idk how involved Swift macros are but that is probably doable
Swift Macros are incredibly powerful
Idk I just feel like I end up typing exactly the same code out hundreds of times
To do the most basic shit
I think it's a manner of just trying to not fight against the language but rather embrasing it
as annoying as that may be
It's not the language I'm fighting against, it's the API's. Not only that, but as it is I'm STILL stuck with iOS 6 API's which I'm working on shimming
I already made a pretty good .activate constraint shim, and a UILayoutGuide shim
right, fighting against the APIs, should've phrased it better
idk, I think if you shim the most important stuff you should be fine - you already have constraints and UIStackView, other stuff you should be fine-ish
One thing that deeply frustrates me is there is no dynamic text
I feel boxed into a corner of having to create like 5 different layouts
One thing I vastly prefer over SwiftUI is being able to run regular Swift code inline with my UI
I hate that you can't do that on SwiftUI
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .white
startButton.translatesAutoresizingMaskIntoConstraints = false
helloText.backgroundColor = .clear
helloText.text = helloTextArray[0]
helloText.translatesAutoresizingMaskIntoConstraints = false
helloText.font = UIFont.systemFont(ofSize: 50, weight: .ultraLight)
helloText.textAlignment = .center
view.alpha = 0
UIView.animate(withDuration: 3, animations: {
self.view.alpha = 1
}, completion: nil)
let _ = Timer.scheduledTimer(withTimeInterval: 3, repeats: true) { [self] _ in
if helloTextIndex < 38 {
helloTextIndex += 1
} else {
helloTextIndex = 0
}
DispatchQueue.main.asyncAfter(deadline: .now()) {
UIView.animate(withDuration: 0.5) {
helloText.alpha = 0
}
}
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
UIView.animate(withDuration: 0.5) {
helloText.alpha = 1
helloText.text = helloTextArray[helloTextIndex]
}
}
}
viewStack.addArrangedSubview(helloText)
viewStack.addArrangedSubview(startButton)
view.addSubview(viewStack)
viewStack.pinToEdges(of: view)
}
pintoedges should be a native api
i will die on that hill
you do it in literally every main view you create
Is this Swift 6?
var button: UIButton {
let button = UIButton(type: .custom)
return button
}()```
This gives an error
Well no shit
Whoops
no
Yeah I realised
yeah you forgot the =
Because it’s used internally
It is but it uses a child button and I don't like that
It's also a computed var
Rather than a static property
Which in reality, it is static
it can be static
no idea, but it does work
Can't do this though
let viewStack: UIStackView = {
let stack = UIStackView()
stack.axis = .vertical
}()
Type lookup is ambiguous
Grrr idek how it's ambiguous 😭
My target is iOS 7 so it CLEARLY can't be the native UIStackView
This is a nice init anyways
let viewStack = UIStackView(axis: .vertical, alignment: .center, distribution: .fillProportionally, useAutoResizingMask: false)```
just return stack
is it on the ".vertical"?
No it's on the UIStackView
lmao
//
// UIStackViewTypeAlias.swift
// Colour Snap Legacy
//
// Created by JWI on 3/09/2025.
// Copyright © 2025 JWI. All rights reserved.
//
import Foundation
import UIKit
import OAStackView
@available(iOS, introduced: 6.0, obsoleted: 9.0)
public typealias UIStackView = OAStackView
Idk how it's ambiguous
It could not be more clear
what if you write OAStackView instead
what happens
It'll work but it defies the point of UIKitCompatKit
fascinating
The point being you being able to copy paste identical syntax between versions
With and without the package
LMAO
omitting the type makes it allowed
wdym?
let viewStack = {
let stack = UIStackView()
return stack
}()```
this is allowed
let viewStack: UIStackView = {
let stack = UIStackView()
return stack
}()```
This isn't
what's the error of that?
fascinating
it clearly knows what to do
as it should, i even have the type marked as obselete in the version where the compiler could confuse it
and if you do:
let viewStack: OAStackView = {
let stack = UIStackView()
return stack
}()
```? Just out of curiosity
bizarre
what about this
hmm, probably because anonymous don't have an explicit return type
and the compiler is somehow unable to figure that out
extension UIStackView {
static lazy var viewStack: UIStackView {
let stack = UIStackView()
return stack
}
}
really? huh, fascinating
what if you have UIStackView be a subclass of OAStackView with nothing changed?
//
// File.swift
//
//
// Created by JWI on 4/10/2025.
//
import Foundation
import UIKit
@available(iOS 9.0, *)
extension UIStackView {
public convenience init(arrangedSubviews: [UIView] = [],
axis: NSLayoutConstraint.Axis,
alignment: UIStackView.Alignment,
distribution: UIStackView.Distribution,
spacing: CGFloat = 0,
useAutoResizingMask: Bool = true
) {
self.init(arrangedSubviews: arrangedSubviews)
self.axis = axis
self.alignment = alignment
self.distribution = distribution
self.translatesAutoresizingMaskIntoConstraints = useAutoResizingMask
}
public func addArrangedSubviews(_ views: [UIView]) {
for view in views {
self.addArrangedSubview(view)
}
}
}
//
// File.swift
//
//
// Created by JWI on 4/10/2025.
//
import Foundation
import OAStackView
extension OAStackView {
public convenience init(arrangedSubviews: [UIView] = [],
axis: NSLayoutConstraint.Axis,
alignment: OAStackViewAlignment,
distribution: OAStackViewDistribution,
spacing: CGFloat = 0,
useAutoResizingMask: Bool = true
) {
self.init(arrangedSubviews: arrangedSubviews)
self.axis = axis
self.alignment = alignment
self.distribution = distribution
self.translatesAutoresizingMaskIntoConstraints = useAutoResizingMask
}
public func addArrangedSubviews(_ views: [UIView]) {
for view in views {
self.addArrangedSubview(view)
}
}
}
How so
Just
class UIStackView: OAStackView {}
Alr
it'll conflict on iOS 9+ but I'm curious
Not if i mark it as obsolete
alright, try it then
So far no errors
it might make you implement some initializers, so just do that
oh ok
did you get rid of the typealias?
huh, weird
Yeah it's odd
It's weird bcus I don't get that error in some other code
var layoutMarginsGuide: UILayoutGuide {
if let guide = objc_getAssociatedObject(self, &layoutMarginsGuideKey) as? UILayoutGuide { return guide }
let guide = UILayoutGuide()
guide.attach(to: self)
// Pin proxyView to layoutMargins
NSLayoutConstraint.activate([
guide.topAnchor.constraint(equalTo: topAnchor, constant: layoutMargins.top),
guide.leadingAnchor.constraint(equalTo: leadingAnchor, constant: layoutMargins.left),
guide.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -layoutMargins.right),
guide.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -layoutMargins.bottom)
])
addLayoutGuide(guide)
objc_setAssociatedObject(self, &layoutMarginsGuideKey, guide, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
return guide
}
// MARK: - safeAreaLayoutGuide
@available(iOS, introduced: 6.0, obsoleted: 11.0)
var safeAreaLayoutGuide: UILayoutGuide {
if let guide = objc_getAssociatedObject(self, &safeAreaGuideKey) as? UILayoutGuide { return guide }
let guide = UILayoutGuide()
guide.attach(to: self)
var topInset: CGFloat = 0
var bottomInset: CGFloat = 0
if let vc = sequence(first: self.next, next: { $0?.next }).compactMap({ $0 as? UIViewController }).first {
topInset += vc.topLayoutGuide.length
bottomInset += vc.bottomLayoutGuide.length
}
NSLayoutConstraint.activate([
guide.topAnchor.constraint(equalTo: topAnchor, constant: topInset),
guide.leadingAnchor.constraint(equalTo: leadingAnchor),
guide.trailingAnchor.constraint(equalTo: trailingAnchor),
guide.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -bottomInset)
])
addLayoutGuide(guide)
objc_setAssociatedObject(self, &safeAreaGuideKey, guide, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
return guide
}
}
@available(iOS, introduced: 6.0, obsoleted: 11.0)
extension UILayoutGuide: CustomDebugStringConvertible {
public var debugDescription: String {
let frameDesc = "\(proxyView.frame)"
let owning = owningView.map { "\($0)" } ?? "nil"
return "<UILayoutGuideShim: \(Unmanaged.passUnretained(self).toOpaque()) layoutFrame = \(frameDesc), owningView = \(owning)>"
}
}
// MARK: - UIViewController layout support shim
private var topGuideKey: UInt8 = 0
private var bottomGuideKey: UInt8 = 0
@available(iOS, introduced: 6.0, obsoleted: 9.0)
public class UILayoutSupportShim: NSObject {
public let length: CGFloat
public init(length: CGFloat) { self.length = length }
}
@available(iOS, introduced: 6.0, obsoleted: 9.0)
public extension UIViewController {
var topLayoutGuide: UILayoutSupportShim {
if let guide = objc_getAssociatedObject(self, &topGuideKey) as? UILayoutSupportShim { return guide }
let statusBarHeight: CGFloat = UIApplication.shared.isStatusBarHidden ? 0 : 20
let guide = UILayoutSupportShim(length: statusBarHeight) // default status bar height
objc_setAssociatedObject(self, &topGuideKey, guide, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
return guide
}
var bottomLayoutGuide: UILayoutSupportShim {
if let guide = objc_getAssociatedObject(self, &bottomGuideKey) as? UILayoutSupportShim { return guide }
let guide = UILayoutSupportShim(length: 0)
objc_setAssociatedObject(self, &bottomGuideKey, guide, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
return guide
}
}
I'm allowed to do UILayoutGuide here
Idk why
wow that code is crazy lol
Yeah I really got into the weeds of associated objects
surprised you didn't make a shim for that :P
Shims on top of shims is generally best avoided
Plus, i never want to touch that code ever again
What Swift shim
wasn't there stuff you needed to do with some library
it doesn't "just work" from what I remember, you need to add/patch something iirc
(I might be wrong)
Other than the fact that I fixed Swift 5.10.1 for iOS 6 which is basically just a compiler modification, I use a singular Swift shim
Timer.scheduledTimer
It's iOS 10+ but I cannot for the life of me live without it
It's far too useful
gotcha
On Swift 2.3 I was using a shim to make it look more like Swift 3.0
But that's long past
My one immense pain point in Swift is now concurrency
It just craps the fuck out
Also I'm carefully ignoring the fact that atomic_store doesn't exist on iOS 6
And very rarely methods will call it
I don't know how or why or what causes it
[weak self]?
See I thought it was that
But not even that triggers it
It's specific cases
Of weak self
It's definitely weak self
But not all weak self
I mean weak self is barely useful to begin with so it's not that bad and you can use it basically perfectly 99% of the time
But there's that 1%
definitely something to look at because it is useful
for action handlers for example
weak self is needed
func startWeakCapture() {
DispatchQueue.main.asyncAfter(deadline: .now() + 1) { [weak self] in
// Weak capture (self may be nil)
guard let self = self else {
print("self was deallocated before weak closure ran")
return
}
print("Weak capture:", self.value)
}
}```
This works
right
button.addAction(UIAction { [weak self] _ in
guard let self = self else {
print("self was already deallocated")
return
}
self.handleTap()
}, for: .touchUpInside)```
This works
Speaking of which I need to make a proper shim for that
Even tho I like my shim better
alr ima go with the method @grim sparrow was using since it's better than normal and it's native UIKit
what's there to shim?
seems fine to me?
I already have a much nicer shim for it
oh
You have to use the shitty ahh selector method for iOS 13>
I see
I mean i have my own version
startButton.addAction(for: .touchUpInside) {
}```
imo, it's much much cleaner
But idk if people would just prefer the original
you'd still need the weak self
You don't need weak self there
private class ClosureSleeve {
let closure: () -> Void
init(_ closure: @escaping () -> Void) {
self.closure = closure
}
@objc func invoke() { closure() }
}
@available(iOS, introduced: 6.0, obsoleted: 14.0)
extension UIButton {
func addAction(for controlEvents: UIControl.Event, _ closure: @escaping () -> Void) {
let sleeve = ClosureSleeve(closure)
addTarget(sleeve, action: #selector(ClosureSleeve.invoke), for: controlEvents)
// Use NSUUID for unique key
objc_setAssociatedObject(self, NSUUID().uuidString, sleeve, .OBJC_ASSOCIATION_RETAIN)
}
}```
you can still use [weak self] in
nvm weak self is useful asf
let _ = Timer.scheduledTimer(withTimeInterval: 3, repeats: true) { [weak self] _ in
guard let self = self else { return }
if helloTextIndex < 38 {
helloTextIndex += 1
} else {
helloTextIndex = 0
}
DispatchQueue.main.asyncAfter(deadline: .now()) {
UIView.animate(withDuration: 0.5) {
self.helloText.alpha = 0
}
}
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
UIView.animate(withDuration: 0.5) {
self.helloText.alpha = 1
self.helloText.text = self.helloTextArray[self.helloTextIndex]
}
}
print("a")
}```
Automatic timer dealloc
I've been needing this for so long
Time to test on iOS 6
also I just realized can't you mark the return result for this function as @discardableResult so you don't have to do let _ =?
Indeed
Idk what that marker is
extension NSTimer {
// Swift 3-style API
@discardableResult
@nonobjc class func scheduledTimer(withTimeInterval interval: NSTimeInterval, repeats: Bool, block: (NSTimer) -> Void) -> NSTimer {
let closureTimer = ClosureTimer(block: block)
return NSTimer.scheduledTimerWithTimeInterval(interval,
target: closureTimer,
selector: #selector(ClosureTimer.fire(_:)),
userInfo: nil,
repeats: repeats)
}
}
try it
you won't need to add let _ =
hm?
Or is that how it actually works
Also I don't have tpo do let _
it just gives a warning when i dont
right, and with this it won't give you a warning
that is real syntax
oh I dunno
How do you change the colour of a navbar im crashin gout
ive seen it yeah
a tab bar?
or a nav bar
navbar
UINavigationBar.appearance().barTintColor = UIColor.red
startButton.addAction(for: .touchUpInside) {
let mainAppVC = MainAppViewController()
let navController = UINavigationController(rootViewController: mainAppVC)
navController.navigationBar.tintColor = UIColor.blue
navController.navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.black]
if let window = UIApplication.shared.delegate?.window! {
window.rootViewController = navController
window.makeKeyAndVisible()
}
}```
hmm
It's working on iOS 6 but not on iOS 15 💀
lol
ah cool
wait, if you use the tab bar for example, it has the iOS 6 UI, right? just checking lol
Indeed
that's such a random app to clone lol
On iOS 6 it does
It is
But it's kinda cool
Bcus
It shows the possibilities that using a modern SDK and Swift give you
Modern UI on iOS 6
WITHOUT storyboard
I hate storyboard
good luck
lists?
Yeah
good luck
I'm thinking maybe I make a library that just gives all UIElements a .iOS7 variable
That does all the setup for you
Wait that’s iOS 6?!
The screenshot isn't
I'll send what it looks like on iOS 6 in a sec
extension UINavigationController {
public func moderniOS() {
self.navigationBar.backgroundColor = .white
self.navigationBar.setBackgroundImage(UIImage(), for: .default)
self.navigationBar.shadowImage = UIImage()
self.navigationBar.tintColor = .white
}
}```
time to make a completely custom status bar
is that a trash can mac??
It's my main Mac yes
legendary
i had a 2011 imac that was 4gb 128hdd -> mba 2015 i5 4gb 256gb -> m2 air -> m1 macbook pro (work) -> m3 pro (work) -> m4 pro
nice
m2 air to m1 mbp ❓
M2 Air was mine
M1 MBP was work provided machine
But the build times were insanely poor and I was frequently getting OOM errors
So I got the M3 Pro MBP
oh
After working for a while and feeling pretty stable I got myself my m4 pro
and I love it
I also bought a t480 but that’s irrelevant
I’m hoping to get an M4 Max
The reason I didn’t get the max is it throttles quite poorly in the 14” shell and I much prefer the size of the 14”
Yeah I’m going for the big boy
Once I converted to the 15 inch 2015 MacBook pro could never go back to a piddily laptop again
It’s like a portable workstation
Idk how long it’s gonna take to arrive
It’s already been 3 months
I hate corporate
I LOVE THINKPAD T480
mine is dead :(
awwwwww
mine is 1440p with the nvidia gpu and i upgraded it to 32gb :3
its just a shame the memory is slow :(
mine was the i7-8650U without dGPU and a 1080p display
i loved it i had a big battery and 32GB RAM and a 1TB SSD
then i installed arch and enrolled secure boot keys
And then it stopped booting
ANd then i went a whole rabbit hole trying to fix it and ended up fucking up the motherboard more
i just need a new board
guh
rip
i honestly just dont know what to do with it anymore
its my arch shit about machine
but theres so little htat doesn't run on my macbook atp
and I just use docker on my mac when I have to use something
mine was the i7-8650U without dGPU and a 1080p display
i loved it i had a big battery and 32GB RAM and a 1TB SSD
then i installed arch and enrolled secure boot keys
And then it stopped booting
ANd then i went a whole rabbit hole trying to fix it and ended up fucking up the motherboard more
i just need a new board
guh
So true twin
If you had a JOB you could BUY a replacement motherboard with the MONEY from your JOB
omg i have a job!
mods copy pasta
pls ban from the channel
Twinkpad
@open fjord
Thinkpad supremacy
i just don’t run linux
ever
i have zero use for it 😭 I wanna put windows back on my old laptop but I need to figure this out still
i have only a mac and balena etcher does not exactly “work”
I run my server off macOS by complete chance lmao
i have a m1 mini acting as a ci runner
nice
i’ve had people tell me my macbook pro isn’t a server (except i host a ton of services off my mbp including portainer)
I mean many machines aren't severs but you can run a bunch of stuff off them. Most server stuff use basically no resources when you're the only user (and can often handle hobbiest load for quote a while with minimal load) and you can run useful stuff on pretty much any PC made in the past couple decades
Laptops still work fine as servers
They aren't as good as desktops in the I can stick a bunch of hard drives in this later part but if all you cars about is having code running all the time a laptop is just as good as a desktop
im getting a machine as an actual server later, I'm still looking for a machine that has a caddy on it for easier hard drive usage
Elitedesk or optiplex 
Most have up to 3 drive bays
this can't be real man 😭
A large chunk of my server operations are still running on a rasberru pi 4
the jailbreaks.app status bot and an instance of GIR (plus some other things) are all running off of my rpi 5
might run a webserver on there also
what’s a web server 
(what hosts a website)
oh
Does anyone happen to have modern patched tvos sdk
Like 14.0+
https://github.com/lechium/Apple_TVOS_18.2_22K154/tree/master not an sdk but all headers
Hmmm
Do I attempt to rewrite the entire Swift Concurrency backend
Seems like a pretty monstrous task
I mean in theory what I could do instead is just null every function
So libraries that use it still compile
They're just syncronous
I mean ngl Swift Concurrency is just a nice-to-have
DispatchQueue works for 90% of shit
Even Concurrency uses it quite a lot 💀
Okay
Anyone know where libswift comes from?
The one on bigboss
Is it just libswiftCore.dylib packaged?
LMAO
it's just all the swift dylibs
Yes
It’s so apps don’t need to bundle the libs
Especially on iOS 12
I’ve got libswiftconcurrency on havoc
Concurrency works on iOS 12 which is cool
I tested that
Not on iOS 11>
Mhm
I’ll need to make one for iOS 6
How
I already have the dylibs
lol
Surely Swift concurrency is gonna be ass to backporr
Oh
No I’m not doing that
I meant libswift
The dependency
Also it wouldn’t be for iOS 6 if I did it it be for iOS 6-11 but I’m not doing it
It’s too much work
It’s the work for a team
Not an individual
It’s way beyond my skill level
hey everyone, quick question. how are ramdisks made for jailbreaks like checkra1n and palera1n? i am on my journey to writing a jailbreak for A8 devices although i am stuck on this part.
The stuff on it is pretty automated. For example the procursus build system can build all the tools and deps for the ramdisk.
bear with me english is my third language haha. so let me rephrase, i want to create a ramdisk, something that checkra1n utilizes for example having the loader app on the homescreen after booting
just for now want to do a ramdisk that i can use with pongo and have it contain a loader app of some sort
i am really confused on this part, i cannot find any proper information on this. also if something i say makes you confused, please tell me that.
i wanna set up some sort of automated testing thing for jailed and/or jb iOS software, i used to use corellium but looks like it got infiltrated by suits, and they killed the $50/mo iOS emulator thing (cuz it doesnt make money i guess) what else is out there?
so it seems like the only legit alternative is to use bitrise, which is lame. or have a farm of palera1n devices, or mac minis or something, which is something i dont really want to do, doing sysadmin on apple hardware sux
but then i found this https://github.com/kholia/OSX-KVM
so basically my question is, has anyone used OSX-KVM and got it to work? or is there a corellium alternative out there somewhere?
it does work but it has no hardware acceleration so iOS sim is super slow
¯_(ツ)_/¯
lol
I don't own a real macos device with modern metal drivers
icic
i mean if its like 10-20x slower thats fine, but if its like 100x slower then that will be an issue
try it and see
ye. thank god it exists
kind of scary it requires x64
A CPU with Intel VT-x / AMD SVM support is required
would think theyd try to support arm64 at least....
only a matter of time till apple drops x64 support, then this project is on life support
oh ya, they're dropping x64 for the next macOS release https://reddit.com/r/macpro/comments/1l8xnri/macos_tahoe_26_will_be_the_final_release_for_the
MacPro7,1 is still supported
There is also https://docs.darwinkvm.com/
100% unrelated to the original question, neat video with a 50% off IDA license purchase with discount code in description.. https://www.youtube.com/watch?v=UVD0fbiNbnM
Are you a security researcher or reverse engineer? Get 50% off your next IDA license purchase with discount code BILLY50.
To activate your 50% product discount, click "Get a quote" in the web shop (under "Order & Pay), or email sales@hex-rays.com. Make sure to mention the discount code BILLY50.
Note: This discount is only applicable to individu...
are you trying to do iOS or macOS?
this is for virtualized macOS
yeah hexrays got bought by private equity and is now acting like standard businesses now
but also I'm pretty sure those licenses are now subscription based
That's awful to hear 🙁
Yeah, yearly subs but they now offer a "personal use" license
to be fair I don't think you can do much worse than $10k per license
well, maybe worse for businesses now though
Could be $10k/yr per seat per company license (with a base fee of $2k per company)... 👀
Oh, it's $8599/yr USD. And also priced out per # of local "decompilers", this is a terrible strategy wtf https://hex-rays.com/pricing
yeahh
Wonder how many people switched to binary ninja because of the licensing changes alone
As far as I know iOS emulation is kinda monopolized by them,
well, I certainly know people that have binary ninja licenses but none in mind for IDA
Maybe in their case the xCode iOS simulator could work?
https://vxtwitter.com/eshard/status/1975562581277577403 I just saw this tweet
maybe wait a couple years
what license is qemu
gpl?
Official QEMU mirror. Please see https://www.qemu.org/contribute/ for how to submit changes to QEMU. Pull Requests are ignored. Please only use release tarballs from the QEMU website. - qemu/qemu
send them a GPL OSS notice on day 1 of release
!
i do wonder what other companies do at this point though
like surely other companies have also capitalized on the commercialization of qemu
and perhaps made some of their own changes
i guess it might be probable that they offer it hosted on their servers?
(which GPLv2 doesn't necessarily say is distribution and thus sources don't require releasing)
They’ll probably try to put out the source in a way where its fucked up to get it and you have to mail them or sthm
well, i better get ready to send my certified mail to them
no amount of mail will be equivalent to the amount of effort they took to work on this
💀
i've used osx kvm
worked fine after following the instructions
Ngl I always found qemu based emulators more trouble than they’re worth, I do get them to work but they’re so messy and not self contained that it’s annoying to deal with
There’s a 100% discount code in #1189739986707288154
Many of them actually
Other than that channel is unknown to me, good to know that there is a channel for five finger discounts
Or I guess ten keyless discounts
What is that channel
Orange Name Only (ONO)
Is that developer or another role
It's developer but the channel hasn't been active for a while
I mean it has its moments but it's nothing too interesting
Oh, I can't see it
right, it's private
Oh so it’s invite only rather than blanket developer role
yeah
Makes sense
how's your Swift stuff going anyway?
Pretty good
I’m working on UI rn
I’ve replicated UIBlurEffect and now I’m working on the navigation bar
Fascinating
iOS 6->7->12->15
How's the experience of actually writing apps? (Minus the tediousness of UIKit vs SwiftUI)
After a feature is implemented it’s identical to how it’d be in modern UIKit
I make absolutely sure the api is exactly the same
Except I did add some extras for UIBlurEffect
Bcus for some brain dead reason apple doesn’t let you do a custom radius
It took so long to make .regular look the same
No yeah I just mean, how does it actually feel to write apps for iOS 6?
I've never developed for legacy iOS, that's why I'm curious
Neat
Ive added enough in at this point that it’s very close
Cool stuff man, exciting as well
Right
Never gonna happen tho it’s out of the question I think
It’s an entire update of UIKit basically
It was all of UIKit 13
yeah
Plus my shim is useful for iOS 7-12 asw
Adds intypes that don’t exist
Also I found out how to bypass ambiguity in those
AppDelegate was only deprecated in iOS 26 I think, so you're fine
Types
UIKitCompatKit.UIStackView
nice
cool stuff
Indeed
public extension UIViewController {
var unifiedTitle: String? {
get {
// On iOS 7+, just use the normal title
if #available(iOS 7.0.1, *) {
return self.title
} else {
// On iOS 6, try to read from the navigationItem.titleView if it's a UILabel
if let label = self.navigationItem.titleView as? UILabel {
return label.text
}
return nil
}
}
set {
if #available(iOS 7.0.1, *) {
self.title = newValue
} else {
// Create a UILabel for the titleView on iOS 6
let titleView = UILabel()
titleView.text = newValue
titleView.font = .boldSystemFont(ofSize: 17)
titleView.backgroundColor = .clear
titleView.textColor = .black
titleView.textAlignment = .center
titleView.sizeToFit()
self.navigationItem.titleView = titleView
}
}
}
}```
this is gonna be a sep library
unifiedUI
smthing like that
so you can expect a similar looking result as well
thats this essentially
Fix bugs
See
Minimum deployment for Swift is always 7.0
No matter what you do
mhm
So if you don't do 7.0.1
It'll assume inside the package
At buildtime
That it's okay
When it's not
wow lol
I mean technically you could do a runtime check instead
It is a runtime check 😭
UIDevice.currentDevice.operatingSystemVersion or something
#available is runtime
also i get errors in the pkg
yeah
ig
actually wait
theres an easier way lmao
if #available iOS 6.2
💀
wait what
W
I'm curious
Can't even build Swift for iOS 6 from source bcus of Atomic_Store
:P
It's one of those bugs i just ignore
it basically never pops up
ive had it once and it was weak selfs fault but i actually think it was something elses
i reckon it was all the @MainActor's that usually are fine bcus they usually don't do jackshit
but sometimes they end up actually doing a job properly
and thats when shit goes to hell
I need a new touch 7
my current one has an explody battery
hmm
doesnt seem to be working
grrr
rip
idk why it wouldnt tho 
yeah i think its the pkg shit
it just does funni stuff
welp at least for now 7.0.1 works and thats that ig
There are quite a few things I have to do to make the UI Consistent tho
The status bar is pissfuck easy
It's not identical rn but its close enough that it doesn't matter
What isn't easy to do is uh the toggles, the tableviews, the tabviews

maybe what you should do is embrace iOS 6 instead of trying to make it look like iOS 7+
You could do that but then you're writing an application for iOS 6
which can you do
Hence why this is a sep library
I guess
But this library i'm working on is aimed yet again at developers who want minimal effort to make unified applications for legacy devices
eventually i hope to have enough going that it is really easy for a modern uikit developer to literally just download Xcode 13.4.1 and rebuild their application with my libraries as dependencies
and change like
1 or 2 lines of code
Applications I would write won't use either
I always use custom ui elements (unless its liquid glass)
i might end up also attempting a somewhat replication of liquid glass
im also really tempted to make my blur implementation MUCH more complex
does anyone have any experience doing temporal accumulation
The other thing is that for apps where the code is open sourced, and people actually want the app on lower ios versions, the effort required is so minimal that I'd probably just do it myself
I'm thinking of making a single script that puts all the replacement files in place and sets everything up so all that has to be done is install the swift toolchains, change some uielementts from "nativeui whatever to unifiedui" and then run the buildscript
Interesting
I wonder how little effort I would have to make it so that anyone would do it
As of rn if you don't use concurrency it would take like
20 minutes tops
Probably a lot less
I mean realistically nobody in here is working on a big app
But in general that's understandable
The point is why not
¯_(ツ)_/¯
The same reason it's standard for apps on the app store to support latest major iOS - 1
more targets to worry about, tiny userbase, shim might not be 100% perfect, etc
New API's?
- small userbase
What nightwind said
Having to support such an old version limits what you can use as well so yes new apis
It's the same problem with consoles
Game publishers are still supporting the PS4 which is hindering actual good games for the PS5
That's what my packages exist to cover, the idea is you add them and have to at most change the names of a few uielements and everything works the same, newer platforms just passthrough the actual api, the older ones fallback to the shim, so realistically, what happens is that the old versions now get a type of access to the app, and the newer users app doesn't get impacted at all
That's the goal at least
So far it's working out pretty nicely
I got Swift Cross UI to work on iOS 9+ which was previously 13+ in like 2 hours and it used full concurrency
Sure but there is so many wonderful new APIs that apps use that just physically wouldn't be available on such old versions
I'm actually struggling to find anything that's not Liquid Glass or concurrency based that I can't at least somewhat replicate
In some cases, those APIs might be crucial for the app's functionality
Replicating them is one thing, but realistically one person just would not be able to develop a 1/1 match with all the new APIs
The amount of users on such old iOSs are so minuscule that it's not worth putting in the labor to possibly strip down some API usage
I reckon I can get it pretty close
There are so many small random APIs
like did you know TipKit was a thing? I found that out today
interesting
then aagin
its ios 17+
and barely anyone uses it
thats like a super duper edge case
most apps today are iOS 16+ or iOS 17+
there are also apps that are iOS 18+, just FYI
well yeah but like again
think about this
this is r/jb
last ios to get a jb
ios 16
most devs here
ios 16+
if not ios 15+
bcus dopamine
Yeah but I can't even think of a modern app that requires a jailbreak that was released semi-recently lol
realistically, i think i can get 90-95% of uikit, 100% of foundation (gonna put in a lot of hours to backport URLComponents inside the compiler bcus I know a lot of people use it), and about 80% of the total amount of frameworks that exist in all of Apple's offering
Good luck lol
☝️ 🤓 ios 18 has a jailbreak on one specific iPad using palera1n
palera1n at this point doesn't count
Its a jailbreak
Realistically what was really good is actually testing it on an app, i need like a bunch of open source modern uikit apps, bcus when i did it on swiftcrossui i added at least 20+ apis to the package that it used
Reading apples docs is one thing
Seeing what people actually end up using is another
that's a fair point, but the project itself is so niche, that's the main issue with adoption
I am also about 40% of the way there convincing myself to waste my life rewriting swift concurrency for iOS 6-12 so that you literally don't have to remove anything
That's why I'm not looking at just iOS 6 anymore
iOS 13 introduced so much that iOS 12- misses out on
There's a substantial chunk of people still on an iPhone 6
Apps today are starting to use FoundationModels for example (iOS 26+), just mentioning
That won't be widely adopted for at least 3 years
That's generally how stuff goes
SwiftUI was like that as well
that's in the context of the jailbreak community, for the people on stock it's waaay more skewed towards latest
I mean, it's quite a nice API, I did some playing around with it
Ehh, iPhone 6 sold a stupid amount of units, maybe in the US that's true, other places it depends
Yeah I know I've tried it as well