Skip to content

Commit

Permalink
Update init
Browse files Browse the repository at this point in the history
  • Loading branch information
vanthanhtran245 committed Sep 28, 2018
1 parent bfe6ef2 commit 462b0aa
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public extension UIAlertController {
/// - message: alert controller's message (default is nil).
/// - defaultActionButtonTitle: default action button title (default is "OK")
/// - tintColor: alert controller's tint color (default is nil)
public convenience init(style: UIAlertController.Style, source: UIView? = nil, title: String? = nil, message: String? = nil, tintColor: UIColor? = nil) {
convenience public init(style: UIAlertController.Style, source: UIView? = nil, title: String? = nil, message: String? = nil, tintColor: UIColor? = nil) {
self.init(title: title, message: message, preferredStyle: style)

// TODO: for iPad or other views
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public extension UIAlertController {
/// - Parameters:
/// - selection: action for selection of contact

func addContactsPicker(selection: @escaping ContactsPickerViewController.Selection) {
public func addContactsPicker(selection: @escaping ContactsPickerViewController.Selection) {
let selection: ContactsPickerViewController.Selection = selection
var contact: Contact?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public extension UIAlertController {
/// - maximumDate: maximum date of date picker
/// - action: an action for datePicker value change

func addDatePicker(mode: UIDatePicker.Mode, date: Date?, minimumDate: Date? = nil, maximumDate: Date? = nil, action: DatePickerViewController.Action?) {
public func addDatePicker(mode: UIDatePicker.Mode, date: Date?, minimumDate: Date? = nil, maximumDate: Date? = nil, action: DatePickerViewController.Action?) {
let datePicker = DatePickerViewController(mode: mode, date: date, minimumDate: minimumDate, maximumDate: maximumDate, action: action)
set(vc: datePicker, height: 217)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public extension UIAlertController {
/// - type: country, phoneCode or currency
/// - action: for selected locale

func addLocalePicker(type: LocalePickerViewController.Kind, selection: @escaping LocalePickerViewController.Selection) {
public func addLocalePicker(type: LocalePickerViewController.Kind, selection: @escaping LocalePickerViewController.Selection) {
var info: LocaleInfo?
let selection: LocalePickerViewController.Selection = selection
let buttonSelect: UIAlertAction = UIAlertAction(title: "Select", style: .default) { action in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public extension UIAlertController {
/// - Parameters:
/// - selection: type and action for selection of asset/assets

func addLocationPicker(location: Location? = nil, completion: @escaping LocationPickerViewController.CompletionHandler) {
public func addLocationPicker(location: Location? = nil, completion: @escaping LocationPickerViewController.CompletionHandler) {
let vc = LocationPickerViewController()
vc.location = location
vc.completion = completion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public extension UIAlertController {
/// - images: for content to select
/// - selection: type and action for selection of image/images

func addPhotoLibraryPicker(flow: UICollectionView.ScrollDirection, paging: Bool, selection: PhotoLibraryPickerViewController.Selection) {
public func addPhotoLibraryPicker(flow: UICollectionView.ScrollDirection, paging: Bool, selection: PhotoLibraryPickerViewController.Selection) {
let selection: PhotoLibraryPickerViewController.Selection = selection
var asset: PHAsset?
var assets: [PHAsset] = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public extension UIAlertController {
/// - values: values for picker view
/// - initialSelection: initial selection of picker view
/// - action: action for selected value of picker view
func addPickerView(values: PickerViewViewController.Values, initialSelection: PickerViewViewController.Index? = nil, action: PickerViewViewController.Action?) {
public func addPickerView(values: PickerViewViewController.Values, initialSelection: PickerViewViewController.Index? = nil, action: PickerViewViewController.Action?) {
let pickerView = PickerViewViewController(values: values, initialSelection: initialSelection, action: action)
set(vc: pickerView, height: 216)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public extension UIAlertController {
/// - Parameters:
/// - selection: type and action for selection of asset/assets

func addTelegramPicker(selection: @escaping TelegramSelection) {
public func addTelegramPicker(selection: @escaping TelegramSelection) {
let vc = TelegramPickerViewController(selection: selection)
set(vc: vc)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public extension UIAlertController {
/// - vInset: bottom margin to button
/// - configuration: textField

func addOneTextField(configuration: TextField.Config?) {
public func addOneTextField(configuration: TextField.Config?) {
let textField = OneTextFieldViewController(vInset: preferredStyle == .alert ? 12 : 0, configuration: configuration)
let height: CGFloat = OneTextFieldViewController.ui.height + OneTextFieldViewController.ui.vInset
set(vc: textField, height: height)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public extension UIAlertController {
/// - textFieldOne: first textField
/// - textFieldTwo: second textField

func addTwoTextFields(height: CGFloat = 58, hInset: CGFloat = 0, vInset: CGFloat = 0, textFieldOne: TextField.Config?, textFieldTwo: TextField.Config?) {
public func addTwoTextFields(height: CGFloat = 58, hInset: CGFloat = 0, vInset: CGFloat = 0, textFieldOne: TextField.Config?, textFieldTwo: TextField.Config?) {
let textField = TwoTextFieldsViewController(height: height, hInset: hInset, vInset: vInset, textFieldOne: textFieldOne, textFieldTwo: textFieldTwo)
set(vc: textField, height: height * 2 + 2 * vInset)
}
Expand Down
2 changes: 1 addition & 1 deletion AlertAndPickerUtils/Viewers/TextViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public extension UIAlertController {
/// - Parameters:
/// - text: text kind

func addTextViewer(text: TextViewerViewController.Kind) {
public func addTextViewer(text: TextViewerViewController.Kind) {
let textViewer = TextViewerViewController(text: text)
set(vc: textViewer)
}
Expand Down

0 comments on commit 462b0aa

Please sign in to comment.