#development

1 messages Β· Page 239 of 1

magic hazel
#

im guessing about 10 to unzip

radiant idol
#

πŸ‘€

magic hazel
#

2 minutes

#

alr its expanding

#

yeah its taking its time :/

#

and yep i cant run xcode 6 beta 3 anymore

#

sadge

#

oh shit

#

idek if i can run the sdk for ios 7

#

xcode 6 beta 3 just crashes

#

nearly done

#

its done

#

time to fire it up

#

installing components

#

sure as hell is taking its time

#

man its drawing this out

#

alright

#

time to put swift 3 code in

radiant idol
#

moment of truth

magic hazel
#

built

#

transfering

#

had a bunch of api changes

#

or

#

renamings

radiant idol
#

yeah

#

I bet

magic hazel
#

here it goes

#

sideloading

#

im actuallynervous

radiant idol
#

lool

magic hazel
#

god damn it

radiant idol
#

crashes?

magic hazel
#

yes

radiant idol
#

F

magic hazel
#

lets see why

#

HOLD On

#

SYMBOL NOT FOUND

#

dispatch_data_destructor_munmap

radiant idol
#

if you start patching those back in you're gonna fall into a giant rabbithole

magic hazel
#

ugh its expected in systemb.dylib

#

i am assuming i cannot just steal ios 7's

#

and have it work fine

radiant idol
#

I meannn

#

I suppose you could try

magic hazel
#

replacing a system dylib?

radiant idol
#

good luck with that

#

you could try bundling it in with your app and then replacing the load command

magic hazel
#

what if i used an older sdk

radiant idol
#

it's quite involved

magic hazel
#

yikes

radiant idol
#

I mean it's possible, but realistically that thing is probably gonna depend on another system thing and then you're gonna fall into that rabbithole

magic hazel
#

im gonan restore my iphone 4 to ios 7 and attempt to steal that dylib

radiant idol
magic hazel
#

i highly doubt replacing the ios 6 dylib will go dwell

radiant idol
radiant idol
#

If I were you, I would stick with Swift 2, it seems to work great

magic hazel
#

i have like 30 legacy devices

#

im prolly gonna end up sticking w swift 2 but

#

if i can possibly get swift 3 to work

magic hazel
radiant idol
magic hazel
#

kay so its just 1 thing

#

1 single thing

radiant idol
#

not necessarily

magic hazel
#

the rest are all ios 5

radiant idol
#

maybe in this file

#

other places it might require more

magic hazel
#

i could try a dummy shim

radiant idol
#

you could try

magic hazel
#

okay

#

if i just include

#

a .c and .h file

#

will swift automatically find it

#

and use it

#

or do i have to do funni stuff

radiant idol
#

no, you need to also have a bridging header

magic hazel
#

but i'm not using it in my code

#

shouldnt the swift runtime just find it t hrough dyld

radiant idol
#

oh I see what you mean

#

uh, you can try that

#

Swift doesnt care about that, you just need to make sure Xcode bundles the non Swift code in

magic hazel
#

how can i tell if it is or isnt doing that

radiant idol
#

you'd probably need to put your bin in a decompiler

#

that would be the robust way to do it

magic hazel
#

same crash

#

maybe its not bundling

radiant idol
#

or you can run nm <path/to/bin> and see if the function is there

magic hazel
#

alright im gonna go for it

#

im gonna replace the dylib

#

if not

#

ill try including in app

#

oh oh oh wait

#

i have a device on dev beta 1

#

that would be the closest to ios 6

#

i wonder if its included on that

radiant idol
#

how many legacy devices do you have wow

magic hazel
#

uh

radiant idol
#

oh

magic hazel
#

lmao

#

pretty much all of them

#

except ipads

#

okay

#

update

#

doesnt work on 7db1

#

SHIT

#

ITS CALLING ANOTHER FUNCTION

#

"NSURLUBiqutoesitejmdownloaderrorkey"

#

idk what that is

radiant idol
#

is that seriously what it's called

magic hazel
#

NSURLUbiquitousItemDownloadingErrorKey

radiant idol
#

oh

magic hazel
#

that's the naem

radiant idol
#

well start shimming more

#

L

#

or just use Swift 2

magic hazel
#

first ima test on 7.1.2

#

to see if it even works

#

ppl may have been bullshittin

magic hazel
#

its in corefoundation

#

πŸ’€

radiant idol
#

that makes sense

magic hazel
#

not me tempted to yoink the libraries

magic hazel
#

idk if theres a way to try and idk

#

force it

#

how does one force the swift runtime to use my shim

#

if i can make a packet of shims to fix the errors then swift 3 may be viable

#

well

#

it doesnt crash on 7.1.2

#

but its also a black scren

#

hold up

#

that dylib does not exist in ios 7

#

ah but libdispatch.dylib does

#

oooh

#

the folder isnt even there on ios 6

#

exciting stuff

#

libdispatch.dylib doesnt exist on ios 6

#

from what i can see

#

meaning i am not overwriting anything

#

hmm

#

having issues transfering

#

alr time to transfer over

#

rebooting

#

grr

#

it can't find it

#

alr

#

ima try swift 2.2

#

oooh

#

i could try a swift 3 beta as well

#

wait i cant i dont have betaarchive access

#

HA someone archived it

#

beta 1 in fact

#

MAYBE itll be early enough to work

#

who knows

radiant idol
#

what time is it where you're at

#

you've been at this for so long

magic hazel
#

2:24pm

#

lmao

#

wbu

#

when i get focused on something im relentless

radiant idol
#

oh

#

12:24 AM

magic hazel
#

yikes

radiant idol
#

nah, normal waking hours for me

magic hazel
radiant idol
#

lol

magic hazel
#

alr torrenting the 8.0 beta while download swift 2.2

#

i will find the absolute limit

#

LMAO i just started torrenting on both my mac and my desktop and i was like damn desktop is faster BEFORE REALISING IT WAS TORRENTING OFF MY LAPTOP

#

LMAO

#

thats wild

#

god i hope its not swift 2.2

radiant idol
#

wdym

magic hazel
#

i hope its not swift 2.2 that ruins it

radiant idol
#

ah

magic hazel
#

my hopes rn:
swift 2.2 support
swift 3.0 db1 support

#

its possible they did something between release and db that stuffed it

#

like how they removed official swift support for ios 6 in db 3

#

and im very lucky i dont have to deal with the shithole website that is betaarchive

#

alr gonna try xcode 7.3.1 first

#

i wonder how new of a macos version can run that

#

also we havent really pushed swift 2.0

#

then again like you said as long as we're careful and stay inside the confines of obj c ios 6 apis

#

it really shouldnt have any issues

#

yeah okay so swift 3.0 is build 800 and 2.2 is build 703

#

so it is actually highly likely

#

that somewhere in there

#

WAIT WAIT

#

when was swift open sourced

radiant idol
#

I think it was always open sourced, no?

magic hazel
#

no

#

swift 1.0 wasnt

radiant idol
#

oh

magic hazel
#

2.2 WAS

#

so that means every single build

#

since then

#

is publicly avaliable

#

i could potentially replace the compiler

#

inside xcode

#

with an older version of 3.0

#

oh wait ill have to change back the 3.0 code

#

thats fine

#

actually technically you can use "older swift version" on xcode 8

#

THIS CAME BEFORE THE BETA ITSELF

radiant idol
magic hazel
#

fuck

radiant idol
#

no no

#

that's good

#

we don't want that

#

on iOS 6, at least from what you mentioned, that thing doesnt exist

magic hazel
#

WAIT THAT MEANS THERE MIGHT BE HOPE

#

FOR XCODE 8 BETA 1

#

YES THERE IS

#

theres 6 betas

#

theres 6 previews

#

holy shit

#

this might work

#

although

radiant idol
#

you should write a writeup about this when you get done lol

magic hazel
#

there was some other stuff

#

in corefoundation

#

then again

#

who knows

#

yeah maybe

#

idk what id put in there

#

alright time to test swift 2.22

#

still torrenting the other suff

magic hazel
radiant idol
#

oo

magic hazel
#

also idk if that means it doesnt contain it and it needs it

#

like you have to supply it

radiant idol
#

πŸ€·β€β™‚οΈ

magic hazel
#

we'll see ig

#

anyways

#

2.2

#

sideloading now

#

heres to hoping at least it works

#

black screen but it works

#

no crash

#

okay thats good

#

so swift 2.2

radiant idol
#

a black screen is better than a crash, but still not as good as a working app

magic hazel
#

i think the code just broke

#

bcus updates

radiant idol
#

try verifying whether the code actually runs

magic hazel
#

yeah ima od that now

#

ill test onsim

#

i mean it was black on 7.1.2

#

so

#

i didnt even consider i only have 256gb of space

#

lmao

#

i might run out

#

so many xcode builds

#

black screen on the sim asw

#

lmao it was just app delegate

#

works in sim now

#

time to test on device

#

swift 2.2

#

so thats fully usable

#

5 mins left on the torrent

#

then i have to copy over usb to my hack

#

and then expand

#

WAIT

#

THE PREVIEW CONTAINS CORELIBS FOUNDATION

#

THERE ACTUALLY MAY BE HOPE

#

chatgpt is my biggest opp

#

"most likely will not work"

#

bled said that about swift 2

#

so did everyone on stack exchange and well

#

everywhere

#

so fair enough

#

honestly im in shock we got this far

#

how the fuck did nobody try this in like a decade

#

its legit nearly been a decade since swift 2.0 released

#

πŸ’€

#

and nobody tried it

radiant idol
#

someone probably did and then forgot about it lol

magic hazel
#

maybe yeah

#

ill make a writeup so nobody forgets

#

im sure chatgpt will remember my conversation and ITS DONE

#

alr

#

time to stansfer

#

thats a pretty big improvement

radiant idol
#

tuple splat syntax

#

what

magic hazel
radiant idol
#

what in the world

magic hazel
#

lmao

#

gotta love the classic "omit needless words"

#

basically the entirety of swift 3 is contained in that 1 sentence

#

funnily enough those are the actual words apple used

#

i mean the progress i've made today is pretty big

#

swift 2.2 over obj c is huge

#

not just objc but obj c with ios 6 apis

#

honestly idk how much hope i have for swift 3.0

#

harddrive is crying

#

thats not even including all the extra shit xcode installs

#

alr copying beta over and ill expand

#

exciting stuff

#

ngl half of me hopes beta 1 works purely so i dont go down the rabbithole of literally testing every commit that came before it

#

to try and pinpoint which broke it

#

alr expanding

#

way less commits to sort through

#

launching

#

i mean this is it

#

if this doesnt work i have to sort through commits

#

built

#

ngl kinda nervous

#

sideloading

#

its not gonna work

#

goddamn it

robust radish
#

when the adderall hits

magic hazel
#

same error

#

UGH

#

NOOO

#

nah i cant let this go

#

im going commit sorting

#

swift 2.3 exists

#

SWIFT_CC(swift) DISPATCH_RUNTIME_STDLIB_INTERFACE
extern "C" dispatch_block_t
_swift_dispatch_data_destructor_munmap(void) {
return _dispatch_data_destructor_munmap;
}

#

there is it

#

it was the final commit

#

but the final commit kinda added a fucktonne

#

okay so

#

thats that bit solved

#

now i need NSURLUbiquitousItemDownloadingErrorKey

#

okay im gonna build the swift toolchain

#

ima use my more modern hackintosh for this

#

πŸ’€

#

lmao im putting way too much effort into this πŸ’€

#

not to mention there could be so many problems that arise from using an older commit

#

also this is probably going to take hours to compile

#

only for it not to work

magic hazel
#

Ugh this is not building

#

Couldn't find cmark source directory.
./utils/build-script: command terminated with a non-zero exit status 1, aborting

#

blud

#

its right there

#

building

#

nvm

#

still finding dependencies

#

this is such a pain

#

all this purely to compile

#

maybe someone more skilled with this stuff could compile for me i'm having a pretty hard time i've never been good with cmake

magic hazel
#

FINALLY COMPILING oml

#

itll prolly fail

#

failed

#

i hate this

#

im compiling cmake now

#

imgetting a headach

#

idek if its worth the effort atp

magic hazel
#

KJSAHDKJSAh

#

im doing the whole thing again

#

oh my god

#

yet anothe freaking version of cmake

#

im going ot crash out

hasty ruin
#

all this just for swift πŸ’”πŸ’”

harsh junco
#

@magic hazel send commit

magic hazel
harsh junco
#

nvm

magic hazel
magic hazel
slim bramble
harsh junco
slim bramble
robust radish
#

if we’re hating, lets add Go to the fire

slim bramble
#

Go is objectively less of a pain than rust

robust radish
#

I can’t objectively compare, I’ve never gotten passed the toolchain setup part of rust

slim bramble
#

LOL

robust radish
#

$5 to anyone who can show me how to target iOS armv7 from an apple silicon Mac host (with rust)

magic hazel
#

πŸ˜”

#

Why are you targeting iOS with rust though πŸ’€

sonic totem
#

Every time I look at Rust code it seems 10x more complicated than C and unnecessarily so

#

I remember there being rumours Apple would rewrite XNU in Rust frcoal

robust radish
#

my friend made a jb for old iOS in rust for fun. he used an x86 mac

I tried for hours to build it from my m1 machine and eventually gave up

fading shell
robust radish
sonic totem
harsh junco
sonic totem
#

let mut bro just use var

harsh junco
#

auto

robust radish
fading shell
robust radish
#

fwiw my friend (that made it) couldn’t get it working on m1 either 🀣

#

admittedly this was like 2y ago and I haven’t revisited it

fading shell
#

it says in the docs that it supports armv7s-apple-ios

robust radish
fading shell
#

seems like anything < 1.74 supports it then

slim bramble
#

????

magic hazel
#

Time to attempt recompiling the swift 3.0 pre beta 1

#

This time on macOS 10.11

#

On my haswell hack

#

All in the name of getting swift 3 support on a single extra version

#

iOS 6 swift 3 is the dream

harsh junco
slim bramble
harsh junco
#

@magic hazel i have a better idea

magic hazel
harsh junco
#

ub*ntu 17.10 chroot

magic hazel
#

The build is based around Xcode

#

It’s easier that way

harsh junco
#

no

#

xcode is ass

harsh junco
magic hazel
harsh junco
#

You can change this

magic hazel
#

I don’t care I’ll just use Xcode

#

Why go to all the effort

#

not only that but linux builds are barely supported on swift 3

robust radish
#

Why go to all the effort
no way you said that

harsh junco
magic hazel
#

okay fair

#

i am already going to a tonne of effort

#

again though, i'll just use the environment it's designed for

#

i already have 10.11 fired up

#

i have all the kinks worked out for the build

#

i'm not about to go through a whole new set of issues

#

not to mention it wants an ancient version of ubuntu

#

yet more problems

#

also i'm going to the effort for good purpose!!

#

swift 3 on ios 6

#

very cool

#

swift 2.2 on ios 6 is already pretty great

#

and here's the best part, i reckon it'll work on ios 5 with some dylib patching and shims

#

atp idek how ima document all this

#

ima try

#

chatgpt is really pulling me through this build process ngl

#

and for swift 1

#

there's no documentation for it

#

somehow it knows

#

ugh i have to install homebrew on this old ass machine

#

there is no winning here

#

why am i putting myself through massive pain

#

i couldve just used swift 2.2....

#

nah its so i can give a big fuck you to apple for "dropping" ios 6 support

#

they CLEARLY didnt need to

#

swift 2.2 is extremely stable on ios 6

#

and i have a feeling i can get a version of swift 3 not far off the first preview that works fine

robust radish
#

that’s a lot of messages

sonic totem
sonic totem
#

Okay not that true but it supports my point

robust radish
#

depends on context but i tend to agree. maintainability > performance. Not everything has to be as fast as possible

magic hazel
#

ye

#

not my haswell hack compiling whatever you're forced to compile with homebrew sounding like an actual wind turbine

fading shell
#

quake 3 fast inverse square root does not need to be very maintainable

magic hazel
robust radish
tepid nacelle
trail nimbus
#

lmao

magic hazel
#

i deeply dislike ugly code

#

hence my dislike of objc

#

not as bad as C tho

tepid nacelle
#

what

magic hazel
#

c code is disgusting

fading shell
#

C may be confusing but objc is a lot uglier imo

magic hazel
#

no

#
Task* createTask(int id, const char* desc) {
    Task* t = (Task*)malloc(sizeof(Task));
    t->id = id;
    strncpy(t->description, desc, 99);
    t->description[99] = '\0';
    t->print = printTask;
    return t;
}
#

C is disgusting

robust radish
#

damn are yall dissin me rn

magic hazel
#

no

#

im HARD dissing c

#

im mildly disliking objc

fading shell
magic hazel
#

yes i have

fading shell
#

it doesn't get much uglier than that

magic hazel
#
int main() {
    int n,i;char d[100];Task**t;
    printf("How many tasks? ");scanf("%d",&n);
    t=(Task**)malloc(n*sizeof(Task*));
    for(i=0;i<n;i++){printf("Task %d desc: ",i+1);scanf(" %[^\n]",d);t[i]=(Task*)malloc(sizeof(Task));t[i]->id=i+1;strcpy(t[i]->description,d);}
    for(i=0;i<n;i++){printf("Task %d: %s\n",t[i]->id,t[i]->description);}
    for(i=0;i<n;i++){free(t[i]);}free(t);
    return 0;
}
#

try me

sonic totem
#

I don’t like slow code, but if my code is ugly I won’t keep working on it

fading shell
magic hazel
#

it looks like ass even with it

#

πŸ’€

tepid nacelle
sonic totem
robust radish
#

hating. I like c and objc

sonic totem
#

A good Darwin block function

robust radish
#

not about objc++ though. I think Saurik killed that for me

magic hazel
#

C is shit

#

C has no place in the modern world except extremely low level stuff

fading shell
magic hazel
#

Literally any language is better

magic hazel
#

alr ima compile tmrw

magic hazel
#

if anyone wants to

#

feel free to compile so i dont have to

#

much appreciated

#

gn

manic forum
#

why is there swift discussion

#

isn't swift banned here

slim bramble
#

@aaron please filter it

#

Wtf it won’t ping

#

Alfie pov

manic forum
#

developers should have ban perms against people who talk about swift here

slim bramble
manic forum
#

no ??

slim bramble
#

I thought it was

#

Mb

manic forum
#

it runs on the wii

#

i don't think there's a swift runtime for the wii

slim bramble
harsh junco
harsh junco
timid furnace
#

if you know C and object-oriented programming Objective-C is very simple

#

it just becomes syntax at that point

torpid steppe
#

Bit of a long shot: If anyone here has any knowhow on ZK SNARKS/STARKS and roll ups, dm me.

gentle grove
#

rust fans unable to use any argument other than "muh performance"

#

rust haters unable to use any counterargument other than contrived, unidiomatic, and nonstandard rust code looking ugly

#

This channel is the best in the server

magic hazel
#

It’s a perfectly fine language

rocky oriole
#

lies

harsh junco
magic hazel
#

Dude there's like close to 5 million people who use the language just fine

#

πŸ’€

#

Idk why ppl dog on Swift so much when so many people can use it just fine

#

Sounds like a skill issue ngl or just hating bcus tryna force a language to do something than it's meant to

#

I mean it's definitely imperfect but Swift 6 is pretty awesome

#

It's an attempt to give a C power language the simplicity of Python

#

It's not an easy task

gentle grove
#

bro pulled the 5 million out of their ass

manic forum
#

what's your point

magic hazel
#

that's my point exactly

#

chrome is a great example

#

not the best browser

#

but its perfectly fine for a lot of people

#

it does it's job

#

if it's working for the people who like using it why shit on it

#

(except C, C is archaic)

native dune
#

i only shit on swiftui

magic hazel
#

honestly i don't understand shitting on anything that works for those who it's designed for

#

if you like objective c and c based languages and you dislike the more simplistic and hands off approach swift is going for then yes no shit you won't like it

thorn acorn
magic hazel
#

is it at all perfect not a change swift is deeply flawed but so is every other language

#

except C but C is archaic and that's it's flaw

hollow oar
bleak prairie
magic hazel
#

ugh i have to compile cmake from source again

harsh junco
#

why

magic hazel
#

because cmake 3.15 is nonexistent

#

precompiled

#

this shit gonna take forever

#

also not me setting my ca certificate to be a downloaded pem file sitting in my downloads folder

#

bcus macos flipped out

#

current steps

cd swift
git remote add origin https://github.com/swiftlang/swift.git
git fetch --depth 1 origin 6a0fb2b1888b158fd6cf73893564d6f5dc46349d
git checkout FETCH_HEAD

./utils/update-checkout --clone --branch swift-3.0-preview-1-branch

cd

curl -LO https://cmake.org/files/v3.15/cmake-3.15.7.tar.gz && \
tar -xzvf cmake-3.15.7.tar.gz && \
cd cmake-3.15.7 && \
mkdir build && cd build && \
../bootstrap --prefix=/usr/local && \
make -j$(sysctl -n hw.ncpu) && \
sudo make install && \
cmake --version```
#

ill probably make one long chain of commands that users can copy paste for ease of use

#

thats not done yet i still have to include all the build commands

#

ill get there in the end

#

ay its actually building faster than on my more modern hack

#

thats crazy

#

maybe bcus lighter toolchain and lighter os

magic hazel
#

welp it seems that my mac hates my certs

#

so i manually downloaded ninja

#

finally finally compiling

light owl
#

Thats why @native dune is using it for nocturned

light owl
#

@native dune Is it working btw

native dune
#

Aaron removed our manage messages perm just pretend i deleted that

acoustic imp
#

WHAT

visual meadow
#

wtf

#

how dare he

gentle grove
#

I hope he removes all your permissions

visual meadow
rocky oriole
# acoustic imp WHAT

it's because the manage messages permission got updated and separated out the pin permission so aaron only gives pin perm now

also for geniuses :/

magic hazel
#

THIS IS THE FIFTH TIME IVE RECOMPILED SWIFT TO GET AN ERROR OMG

magic hazel
#

okay so

#

i think it really was that final commit

#

it added 18k lines

#

and both errors i got, ios 7 and 6 were related to a method referenced in that commit

#

its bcus it was a huge conversion

#

they moved away from NS types

#

to swift types

#
public var ubiquitousItemDownloadingStatus : URLUbiquitousItemDownloadingStatus? { return _get(.ubiquitousItemDownloadingStatusKey) }
magic hazel
#

i think i might finally be getting into the final stages of the build

#

after so much trial and error

magic hazel
#

it built!!!

#

time to test it

magic hazel
#
Dyld Error Message:
  Symbol not found: __TMps10SetAlgebra
  Referenced from: /var/mobile/Applications/89DE44C5-10CC-466A-A504-20D61ACCEC75/Colour Snap Legacy.app/Colour Snap Legacy
  Expected in: /private/var/mobile/Applications/89DE44C5-10CC-466A-A504-20D61ACCEC75/Colour Snap Legacy.app/Frameworks/libswiftCore.dylib
 in /var/mobile/Applications/89DE44C5-10CC-466A-A504-20D61ACCEC75/Colour Snap Legacy.app/Colour Snap Legacy
  Dyld Version: 212.3.2```
#

whats causing this errro

magic hazel
#

WAIT WAIWT AUIDT ASDUSAYHD

#

I THINK IVE FIXED IT HOLY SHIT

#

HOLY FUCKING SHIT

#

I GOT SWIFT FUCKING 3 ON IOS 6

#

I DID IT

#

IT IS SO JANKY

#

BUT IT SO WORKS

#

OH MY GOD

manic forum
#

πŸ™

magic hazel
#

THIS TOOK SO SO MUCH WORk

#

I AM SO HAPPY IT WORKS

#

HOLY SHIT

#

THIS IS ACTUALLY FREAKING INSANE

slim bramble
#

like 2w late

magic hazel
#

working on streamlining the process

#

ngl idk if i want to use swift 3 anymore tho the setup is kinda jank

#

@radiant idol i got swift 3 working!

#

its kinda mid tho

#

its not full swift 3

#

ima ditch it, it's DEFINITELY not production ready LOL

#

BUT it does work

#

and it's closer to swift 3 than 2.2 is

#

so

#

that's cool

slim bramble
magic hazel
#

ios 6

slim bramble
#

Seek help

magic hazel
#

hehe

#

this took 2 days of shit

#

not fun at all

#

idk how many times i had to rebuild the toolchain

#

how many issues i had

#

its kinda cooked

#
import UIKit

class ViewController: UIViewController {
    
    let button = UIButton(type: .system)
    let colors: [UIColor] = [.red()]
    var currentColorIndex = 0
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        // Set title
        self.title = "Color Changer"
        
        // Initial background
        self.view.backgroundColor = colors[currentColorIndex]
        
        // Setup button
        button.setTitle("Change Color", for: [])
        button.frame = CGRect(x: 0, y: 0, width: 160, height: 50)
        button.center = self.view.center
        
        // Add target with #selector
        button.addTarget(self, action: #selector(buttonTapped), for: .touchUpInside)
        
        self.view.addSubview(button)
    }
    
    // New-style selector method
    @objc func buttonTapped() {
        // Change background color
        currentColorIndex = (currentColorIndex + 1) % colors.count
        self.view.backgroundColor = self.colors[self.currentColorIndex]
    }
}```
#

notice anything odd?

#

there are some oddities compared to swift 3

#
import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
    
    var window: UIWindow?
    
    func application(_ application: UIApplication,
                     didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
        window = UIWindow(frame: UIScreen.main().bounds)
        window?.rootViewController = ViewController()
        window?.makeKeyAndVisible()
        return true
    }

}
#

same here

#

its the methods

#

main() instead of main

#

its quite odd

slim bramble
#

I mean it's just faster to just use objc atp

magic hazel
#

nah swift 2.2 works natively

#

idk why nobody tried it

#

you dont have to do shit

#

it just works

slim bramble
magic hazel
#

ig yeah

#

swift 2.2 is a nice wrapper for obj c

slim bramble
#

Every line end up being a objc_msgSend of some sort 😭

magic hazel
#

bcus obj c syntax makes me wanna puke

slim bramble
magic hazel
#

not really

#

its pretty similar

#

its basically negligible icl i ran some stress tests

#

at least on an a5

#

maybe its worse on a4

#

the overhead is basically meaningless

slim bramble
#

Well, you probably don't notice it, but all of the data types (eg. strings) have to be converted from swift strings to NSString

magic hazel
#

yes i know all too well what happens in the background prior swift 3/5

slim bramble
magic hazel
#

ive tried every swift version now from 1-6 including swift 1 developer betas

#

HOWEVER

#

who gives a shit

#

its easier to code in

#

okay now i get to choose

#

do i want a shitty swift 3 lookalike

#

thats buggy and hard to build for

#

OR

#

stable swift 2.2

#

but worse syntax

slim bramble
#

OR

#

plain objc

magic hazel
#

i will never use objc

#

i deeply dislike it

slim bramble
#

That's your first mistake

magic hazel
#

its overcomplicated and slow

#

its not a mistake

#

its a choice

#

an active choice

#

its my preference

#

there's no objectivity here

#

they will both do exactly the same task

#

like you said, swift will literally end up translating down to objc

#

i just prefer how swift looks

#

i stop working on projects when i stop enjoying reading my code

#

i lose interest when using obj c extremely quickly

slim bramble
#

:///

magic hazel
#

the only ACTUAL downside to using swift is my builds will be 20mb bigger

#

but thats pretty much it

#

there's no other objective difference

slim bramble
#

LOLLLLL

#

How does that even happen 😭

magic hazel
#

its actually the best part of swift

#

it includes the dylibs

#

thats the secret sauce

#

thats how it can run on ios 6

slim bramble
#

(I won't talk about the build time which is probably huge)

magic hazel
#

it stopped doing that in swift 5

#

oh no

#

its quick asf

#

in fact its quicker than obj c LMAO

slim bramble
wooden yarrow
slim bramble
#

You can do that in every language

wooden yarrow
#

in the app bundle

slim bramble
magic hazel
#

except that swift is including it's entire runtime

#

anyways

#

i think i should make a writeup

#

for any interested devs

#

swift 2.2 is super viable

#

swift 3.0 will be avaliable if you're desperate

robust radish
#

unsubscribed

#

(you should def do a writeup tho)

magic hazel
#

yeah i put way too much effort into this to not do one

#

ive never done one before tho

#

so im not really sure how to

robust radish
#

same. i tried to do a blog-style writeup on iOS' rendering pipeline and it turned into like 20 page of just boring documentation

magic hazel
#

surely i can get dev role for this woeis

wooden yarrow
slim bramble
#

@hollow scaffold

magic hazel
#

should i do it before or after i make the writeup

slim bramble
#

After

magic hazel
#

alr

#

should i include the struggles of building swift

#

bcus i really doubt anyone will ever go to the trouble of doing this again

#

it was utter hell

#

i had to build every single dependency from scratch on specific versions and literally do source edits to get the thing to compile

wooden yarrow
#

the struggles make it engaging to read

magic hazel
#

fair fair

#

got any good examples of writeups i can read

robust radish
#

mike ash's friday blogs on objc troll

magic hazel
#

alr bled

#

nice try

robust radish
#

its the best technical content i've read fr

but perhaps more applicable to you, exploit writeups? like siguzas stuff

magic hazel
#

nvm he's pointing out flaws in objc

robust radish
#

he owns the objc runtime now

magic hazel
#

wait what

#

actually?

robust radish
#

he's the DRI @ apple for it

magic hazel
#

oh damn

#

that's wild

#

does apple even update obj c anymore

robust radish
#

yes, its still getting features and improvements

#

like direct dispatch

magic hazel
#

ngl one thing i hate in c based languages is pointers

slim bramble
magic hazel
#

in the big 25 the language should be able to figure it out on its own

robust radish
#

nshipster has good technical content too, but it's not very "writeup-y". mattt is an OG

#
magic hazel
#

wait wait

#

is that swift

robust radish
#

yeah

magic hazel
#

i knew it his syntax is rather odd tho

#

eh nr

#

just using custom types

#

okay ive seen writeups like this

#

but mine is a bit less technical

#

well

robust radish
#

the post is more about a programming concept (originally published as a research paper with a c# impl), and he translated it into a swift impl

magic hazel
#

kinda

#

half of it is differences between swift versions

#

and half is the build process

#

and why swift can run on ios 6 at all

robust radish
#

writeups are hard. i would start with including anything and everything, then start trimming and organinzing to make it approachable

magic hazel
#

alr

#

ill start tmrw

slim bramble
#

@robust radish how long have you been around iOS ?

magic hazel
#

for now as much as i wanna switch back my toolchain ima keep it on swift 3

#

in case i need to test more for writeup

slim bramble
#

oh

magic hazel
#

ios 4

robust radish
#

lol yep

magic hazel
#

ios 4 sdk was such a big improvement over the ios 3 sdk

robust radish
#

it was crazy when we got wallpapers

magic hazel
#

i remember watching every single keynote

#

apple keynotes used to be engaging

#

now they're corporate slop

#

#bringbacklivekeynotes

robust radish
magic hazel
#

πŸ’€ how much are you paying for that domain

robust radish
#

too much

wooden yarrow
magic hazel
magic hazel
#

its sad

#

they were so much better

#

hearing the audience reaction makes the keynote feel more tangible

#

plus you don't really get the gravity of stuff like "one more thing" anymore

robust radish
magic hazel
#

LMAO

#

10k hell no

#

thats wild

#

aint nobody paying 10k πŸ’€

#

how much are you paying for it rn?

robust radish
#

not 10k

magic hazel
#

lmao imagine nobody bids

#

ima bookmark this

#

10 dollar domain coming my way

robust radish
#

hidden reserve

magic hazel
#

grr

#

whats the reserve

#

ima forget in 2 days anyways

#

lmao

#

i dont need a domain

#

i already have one

slim bramble
#

.org 😭

magic hazel
#

its dirt cheap

robust radish
magic hazel
#

its actually free rn

#

and its 10 aud a year

slim bramble
magic hazel
robust radish
slim bramble
#

I guessed so

magic hazel
#

ios.pro is probably like idk 100 a month i'd guess dyld maybe like 50?

robust radish
#

hold on lemme get into namecheap. my domain list is crazy

magic hazel
#

πŸ’€

slim bramble
magic hazel
#

holy fuck

#

per month??

slim bramble
#

year

magic hazel
#

thats still fucking cooked bro what

#

how much is it tho

slim bramble
#

They all don't even do anything 😭

robust radish
magic hazel
wooden yarrow
magic hazel
magic hazel
robust radish
#

cloudflare, namecheap, and namesilo

magic hazel
#

Cloud flare?? Which is libswift

robust radish
#

libswift is namecheap

magic hazel
#

Aw man

robust radish
#

cloudflare is a registrar now, they're πŸ”₯

magic hazel
#

I like cloudflare

#

Is namecheap a decent seller

robust radish
#

libswift gets like 1k unique visitors a day

magic hazel
#

Damn

robust radish
magic hazel
#

That’d be really good for my write up it’s such a perfect fit for the idea

robust radish
#

i got it last november for $16

magic hazel
#

A year? I’d pay that much

#

Wait it’s usd tho

#

25 aud

#

I’d probably still pay that

magic hazel
#

lmao

#

Wild

harsh junco
robust radish
#

I have some NeXT stuff. everything it runs written in objc πŸ”₯

#

you'd be surprised at how familiar the APIs on these are. the origins of Foundation. NSString, NSArray, all that

grim sparrow
magic hazel
#

i think ima backport swift 3 syntax into swift 2

harsh junco
radiant idol
lime pivot
lime pivot
#

wsusscn2.cab gets only 107 uniques a day

#

I wonder if anyone actually depends on this for real

#

I made non-browser user agents redirect to the actual Microsoft file

gentle grove
magic hazel
faint timber
#

How tf do you pay for food without a job

magic hazel
# radiant idol Ooooo

Indeed. I think I am going to just back port some swift 3 syntax though, this build is quite annoying to work with

magic hazel
faint timber
#

Surely there’s other expenses

magic hazel
#

No?

#

Like what

#

My board and food is taken care of

#

I don’t drive

#

Everything is walking distance

faint timber
#

Cool

magic hazel
#

I don’t drink

#

Alcohol is a poison

faint timber
#

No one said it wasn’t

magic hazel
#
//
//  Extensions.swift
//  Learning UIKit
//
//  Created by JWI on 28/08/2025.
//  Copyright (c) 2025 JWI. All rights reserved.
//

import Foundation
import UIKit


//Swift 3 Timer
class ClosureTimer: NSObject {
    let block: (NSTimer) -> Void
    
    init(block: (NSTimer) -> Void) {
        self.block = block
    }
    
    @objc func fire(timer: NSTimer) {
        block(timer)
    }
}

extension NSTimer {
    
    // Swift 3-style API
    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)
    }
}

typealias Timer = NSTimer



class ClosureSleeve: NSObject {
    let closure: () -> Void
    
    init(_ closure: () -> Void) {
        self.closure = closure
    }
    
    @objc func invoke() {
        closure()
    }
}


//Swift 3 Button
extension UIButton {
    func addAction(for controlEvents: UIControlEvents, _ closure: () -> Void) {
        let sleeve = ClosureSleeve(closure)
        addTarget(sleeve, action: #selector(ClosureSleeve.invoke), forControlEvents: controlEvents)
        // Store sleeve to retain it
        objc_setAssociatedObject(self, String(format: "[%d]", arc4random()), sleeve, .OBJC_ASSOCIATION_RETAIN)
    }
}



extension UIColor {
    class var red: UIColor { return UIColor.redColor() }
    class var green: UIColor { return UIColor.greenColor() }
    class var blue: UIColor { return UIColor.blueColor() }
    class var black: UIColor { return UIColor.blackColor() }
    class var white: UIColor { return UIColor.whiteColor() }
    class var gray: UIColor { return UIColor.grayColor() }
    class var yellow: UIColor { return UIColor.yellowColor() }
    class var orange: UIColor { return UIColor.orangeColor() }
    class var purple: UIColor { return UIColor.purpleColor() }
    class var brown: UIColor { return UIColor.brownColor() }
    class var clear: UIColor { return UIColor.clearColor() }
}


#
func withAnimation(duration: NSTimeInterval = 0.25,
                   delay: NSTimeInterval = 0,
                   options: UIViewAnimationOptions = [],
                   repeatAnimation: Bool = false,
                   animations: () -> Void) {
    
    var finalOptions = options
    if repeatAnimation {
        finalOptions = finalOptions.union(.Repeat)
    }
    
    UIView.animateWithDuration(duration,
                               delay: delay,
                               options: finalOptions,
                               animations: animations,
                               completion: nil)
}```
#

thats actually a swiftui method

#

actually nvm i can use the uikit one

magic hazel
#
import UIKit

class MainMenuViewController: UIViewController {
    let startButton = UIButton(type: .Custom)
    let gameTitle = UILabel()
    
    override func viewDidLoad() {
        let viewHeight = view.frame.height
        
        super.viewDidLoad()
        let colors: [UIColor] = [.red, .blue, .green, .orange, .purple]
        
        self.view.backgroundColor = .clear
        
        
        let backgroundView = UIView(frame: view.bounds)
        backgroundView.backgroundColor = colors.randomElement()!
        view.addSubview(backgroundView)
        
        let _ = Timer.scheduledTimer(withTimeInterval: 1.5, repeats: true) { _ in
            withAnimation(1.5, animation: .CurveEaseInOut) {
                backgroundView.backgroundColor = colors.randomElement()!
            }
        }
        
        
        gameTitle.text = "Colour Snap!"
        gameTitle.backgroundColor = .clear
        gameTitle.translatesAutoresizingMaskIntoConstraints = false
        view.addSubview(gameTitle)
        
        view.addConstraint(NSLayoutConstraint(item: gameTitle, attribute: .CenterX, relatedBy: .Equal, toItem: view, attribute: .CenterX, multiplier: 1, constant: 0))
        view.addConstraint(NSLayoutConstraint(item: gameTitle, attribute: .CenterY, relatedBy: .Equal, toItem: view, attribute: .Top, multiplier: 1, constant: viewHeight*0.15))
        
        startButton.setTitle("Play", forState: .Normal)
        startButton.translatesAutoresizingMaskIntoConstraints = false
        startButton.backgroundColor = UIColor.gray.colorWithAlphaComponent(0.4)
        startButton.layer.cornerRadius = (self.view.frame.width * 0.25) / 2
        startButton.layer.shadowRadius = 5
        startButton.layer.shadowColor = UIColor.black.CGColor
        startButton.layer.shadowOpacity = 0.5
        startButton.adjustsImageWhenHighlighted = false
        startButton.addAction(for: .TouchUpInside) {
            let gameVC = GameViewController()
            gameVC.modalTransitionStyle = .CrossDissolve
            self.presentViewController(gameVC, animated: true, completion: nil)
        }
        
        view.addSubview(startButton)
        view.bringSubviewToFront(startButton)
        view.layoutIfNeeded()
        
        view.addConstraint(NSLayoutConstraint(item: startButton, attribute: .CenterX, relatedBy: .Equal, toItem: view, attribute: .CenterX, multiplier: 1, constant: 0))
        view.addConstraint(NSLayoutConstraint(item: startButton, attribute: .CenterY, relatedBy: .Equal, toItem: view, attribute: .CenterY, multiplier: 1, constant: 0))
        view.addConstraint(NSLayoutConstraint(item: startButton, attribute: .Width, relatedBy: .Equal, toItem: view, attribute: .Width, multiplier: 0.25, constant: 0))
        view.addConstraint(NSLayoutConstraint(item: startButton, attribute: .Height, relatedBy: .Equal, toItem: startButton, attribute: .Width, multiplier: 1, constant: 0))
        
        
    }
    
    override func viewDidLayoutSubviews() {
        super.viewDidLayoutSubviews()
        startButton.titleLabel?.font = UIFont.systemFontOfSize(startButton.frame.width*0.25)
        gameTitle.font = UIFont.systemFontOfSize(view.frame.width*0.1)
    }
    
}



#

swift 3 syntax on swift 2.2

#

as i code, if i run into issues with stuff i could usually do in swift i'll patch it into my extensions.swift helper library

#

eventually i will probably attempt to replicate nearly all of swift 3's renamings in that library

quaint rain
#

Ai slop

#

β€œβ€”β€œ

#

β€œIt’s not only this, it’s that”

quaint rain
#

@kind herald

kind herald
#

GIR is thinking…

magic hazel
#

backporting part of swift 4 as well

rocky oriole
magic hazel
#

i implemented this:

#
UIColor(red: .random(in: 0.5...1), green: .random(in: 0.5...1), blue: .random(in: 0.5...1))
#

i also implemented withAnimation properly

magic hazel
magic hazel
#

β€œSwift 3-5” code running through my SwiftCompatKit for swift 2.2 on iOS 6

#

Ive decided I’m re implementing as much as swift 3-5 as I feel like

#

It’s really not that hard

#

It’s just a bunch of api changes and closures

#

Modern Swift APIs are so much better than the obj c based swift ones

#

I hate selectors

#

Some APIs I’ll change slightly

#

One I needed was button.addaction

#

It’s usually button.addaction( UIAction { your code }, for: .whatever)

#

I made it so it’s button.addaction(for .whatever) { your code}

#

Closure based

#

Much more swifty

#

That api doesn’t even come until iOS 14 though so

#

And the button api is add target, yet again selector based

#

Too many options to fill out just for a simple button to run code

grim sparrow
#

my monthly phone bill is close to Β£120 rn

#

$162 freedom units

#

Going out somewhere with friends

#

Trips?

pearl sail
#

Hello Developers please troll your fellow developers by letting grok read their codebases and then suggest improvement then open issues on their GitHub’s with AI imagined BS

magic hazel
magic hazel
magic hazel
magic hazel
#

Contract?

#

I buy every phone I own outright

#

I loathe contracts

#

And I always buy second hand

grim sparrow
#

I have 8 lines

#

6 of which have roaming

onyx ember
wooden yarrow
#

dual standby not enough for you you need multistandby

grim sparrow
#

i travel a lot

wooden yarrow
#

hm

#

surely you dont need multiple lines though

grim sparrow
#

Each device has 2 lines

wooden yarrow
#

wtf

grim sparrow
#

One with each carrier

wooden yarrow
#

for redundancy?

grim sparrow
#

kinda

#

its because theyre the top 2 in the coutnry for coverage

#

and they often have coverage where the other doesn't

wooden yarrow
#

oh so you're using the same 2 carriers across devices

grim sparrow
#

ergo, have both, pretty much covered everywhere

wooden yarrow
#

hm

grim sparrow
#

mhm

#

im not counting the 10 or so lines i got for signal reborn

#

turns out you really can just email carriers asking for "free trials' and they send you a payg sim

#

with a few Β£ on it

wooden yarrow
#

damn

#

sounds like a great way to get IoT sims

grim sparrow
#

real

#

i have lines in test phones, test ipads, spare laptops

#

i juggle them around

wooden yarrow
#

is there any real reason for you to have 2 lines for each device that are all different though apart from the fact that you need those devices connected to signal though

grim sparrow
#

but it ends up at 8 lines

wooden yarrow
#

like theoretically would a cloned sim suffice

grim sparrow
#

but uhh

#

while uk carriers didnt care

#

german did

light owl
wooden yarrow
#

without having access to the NSA's list of Kis

grim sparrow
#

so i go on the carrier website

#

and press

#

"request new esim"

#

and it doesnt invalidate the old one

#

both can actively make data connections

wooden yarrow
#

huh what the heck

grim sparrow
#

BUT only one will get phone calls / texts

#

and i believe its always the newer sim

wooden yarrow
#

my carrier invalidates the sims πŸ’”

grim sparrow
#

BUT apple ecosystem sorta numbs this out

#

cause calls and texts are sent everywhere

wooden yarrow
#

true

grim sparrow
#

so the non-clones are in things not in the eco system

#

such as work devices on a different icloud or the humble twinkpad

wooden yarrow
#

makes sense

grim sparrow
#

which runs arch linux (btw) so sadly does not benefit from the apple ecosyst4em

#

and the moment apple ships a macbook with cellular im copping

#

and im hoping that will actually happen now we got the apple modem

#

choosing to believe the only reason macs didnt have cellular is not wanting to pay qualcomm a royalty

grim sparrow
#

yeah that tracks

#

i rmemeber reading years ago it would happen

#

and im hoping those "it would happen" were reasons apple started modem dev

wooden yarrow
#

ipads already have cellular and ipads are getting ever closer to macs so with this i guess ipads and macs get ever closer

#

at the very least using the modem on more products helps with economies of scale

grim sparrow
#

See I think thats because the profit margins on iPhones and iPads are similar and they wanted iPads to be even more portable than macbooks

#

macbooks are portable but typically everywhere you use it is indoors