Roman Li

@romanli
3 Followers
8 Following
31 Posts
ios developer and mentor
linkedinhttps://www.linkedin.com/in/rmnl/
Link to the original article:
https://mezha.ua/articles/taiwan-310191/
Кінець цифрового світу: як вторгнення Китаю в Тайвань може зруйнувати світову економіку

Межа

Investments in new projects will be limited due to the risk of escalating conflict.

BUT IMHO if your company works in defense tech, alternative/renewable energy, or cybersecurity, you're probably cool 😎.

Please add, if I forgot something.

About the impact of the next conflict in the Middle East on IT companies.

Looks like this conflict won't be a short military operation. For now, I would expect that rising energy costs will drive up the cost of energy-intensive services (AI services, cloud computing, etc.). The disruption of shipping routes will increase the cost and time required to deliver hardware components from Asia.

#technology #it #iranWar

About Advanced observation tracking (SE-0506).

It looks like an improved version of the withObservationTracking function will be available in the near future, making it possible to more easily bind view models to UIKit objects (see example below). The lifetime of the observation can be controlled using ObservationTracking.Token. I like it.

Pull request in the swiftlang/swift repository - https://github.com/swiftlang/swift/pull/86719
Proposal - https://github.com/swiftlang/swift-evolution/blob/main/proposals/0506-advanced-observation-tracking.md

#swift

I think we really need the ability to report AI-generated non-sense and to flag AI-generated responses on stackoverflow as "AI-generated".

I don't blame those who write such responses. But in large numbers, it's very harmful to the developer community, especially to beginners.

#ai #swift

... In the example, an implicit conversion occurs from 'UnsafeRawPointer?' to 'UnsafePointer<CChar>!', so 'assumingMemoryBound(to:)' can be removed and the code can be simplified to three clear lines.

The list of all possible conversions: https://github.com/swiftlang/swift-evolution/blob/main/proposals/0324-c-lang-pointer-arg-conversion.md#detailed-design

#swift

swift-evolution/proposals/0324-c-lang-pointer-arg-conversion.md at main · swiftlang/swift-evolution

This maintains proposals for changes and user-visible enhancements to the Swift Programming Language. - swiftlang/swift-evolution

GitHub

About Swift and Relax diagnostics for pointer arguments to C functions (SE-0324).

In my opinion, SE-0324 is often overlooked or underestimated. But it significantly simplifies working with the C API thanks to implicit pointer conversions. For example, it's acceptable in many cases to pass an argument of type 'UnsafeRawPointer' to a C function. Before SE-0324, we were required to use 'assumingMemoryBound(to:)' (see example below).

Post continues below.

#swift

About Swift and the upcoming async defer blocks (SE-0493) with cancellation shields (SE-0504).

If they don't change the cancellation shields API, the example below will likely become a common pattern for asynchronous resource clean-up. And we'll say goodbye to '''try await Task { try await cleanup() }.value'''.

I'm not sure about the name 'withCancellationShield' though. But in any case, I think it's gonna be a pretty significant improvement.

#swift

About XML and HTML parsing.

I've now accumulated a lot of code that could be contributed as an SPM library for XML/HTML parsing. See below for a simple example of how I currently parse an HTML file loaded into Data. The 'query' and 'subscript' functions accept an XPath string as a parameter.

What do you think?

What do you usually use in your projects for XML parsing?

#swift #xml #html #xpath