XCTUnwrap vs force unwrap

Here’s the code if you want to experiment with it!

import XCTest

class MyTests: XCTestCase {
    func test() throws {
        let myData = [1, 2, 3]
        let first = try XCTUnwrap(myData.first)
        XCTAssert(first<3)
    }
}
Previous
Previous

modern API of UIButton