Custom view for phone number display, following the SVA+ requirements. Written in Objective-C.
BkVASPhoneView is IBDesignable/IBInspectable compliant. Simply drag and drop a UIView on your storyboard/XIB, change the class to "BkVASPhoneView" and you can customize the phone number, type/color and fee display.
BkVASPhoneView works great with Auto-Layout : juste like a regular UILabel, by not setting a specific width and height, its size will not exceed the size it requires.
Please note that IBDesignable feature is not available through a Carthage installation. Please see #335 for more information.
To instantiate a BkVASPhoneView :
Objective-C :
BkVASPhoneView *phoneView = [[BkVASPhoneView alloc] initWithPhoneNumber:@"0 825 123 456" feeType:BkVASFeeTypePremium fee:@"0,34€/min" size:BkVASPhoneSizeSmall];
[self.view addSubview:phoneView];
Swift :
let phoneView = VASPhoneView(phoneNumber: "0 802 12 12", feeType: .premium, fee: "0,34€/min", size: .small)
self.view.addSubview(phoneView)
To re-use an instance of BkVASPhoneView and configure it with new informations :
Objective-C :
[phoneView configureWithPhoneNumber:@"0 825 123 456" feeType:BkVASFeeTypePremium fee:@"0,34€/min" size:BkVASPhoneSizeSmall];
Swift :
phoneView.configure(phoneNumber: "0 802 12 12", feeType: .premium, fee: "0,34€/min", size: .small)
To run the example project, clone the repo, and run pod install
from the Example directory first.
BkVASPhoneView is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "BkVASPhoneView"
For Swift projects (includes Swift aliases for classes and enums) :
pod "BkVASPhoneView/Swift"
github "Backelite/BkVASPhoneView"
Run carthage update
to build the framework and drag the built BkVASPhoneView.framework
(along with BkVASPhoneViewSwift.framework
for Swift projects) (in Carthage/Build/iOS folder) into your Xcode project (Linked Frameworks and Libraries in Targets
).
iOS 7+ (through CocoaPods)
iOS 8+ (through Carthage)
David Yang, david.yang@backelite.com
BkVASPhoneView is available under the MIT license. See the LICENSE file for more info.