Introduced by TMB Bank by creating iOS Component based on user daily use activity to aim for Clean cut design and easy to use in Daily Transactions Do not use it for any commercials
Created by Primary Banking1 iOS
Last updated 23 Mar 2021
Use it wisely
Follow the instruction of adding Swift Package Manager by using url to TMB Local Git Repository https://bitbucket.tmbbank.local:7990/scm/one/oneapp-ios-widgets.git
than use version 0.0.14 - Next Major
Follow the step until complete adding package to Project file
iOS Widgets comes with 2 dependency below for now
NO NEED TO ADD to swift package manager
iOS Widgets has been developed to response user’s behaviour by remaining clean but professional. Each of element uses depends on behaviour follow the TMB One Design Guideline. Now it has all these elements below
Inherit From UIButton. Remaining the same functionality and APIs
PrimaryBigButton
PrimaryLargeButton
PrimaryMediumButton
or PrimarySmallButton
iOSWidgets
Inherit From UIButton. Remaining the same functionality and APIs
SecondaryLargeButton
SecondaryMediumButton
or SecondarySmallButton
iOSWidgets
Inherit From UIButton. Remaining the same functionality and APIs but comes with Dark Mode!
SecondaryLargeButton
SecondaryMediumButton
or SecondarySmallButton
iOSWidgets
Series of rounded button support only one selection with horizontal scrollable view. Easy to use Inherit from UIView
PrimaryPillCategorySourceProtocol
by func createPill(source: Pills) -> [String]?
func sizeForItem(source: Pills, at index: Int) -> CGSize?
func didSelected(source: Pills, item: String, index: Int)
func didDeselected(source: Pills, item: String, index: Int)
SecondaryLargeButton
SecondaryMediumButton
or SecondarySmallButton
iOSWidgets
import iOSWidgets
source
variable like this pillsSelection.source = self
PrimaryPillCategorySourceProtocol
by extension
like thisextension OwnTransferViewController: PrimaryPillCategorySourceProtocol {
func createPill(source: Pills) -> [String]? {
return [Array Of String Items]
}
func sizeForItem(source: Pills, at index: Int) -> CGSize? {
[Size for each items, return nil to dynamic width 30px height]
return CGSize() ?? nil
}
func didSelected(source: Pills, item: String, index: Int) {
///Do something
}
func didDeselected(source: Pills, item: String, index: Int) {
///Do something
}
}
pillsSelection.font = UIFont.system
pillsSelection.spacing = 8.0
pillsSelection.deselectable = true
Inherit From UITextField. Remaining the same functionality and APIs but comes with theses! ps. support only single line
.icon: UIImage
.title = "Input Here"
.action() closure
PrimaryError
PrimaryTextField
iOSWidgets
**Also can create programmatically in Code same as UITextField but beware of constraints of width and heigh
Create struct, class or enum that conforms PrimaryError
like this
protocol PrimaryError: Error {
var description: String? { get}
}
create Enum to conforms above by
enum TransferValidationError: PrimaryError {
case amountIsNeeded
case insufficientAmount
case needToAccount
case noteIsTooLonge
<span class="token keyword">var</span> description<span class="token punctuation">:</span> <span class="token builtin">String</span><span class="token operator">?</span> <span class="token punctuation">{</span>
<span class="token keyword">switch</span> <span class="token keyword">self</span> <span class="token punctuation">{</span>
<span class="token keyword">case</span> <span class="token punctuation">.</span>amountIsNeeded<span class="token punctuation">:</span>
<span class="token keyword">return</span> <span class="token string">"Please enter an amount."</span>
<span class="token keyword">case</span> <span class="token punctuation">.</span>insufficientAmount<span class="token punctuation">:</span>
<span class="token keyword">return</span> <span class="token string">"Your account has insufficient funds for this transaction."</span>
<span class="token keyword">case</span> <span class="token punctuation">.</span>needToAccount<span class="token punctuation">:</span>
<span class="token keyword">return</span> <span class="token string">"Please select destination account"</span>
<span class="token keyword">case</span> <span class="token punctuation">.</span>noteIsTooLonge<span class="token punctuation">:</span>
<span class="token keyword">return</span> <span class="token string">"Note is too long"</span>
<span class="token punctuation">}</span>
<span class="token punctuation">}</span>
<span class="token punctuation">}</span>
That’s it! Now you’re ready…
Inherit From UITextView with the design but Remaining the same functionality and APIs. Support multiple lines with no scrollview but EXTEND THE HEIGHT! and last but not least also support PLACEHOLDERrrrrr
.icon: UIImage
.title = "Input Here"
.placeholder = "This is optional"
.action() closure
PrimaryError
same as PrimaryTextFieldsPrimaryTextView
iOSWidgets
**Also can create programmatically in Code same as UITextView but beware of constraints of width and heigh
ps. PrimaryTextFields
and PrimaryTextView
have the same mother
TTBBaseBlueDesign
TTBBaseWhiteDesign
link |
Stars: 1 |
Last commit: 26 minutes ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco