Thread with 3 posts
jump to expanded postgirls will really write shit like this and think it's okay
- (())bringSubviewToFront:(id)subview {
let &mut UIViewHostObject {
ref mut subviews,
layer,
superview,
} = env.objc.borrow_mut(this);
let idx = subviews.iter().position(|&subview2| subview2 == subview).unwrap();
let subview2 = subviews.remove(idx);
assert!(subview2 == subview);
subviews.push(subview);
if superview != nil {
() = msg![env; layer removeFromSuperlayer];
let superlayer = env.objc.borrow::<UIViewHostObject>(superview).layer;
() = msg![env; superlayer addSublayer:layer];
}
}
@hikari Is this what Swift looks like or did someone invent Objective Rust?
@olsner hi yes I invented this