#development

1 messages · Page 243 of 1

faint timber
#

its a scheme

magic hazel
#

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

faint timber
#

does the scheme options all say release or debug

magic hazel
#

btw building with a dysm won't be useful

#

i build via archive anyways

faint timber
#

change build config in archive

magic hazel
#

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

magic hazel
#

welp im giving up on swiftui for ios 6-8

#

at least, this repo isn't gonna happen on it

frank fossil
#

guess what, I restored Launchpad by using macOS 15's Dock.app instead, it also reverts liquid glass from the dock

wooden yarrow
frank fossil
#

I have amfi_allow_any_signature=1

wooden yarrow
#

yeah would have imagined so

#

would be cool if there was a way to revert without also disabling amfi/sip

magic hazel
#

I have all protections off always

robust radish
magic hazel
#

I hate all macOS protections

#

They just get in my way

robust radish
#

someone automated the process since then, it’s on GitHub somewhere

knotty igloo
#

Stopping at 15.6 is a wise choice.OkayChamp

grim sparrow
#

nvm

#

it was 15.6.1

#

no it did come out

#

just ota only

knotty igloo
grim sparrow
#

why are you using 14.3

faint timber
#

Xcode 14 is really good

magic hazel
#

Xcode 14 worst Xcode update

#

Dropped 32 bit support

grim sparrow
#

or xcode 16

magic hazel
#

Xcode 26 is ass

#

They ruined layouts

grim sparrow
#

I barely have the stability issues that people complain about

magic hazel
#

Xcode 16 is decent but it's extremely heavy

grim sparrow
magic hazel
#

If you use modern Apple Silicon there's enough overhead to never notice

#

Basically how all Apple software is in 2025

grim sparrow
#

so im def not the best example for a lower end machine

magic hazel
magic hazel
#

Xcode never used to be targeted for the best machines

#

It used to run well even on low end machines

grim sparrow
#

idk

magic hazel
#

Even the freaking sims did

grim sparrow
#

did you ever try to use life previews

#

on an intel machine?

magic hazel
#

The iOS 26 simulator is heavy as fuck

grim sparrow
#

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

magic hazel
#

Laptop

#

lol

#

And yeah

grim sparrow
#

I had a 2015 mba

magic hazel
#

That's why you use the iOS 15 simulator

grim sparrow
magic hazel
#

Last optimised version of iOS

grim sparrow
#

i unfortunately cannot use the sim

#

i have to get real data from the gyro and cameras

magic hazel
#

The iOS 26 simulator is a joke

#

It's actually so poorly optimised that it's not even funny

grim sparrow
#

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

magic hazel
#

Yep

#

Even on Apple Silicon

#

That's actually so funny

magic hazel
tepid olive
#

Why do I have access here lmao

trail nimbus
#

why shouldnt u

quaint rain
harsh junco
quaint rain
#

Close enough

jagged willow
#

one of them deleted their account iirc

faint timber
grim sparrow
#

wait no

#

he was just widly off topic

#

always

trail nimbus
#

good old days

grim sparrow
#

dude larping as pwn

trail nimbus
#

oh right i remember

jagged willow
#

yeah the guy who harassed me in general supershocked

pearl sail
grim sparrow
#

lol

hexed knot
#

I think Capt also lost channel perms at one point

pearl sail
hexed knot
#

He's been gone

pearl sail
#

Cause he finally got a life tbf

magic hazel
#

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

light owl
#

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

magic hazel
#

lmao

lime pivot
magic hazel
#

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

magic hazel
#
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

orchid fulcrum
#

anybody knows what api i have to use to change current processes audio/volume level ?

#

without affecting it systemwide

magic hazel
#

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)
        }
    }
    ```
magic hazel
#

It’s an objective c library someone made for iOS 7

#

It’s quite excellent

grim sparrow
#

oh lol

magic hazel
#

It’s very large though

grim sparrow
#

whats the end goal here

magic hazel
#

Make UIKit more bare able

#

It’s APIs are archaic and verbose

#

Even on modern UIKit

grim sparrow
#

icl i vastly prefer it being more verbose

magic hazel
#

I would like SwiftUI but I’ve grown to like parts of UIKit and I alrady have SwiftUI on iOS 9+

grim sparrow
#

it makes it so clear to both you and other developers working on the codebase exactly what is happening on each line of code

magic hazel
#

Yeah but it also makes it so hard to navigate that code

#

Because it’s huge chunks of repetitive layouts and property setting

magic hazel
#

Being able to initialise all those properties at creation

grim sparrow
#

fair

magic hazel
#

The fact there’s no function called “pin to edges” actually dumbfounds me

#

First thing I added

grim sparrow
#

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

grim sparrow
#

that is a crazy one

magic hazel
#

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

magic hazel
#

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

grim sparrow
#

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

magic hazel
#

wtf

#

Send surely

#

Surely

grim sparrow
#

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

magic hazel
#

What would that look like

#

I don’t know anything about keypaths Bcus I mainly use swift 5.1> features

grim sparrow
#

keypaths are swift 1.0 i believe

#

so you're in luck

magic hazel
#

I mean I have swift 5.10 so I’m all good

#

5.10.1 to be exact

grim sparrow
#

fuck i know why thiss comes to mind now

#

fucking fluent uses it

#

the swift serverside db library

magic hazel
#

Surely gib code

grim sparrow
#

but the result would be like

let view = UIStackView(\.axis = .vertical, \.spacing = 10.0)
magic hazel
#

Errr

#

I dislike it’s aesthetic

#

But if I can do it in a single extension I might let it pass perchance

grim sparrow
#

I feel like there is gonna be some really funny way of doing this

#

i'll play around with it later

magic hazel
#

Much appreciated

grim sparrow
radiant idol
#

it's... interesting

#

idk, I haven't seen Swift UIKit code like thios

grim sparrow
#

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

jagged willow
#

useless in game and mostly outside of the game world for me 😭

grim sparrow
orchid fulcrum
#

i like

radiant idol
#

ykw, fair enough, I can't even say it's bad

grim sparrow
#

its great for segmenting the setup of each of ur views

#

truly

radiant idol
#

I guess I'm just not really used to it

grim sparrow
#

mhm

radiant idol
#

I've written UIKit in objc more than Swift

grim sparrow
#

i cant remember where I picked this up

radiant idol
#

when I write Swift I do SwiftUI so it looks odd to me lol

grim sparrow
#

I'm really inclined to say I fiirst saw it in the og sileo code base

radiant idol
#

idk

radiant idol
#

I agree with what I wrote there

orchid fulcrum
#

only downside of objc is lack of swiftui ngl

fading shell
#

that's the only upside

vivid dew
#

just bought an iphone 16 with the new camera control

#

if only there was an app i could use to test its functionality

light owl
#

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

acoustic imp
#

wasnt it by that jelbrek guy or wtv, he got banned from #development right

magic hazel
#

@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

radiant idol
#

it's cool except that formatting is awful lol

grim sparrow
#

^ yeah I’m not a fan

grim sparrow
#

It took me way too long to figure out what was going on

radiant idol
#

the indentation

magic hazel
#

Prolly bcus it's not a real code block

#

lmao

#

I'll send a ss instead

radiant idol
#
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

magic hazel
#

lmao

grim sparrow
#

Can I say something terrible

magic hazel
#

Just indented right

#

I copy pasted from Xcode so

magic hazel
#

lmao

radiant idol
#

right I meant the indentation

grim sparrow
#

you’re filling the same line count as doing this the standard way

grim sparrow
magic hazel
#

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

magic hazel
#

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!!!

radiant idol
#

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

grim sparrow
#

^

magic hazel
#

It looks nearly identical to it's Objective C counterpart

grim sparrow
#

You said it yourself, UIKit is more verbose

hexed knot
#

Nothing wrong with being verbose

grim sparrow
#

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

radiant idol
#

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

magic hazel
#

UIKit can and should have both

#

It doesn't HAVE to be both short and declarative

radiant idol
#

you would sit there for years to make all the initializers

magic hazel
grim sparrow
#

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

radiant idol
#

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
magic hazel
#

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

radiant idol
#

it wouldn't, I'm just mentioning what you mean

magic hazel
#

Yeah that would be nicer

#

Kinda

#

In some ways

radiant idol
#

I wonder if something like that could be achieved with a macro

magic hazel
#

Possibly

radiant idol
#

idk

radiant idol
#

idk how involved Swift macros are but that is probably doable

grim sparrow
#

Swift Macros are incredibly powerful

magic hazel
#

Idk I just feel like I end up typing exactly the same code out hundreds of times

#

To do the most basic shit

radiant idol
#

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

magic hazel
#

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

radiant idol
#

right, fighting against the APIs, should've phrased it better

magic hazel
#

iOS 6 API's

#

Are

#

Incredibly verbose

#

Like needlessly so

radiant idol
#

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

magic hazel
#

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

magic hazel
#
var button: UIButton {
        let button = UIButton(type: .custom)
        return button
    }()```
#

This gives an error

#

Well no shit

#

Whoops

radiant idol
magic hazel
#

Yeah I realised

radiant idol
#

yeah you forgot the =

magic hazel
#

indeed

#

Why is translatesAutoresizingMaskIntoConstraints = false not default

#

Why

grim sparrow
#

Because it’s used internally

magic hazel
#

Grr

#

ngl idk which i prefer

radiant idol
#

I like the second tbh

#

it's very self contained

magic hazel
#

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

radiant idol
#

it can be static

magic hazel
#

When'd they add that

#

I didn't realise that was allowed

radiant idol
#

no idea, but it does work

magic hazel
#

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)```
magic hazel
#

Still ambiguous

#

lol

radiant idol
#

is it on the ".vertical"?

magic hazel
#

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

radiant idol
#

what happens

magic hazel
#

It'll work but it defies the point of UIKitCompatKit

radiant idol
#

fascinating

magic hazel
#

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

radiant idol
#

wdym?

magic hazel
#
let viewStack = {
        let stack = UIStackView()
        return stack
    }()```
#

this is allowed

#
let viewStack: UIStackView = {
        let stack = UIStackView()
        return stack
    }()```
#

This isn't

radiant idol
#

huh, that's odd

#

do a print of the type of viewStack

fading shell
magic hazel
radiant idol
#

fascinating

magic hazel
#

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

radiant idol
#

and if you do:

let viewStack: OAStackView = {
    let stack = UIStackView()
    return stack
}()
```? Just out of curiosity
magic hazel
#

Works fine

#

lol

radiant idol
#

bizarre

magic hazel
#

It's only the type it gets confused on

#

It's a bit odd yeah

radiant idol
#

what about this

fading shell
#

and the compiler is somehow unable to figure that out

magic hazel
#

Possibly

#

Idk

#

It's confusing my shim with the real type on iOS 7 somehow

radiant idol
#
extension UIStackView {
    static lazy var viewStack: UIStackView {
        let stack = UIStackView()
        return stack
    }
}
magic hazel
#

Yeah you can't do that

#

I already know that

#

You have to extend OAStackView

radiant idol
#

really? huh, fascinating

#

what if you have UIStackView be a subclass of OAStackView with nothing changed?

magic hazel
#
//
//  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)
        }
    }
    
}
radiant idol
#
class UIStackView: OAStackView {}
magic hazel
#

Alr

radiant idol
#

it'll conflict on iOS 9+ but I'm curious

magic hazel
radiant idol
#

alright, try it then

magic hazel
#

So far no errors

radiant idol
#

oh ok

magic hazel
#

Functions the same as well

#

Still ambiguous for type lookup tho lol

radiant idol
#

did you get rid of the typealias?

magic hazel
#

Yeah

#

It basically functions the same

radiant idol
#

huh, weird

magic hazel
#

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

radiant idol
#

wow that code is crazy lol

magic hazel
#

Yeah I really got into the weeds of associated objects

radiant idol
#

surprised you didn't make a shim for that :P

magic hazel
#

Shims on top of shims is generally best avoided

#

Plus, i never want to touch that code ever again

radiant idol
#

UIKitCompat on top of the Swift shim lol

#

but anyway

magic hazel
#

That's part of UIKitCompatKit

#

lmao

radiant idol
#

right

#

which itself is a shim, that also depends on the Swift shim for iOS 6

magic hazel
#

What Swift shim

radiant idol
#

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)

magic hazel
#

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

radiant idol
#

gotcha

magic hazel
#

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

radiant idol
#

[weak self]?

magic hazel
#

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%

radiant idol
#

definitely something to look at because it is useful

#

for action handlers for example

#

weak self is needed

magic hazel
#
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

radiant idol
#

right

magic hazel
#
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

radiant idol
magic hazel
#

and UIAction

radiant idol
#

seems fine to me?

magic hazel
#

I already have a much nicer shim for it

magic hazel
#

lmao

#

That method i wrote there

radiant idol
#

oh

magic hazel
#

You have to use the shitty ahh selector method for iOS 13>

radiant idol
#

I see

magic hazel
#

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

radiant idol
#

you'd still need the weak self

magic hazel
#

You don't need weak self there

radiant idol
#

oh wait

#

ok nvm idk if you do or not

magic hazel
#
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)
    }
}```
radiant idol
#

right

#

ok well as long as it works

magic hazel
#

you can still use [weak self] in

magic hazel
#

nvm weak self is useful asf

radiant idol
#

that was a turn of events lol

#

what made you change your mind? 🤔

magic hazel
#
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

radiant idol
#

oh

#

yeah it was pretty much in a memory leak before lol

radiant idol
radiant idol
# magic hazel 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 _ =

magic hazel
#

Oh yeah

#

Isnt that not tea syntax tho

#

Real*

radiant idol
#

hm?

magic hazel
#

Or is that how it actually works

#

Also I don't have tpo do let _

#

it just gives a warning when i dont

radiant idol
#

right, and with this it won't give you a warning

radiant idol
magic hazel
#

No like

#

Is that how it works in the native API

radiant idol
#

oh I dunno

magic hazel
#

Why is setting a custom navbar colour so annoying

#

wtf

radiant idol
#

seems like it is not marked as discardableResult

#

ok fair enough then

magic hazel
#

Alr then I won't add it

#

Even if its better

radiant idol
#

something to know though

#

for the future

#

it's a very popular marker

magic hazel
#

How do you change the colour of a navbar im crashin gout

magic hazel
radiant idol
#

or a nav bar

magic hazel
#

navbar

radiant idol
#

UINavigationBar.appearance().barTintColor = UIColor.red

magic hazel
#
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()
            }
        }```
radiant idol
#

hmm

magic hazel
#

It's working on iOS 6 but not on iOS 15 💀

radiant idol
#

lol

magic hazel
#

got it working

#

its .backgroundcolor

radiant idol
#

ah cool

magic hazel
#

i'm trying to make iOS 7 ui on iOS 6

#

for my open source setup.app

radiant idol
#

wait, if you use the tab bar for example, it has the iOS 6 UI, right? just checking lol

radiant idol
magic hazel
#

On iOS 6 it does

magic hazel
#

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

radiant idol
#

good luck

magic hazel
#

Storyboard gives you so much tech debt

#

idk how im gonna change lists

radiant idol
#

lists?

magic hazel
#

yeah

#

like settings lists

#

from being iOS 6 style to iOS 7

radiant idol
#

oh

#

UITableView?

magic hazel
#

Yeah

radiant idol
#

good luck

magic hazel
#

I'm thinking maybe I make a library that just gives all UIElements a .iOS7 variable

#

That does all the setup for you

magic hazel
#

I'll send what it looks like on iOS 6 in a sec

magic hazel
magic hazel
#
extension UINavigationController {
    public func moderniOS() {
        self.navigationBar.backgroundColor = .white
        self.navigationBar.setBackgroundImage(UIImage(), for: .default)
        self.navigationBar.shadowImage = UIImage()
        self.navigationBar.tintColor = .white
    }
}```
magic hazel
#

time to make a completely custom status bar

grim sparrow
magic hazel
grim sparrow
#

legendary

magic hazel
#

Indeed

#

8 core 32gb 512gb ssd

#

It's a pretty decent machine

grim sparrow
#

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

grim sparrow
#

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

wooden yarrow
#

oh

grim sparrow
#

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

magic hazel
grim sparrow
#

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”

magic hazel
#

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

kind herald
#

mine is dead :(

grim sparrow
#

awwwwww

#

mine is 1440p with the nvidia gpu and i upgraded it to 32gb :3

#

its just a shame the memory is slow :(

kind herald
#

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

grim sparrow
#

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

light owl
# kind herald mine was the i7-8650U without dGPU and a 1080p display

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

kind herald
#

So true twin

light owl
#

If you had a JOB you could BUY a replacement motherboard with the MONEY from your JOB

grim sparrow
#

omg i have a job!

fading shell
#

pls ban from the channel

magic hazel
#

They’re great machines

quaint rain
slim bramble
open fjord
#

Thinkpad supremacy

jagged willow
#

ever

#

i have zero use for it 😭 I wanna put windows back on my old laptop but I need to figure this out still

grim sparrow
#

every robot I work on runs linux in some way

#

so i have to do a lot of targeted dev

jagged willow
#

i have only a mac and balena etcher does not exactly “work”

#

I run my server off macOS by complete chance lmao

grim sparrow
#

i have a m1 mini acting as a ci runner

jagged willow
#

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)

cloud yacht
#

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

timid furnace
#

for desktops yes

#

for laptops it makes less sense

cloud yacht
#

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

jagged willow
quaint rain
#

Most have up to 3 drive bays

faint stag
#

this can't be real man 😭

cloud yacht
#

A large chunk of my server operations are still running on a rasberru pi 4

rocky oriole
#

might run a webserver on there also

jagged willow
rocky oriole
#

(what hosts a website)

jagged willow
#

oh

harsh junco
#

Does anyone happen to have modern patched tvos sdk
Like 14.0+

grim sparrow
magic hazel
#

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 💀

magic hazel
#

lmao

#

Me when devlogs

light owl
#

Okay

magic hazel
#

Anyone know where libswift comes from?

#

The one on bigboss

#

Is it just libswiftCore.dylib packaged?

#

LMAO

#

it's just all the swift dylibs

grim sparrow
#

It’s so apps don’t need to bundle the libs

#

Especially on iOS 12

#

I’ve got libswiftconcurrency on havoc

magic hazel
#

I tested that

#

Not on iOS 11>

grim sparrow
#

Mhm

magic hazel
grim sparrow
#

That sounds like a monumental amount of effort

#

For very little gain

magic hazel
#

I already have the dylibs

#

lol

grim sparrow
#

Surely Swift concurrency is gonna be ass to backporr

magic hazel
#

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

exotic dagger
#

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.

faint timber
#

The stuff on it is pretty automated. For example the procursus build system can build all the tools and deps for the ramdisk.

exotic dagger
#

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.

floral notch
#

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

#

so basically my question is, has anyone used OSX-KVM and got it to work? or is there a corellium alternative out there somewhere?

cloud yacht
#

it does work but it has no hardware acceleration so iOS sim is super slow

floral notch
#

how slow

#

like how many orders of magnitude

#

if its just 1, i could live with that

cloud yacht
#

¯_(ツ)_/¯

floral notch
#

lol

cloud yacht
#

I don't own a real macos device with modern metal drivers

floral notch
#

icic

#

i mean if its like 10-20x slower thats fine, but if its like 100x slower then that will be an issue

cloud yacht
#

try it and see

floral notch
#

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

faint timber
#

MacPro7,1 is still supported

harsh junco
heavy zephyr
#

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...

▶ Play video
timid furnace
#

this is for virtualized macOS

wooden yarrow
#

but also I'm pretty sure those licenses are now subscription based

heavy zephyr
wooden yarrow
#

well, maybe worse for businesses now though

heavy zephyr
#

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

Choose the right IDA plan: Professional, hobbyist, student, or enterprise. Flexible decompiler options, cloud or local deployment, collaboration tools.

wooden yarrow
#

yeahh

heavy zephyr
#

Wonder how many people switched to binary ninja because of the licensing changes alone

quaint rain
wooden yarrow
quaint rain
wooden yarrow
# floral notch i wanna set up some sort of automated testing thing for jailed and/or jb iOS sof...

You’ve followed the journey since our first QEMU boot logs. Now it’s time to open the doors: the iOS emulator will be available for early access.

📩 Apply to the shortlist. https://u.eshard.com/ios-emulator?utm_source=x

Limited time and spots. https://t.co/N5RlOcalvt

#

maybe wait a couple years

wooden yarrow
timid furnace
#

so this should be open source

#

wooden yarrow
#

!

#

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)

quaint rain
wooden yarrow
#

no amount of mail will be equivalent to the amount of effort they took to work on this

magic hazel
#

💀

reef trail
#

worked fine after following the instructions

magic hazel
#

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

hasty ruin
#

Many of them actually

heavy zephyr
#

Or I guess ten keyless discounts

magic hazel
radiant idol
#

Orange Name Only (ONO)

magic hazel
radiant idol
#

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

magic hazel
radiant idol
#

right, it's private

magic hazel
#

Oh so it’s invite only rather than blanket developer role

radiant idol
#

yeah

magic hazel
#

Makes sense

radiant idol
#

how's your Swift stuff going anyway?

magic hazel
#

Pretty good

#

I’m working on UI rn

#

I’ve replicated UIBlurEffect and now I’m working on the navigation bar

radiant idol
#

Fascinating

magic hazel
#

iOS 6->7->12->15

radiant idol
#

How's the experience of actually writing apps? (Minus the tediousness of UIKit vs SwiftUI)

magic hazel
#

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

radiant idol
#

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

magic hazel
#

It’d be the same as developing for modem iOS

#

Roughly

radiant idol
#

Neat

magic hazel
#

Ive added enough in at this point that it’s very close

radiant idol
#

Cool stuff man, exciting as well

magic hazel
#

Minus really a single thing

#

Scene delegate

radiant idol
#

Right

magic hazel
#

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

radiant idol
#

yeah

magic hazel
#

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

radiant idol
#

AppDelegate was only deprecated in iOS 26 I think, so you're fine

magic hazel
#

Types

radiant idol
#

Oh?

#

How'd you do it?

magic hazel
#

UIKitCompatKit.UIStackView

radiant idol
#

o

#

oh that's cool

magic hazel
#

YOu just prefix it with the module

#

You barely ever need to

radiant idol
#

nice

magic hazel
#

But at least if you do need to

#

You can

radiant idol
#

cool stuff

magic hazel
#

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

magic hazel
radiant idol
#

why iOS 7.0.1

#

that's odd

magic hazel
#

See

#

Minimum deployment for Swift is always 7.0

#

No matter what you do

radiant idol
#

mhm

magic hazel
#

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

radiant idol
#

wow lol

magic hazel
#

And like

#

Lets get real

#

Who the fuck is running 7.0.0

#

Basically nobody

radiant idol
#

I mean technically you could do a runtime check instead

magic hazel
#

It is a runtime check 😭

radiant idol
#

UIDevice.currentDevice.operatingSystemVersion or something

magic hazel
#

#available is runtime

radiant idol
#

yes yes

#

but I mean in a way that the compiler can't see

#

hold

magic hazel
#

also i get errors in the pkg

#

yeah

#

ig

#

actually wait

#

theres an easier way lmao

#

if #available iOS 6.2

#

💀

radiant idol
#

wait what

magic hazel
#

think a bout it

#

7 is above 6.2

#

6.2 never existed

#

so 6.1 will always go past it

radiant idol
#

does 6.2 not exist?

#

oh

#

try it

magic hazel
#

W

radiant idol
#

I'm curious

magic hazel
#

Can't even build Swift for iOS 6 from source bcus of Atomic_Store

radiant idol
#

:P

magic hazel
#

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 woeis

#

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

radiant idol
#

maybe what you should do is embrace iOS 6 instead of trying to make it look like iOS 7+

magic hazel
#

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

radiant idol
#

I guess

magic hazel
#

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

radiant idol
#

I think the main concern is just... what's the point

#

For big apps, anyway

magic hazel
#

But in general that's understandable

#

The point is why not

radiant idol
#

¯_(ツ)_/¯

hexed knot
#

The same reason it's standard for apps on the app store to support latest major iOS - 1

radiant idol
#

more targets to worry about, tiny userbase, shim might not be 100% perfect, etc

hexed knot
#

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

magic hazel
#

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

radiant idol
#

Sure but there is so many wonderful new APIs that apps use that just physically wouldn't be available on such old versions

magic hazel
radiant idol
#

In some cases, those APIs might be crucial for the app's functionality

radiant idol
#

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

magic hazel
#

I reckon I can get it pretty close

radiant idol
#

There are so many small random APIs

magic hazel
#

I spend my freetime reading apple's documentation

#

💀

radiant idol
#

like did you know TipKit was a thing? I found that out today

magic hazel
#

yes

#

lmao

#

its one of the libraries i looked into seeing if its worth replicating

radiant idol
#

interesting

magic hazel
#

then aagin

#

its ios 17+

#

and barely anyone uses it

#

thats like a super duper edge case

radiant idol
#

most apps today are iOS 16+ or iOS 17+

magic hazel
#

ios 16 is where im looking

#

ios 17 is a tad problematic

radiant idol
#

there are also apps that are iOS 18+, just FYI

magic hazel
#

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

radiant idol
#

Yeah but I can't even think of a modern app that requires a jailbreak that was released semi-recently lol

magic hazel
#

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

radiant idol
#

Good luck lol

cloud yacht
magic hazel
cloud yacht
#

Its a jailbreak

magic hazel
#

its a single ipad

#

💀

#

thats also absolutely shit to use

magic hazel
# radiant idol Good luck lol

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

radiant idol
#

that's a fair point, but the project itself is so niche, that's the main issue with adoption

magic hazel
#

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

magic hazel
#

iOS 13 introduced so much that iOS 12- misses out on

#

There's a substantial chunk of people still on an iPhone 6

radiant idol
#

Apps today are starting to use FoundationModels for example (iOS 26+), just mentioning

magic hazel
#

That won't be widely adopted for at least 3 years

#

That's generally how stuff goes

#

SwiftUI was like that as well

radiant idol
radiant idol
magic hazel
magic hazel