File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
WooCommerce/Classes/Model Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -19,12 +19,22 @@ extension Address {
1919 return postalAddress. formatted ( as: . mailingAddress)
2020 }
2121
22- /// Returns the (clean) Phone number: contains only decimal digits
22+ /// Returns the (clean) Phone number: contains only decimal digits.
2323 ///
2424 var cleanedPhoneNumber : String ? {
2525 return phone? . components ( separatedBy: CharacterSet . decimalDigits. inverted) . joined ( )
2626 }
2727
28+ /// Returns the (Clean) Phone Number, as an iOS Actionable URL.
29+ ///
30+ var cleanedPhoneNumberAsActionableURL : URL ? {
31+ guard let phone = cleanedPhoneNumber else {
32+ return nil
33+ }
34+
35+ return URL ( string: " telprompt:// " + phone)
36+ }
37+
2838 /// Indicates if there is a Phone Number set (and it's not empty).
2939 ///
3040 var hasPhoneNumber : Bool {
You can’t perform that action at this time.
0 commit comments