Android App Development
iOS App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 3.0.3.7 release ready!
Deniel Kerr
Founder. Opencart
Top Partners
As per Apple Documentation, the definition of Formatter is “An abstract class that declares an interface for objects that create, interpret, and validate the textual representation of values”. We have already seen the most commonly used Formatter like DateFormatter and NumberFormatter. In this blog, we will look into some lesser-known Built-in Formatter.
DateFormatter
NumberFormatter
1) MeasurementFormatter => It availability is from iOS 10. It provides localized representations of units and measurements. Let see an example of it.
In the above example, we have created the measurementFormatter method and after that, we have called it from viewDidLoad.
2) PersonNameComponentsFormatter => It availability is from iOS 9.0+. It provides localized representations of the components of a person’s name. So, this formatter will be useful whenever we have to parse and format a person’s name. Now we will see how to use this formatter.
Similarly, like measurementFormatter method, we have created an example method of personNameformatter. And called it from viewDidLoad.
3) RelativeDateTimeFormatter => It creates locale-aware string representations of a relative date or time. Let see an example of it.
4) ByteCountFormatter => It converts a byte count value into a localized description that is set up with the appropriate byte modifier. Therefore it is useful whenever we need byte value into localized human readable form.
You can also check other blogs from here. if you have any issue or suggestion you can leave your query/suggestion in the comment section.
Your email address will not be published. Required fields are marked*
Name*
Email*
Save my name email and website in this browser for the next time I comment.
Be the first to comment.
We use cookies to personalize your experience. By continuing to visit this website you agree to our use of cookies. Learn more about privacy policy
Excellent work, fast, good quality and understood the brief perfectly! Quick responses developing the project and very good cooperation. I suggest to anyone.
Stathis Plakidas
USA
India
Global
Name
Email
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.