dagronf / DSFStepperView

A custom stepper text field for macOS and iOS, supporting Swift, Objective-C, SwiftUI and Catalyst
MIT License
65 stars 8 forks source link

Doc not correct #4

Closed DevulderJeanPaul closed 1 year ago

DevulderJeanPaul commented 2 years ago

On the documentation I see this this text: let format = NumberFormatter() format.numberStyle = .decimal

// Always display a single digit fractional value. format.allowsFloats = true format.minimumFractionDigits = 1 format.maximumFractionDigits = 1

stepperView.numberFormatter = format

but have this error is try in my code numberFormatter' is inaccessible due to 'internal' protection level

Thanks,

dagronf commented 2 years ago

Apologies for that. The numberFormatter property for the NSView did not have an access level specified (surprisingly it was there for the UIView variant), meaning it wasn't available outside the package. There's now a 2.0.1 release with the fix in place.

Tip for beginners -- checking for access levels in tests is fraught with danger. I thought I could write a test to check that I'd fixed the access levels, but with the @testable specifier the access levels are not the same as if you were accessing it from outside the package!

dagronf commented 2 years ago

Question: I'm assuming you were using the NSView version? You didn't specify what platform you were using. I tried both macOS and iOS and was able to reproduce the issue only in the macOS version.

DevulderJeanPaul commented 2 years ago

yes the problem are on macOS version 12.4 (Xcode 13.4) elsewhere I have created a tools with your class see here: https://github.com/DevulderJeanPaul/PlaygrndCreator

dagronf commented 2 years ago

Did the recent changes fix your issue?

dagronf commented 2 years ago

yes the problem are on macOS version 12.4 (Xcode 13.4) elsewhere I have created a tools with your class see here: https://github.com/DevulderJeanPaul/PlaygrndCreator

Looks great!