toUIntMax() and toIntMax() removed from Swift 4
Asked Answered
M

2

24

What has replaced the method toUIntMax() and the method toIntMax() in Swift 4 ? The error occurred within the FacebookCore framework.

Any help would be appreciated

Mingle answered 24/6, 2017 at 14:29 Comment(0)
M
29

The concept of IntMax has been completely removed as part of SE-104.

Converting from one integer type to another is performed using the concept of the 'maximum width integer' (see MaxInt), which is an artificial limitation. The very existence of MaxInt makes it unclear what to do should someone implement Int256, for example.

The proposed model eliminates the 'largest integer type' concept previously used to interoperate between integer types (see toIntMax in the current model) and instead provides access to machine words. It also introduces the multipliedFullWidth(by:), dividingFullWidth(_:), and quotientAndRemainder methods. Together these changes can be used to provide an efficient implementation of bignums that would be hard to achieve otherwise.

In this specific case FB SDK should simply use the UInt64($0) initializer which is now available for any BinaryInteger type thanks to the new protocols.

Miltiades answered 24/6, 2017 at 14:51 Comment(0)
A
1

You can also for now, can select Swift 3.2 under Pods -> Targets -> ObjectMapper -> Swift language version option

Andriaandriana answered 3/11, 2017 at 4:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.