Skip to content

Commit 5d837de

Browse files
author
Jishnu Raj T
committed
pod update
1 parent 8aee5a5 commit 5d837de

File tree

3 files changed

+66
-70
lines changed

3 files changed

+66
-70
lines changed

Example/iOSDropDown/ViewController1.swift

Lines changed: 58 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -6,102 +6,95 @@
66
// Copyright © 2018 JRiOSdev. All rights reserved.
77
//
88

9-
import UIKit
109
import iOSDropDown
10+
import UIKit
1111

1212
class ViewController1: UIViewController {
1313
@IBOutlet var customData: [DropDown]!
1414
@IBOutlet var customView: UIView!
15-
@IBOutlet weak var segment: UISegmentedControl!
16-
@IBOutlet weak var valueLabel: UILabel!
17-
@IBOutlet weak var mainDropDown: DropDown!
18-
15+
@IBOutlet var segment: UISegmentedControl!
16+
@IBOutlet var valueLabel: UILabel!
17+
@IBOutlet var mainDropDown: DropDown!
18+
1919
override func viewDidLoad() {
2020
super.viewDidLoad()
21-
let option = Options()
22-
mainDropDown.optionArray = option.countries
21+
let option = Options()
22+
mainDropDown.optionArray = option.countries
2323
mainDropDown.optionIds = option.ids
2424
mainDropDown.checkMarkEnabled = false
2525
mainDropDown.semanticContentAttribute = .forceRightToLeft
26-
cstmbutn.isHidden = true
26+
mainDropDown.textColor = .red
27+
cstmbutn.isHidden = true
2728
customView.isHidden = true
28-
mainDropDown.didSelect{(selectedText , index , id) in
29+
mainDropDown.didSelect { selectedText, index, id in
2930
self.valueLabel.text = "Selected String: \(selectedText) \n index: \(index) \n Id: \(id)"
3031
}
31-
32+
3233
mainDropDown.arrowSize = 10
3334
// Custom DropDown Data
34-
self.customData[0].optionArray = option.boolData
35-
self.customData[2].optionArray = option.color
36-
self.customData[3].optionArray = option.color
37-
self.customData[4].optionArray = option.height
38-
self.customData[5].optionArray = option.height
39-
self.customData[6].optionArray = option.boolData
40-
self.customData[0].isSearchEnable = false
41-
self.customData[2].isSearchEnable = false
42-
self.customData[3].isSearchEnable = false
43-
self.customData[4].isSearchEnable = false
44-
self.customData[5].isSearchEnable = false
45-
self.customData[6].isSearchEnable = false
46-
//Custom Dropdown didSelect
47-
48-
self.customData[0].didSelect(completion: { (selected, index, id) in
49-
self.mainDropDown.isSearchEnable = Bool(selected)!
50-
})
35+
customData[0].optionArray = option.boolData
36+
customData[2].optionArray = option.color
37+
customData[3].optionArray = option.color
38+
customData[4].optionArray = option.height
39+
customData[5].optionArray = option.height
40+
customData[6].optionArray = option.boolData
41+
customData[0].isSearchEnable = false
42+
customData[2].isSearchEnable = false
43+
customData[3].isSearchEnable = false
44+
customData[4].isSearchEnable = false
45+
customData[5].isSearchEnable = false
46+
customData[6].isSearchEnable = false
47+
// Custom Dropdown didSelect
5148

52-
self.customData[2].didSelect(completion: { (selected, index, id) in
53-
if #available(iOS 11.0, *) {
54-
self.mainDropDown.selectedRowColor = UIColor(named:selected)!
55-
} else {
56-
// Fallback on earlier versions
57-
}
58-
})
59-
self.customData[3].didSelect(completion: { (selected, index, id) in
60-
if #available(iOS 11.0, *) {
61-
self.mainDropDown.rowBackgroundColor = UIColor(named:selected)!
62-
} else {
63-
// Fallback on earlier versions
64-
}
65-
})
66-
self.customData[4].didSelect(completion: { (selected, index, id) in
67-
self.mainDropDown.listHeight = CGFloat(Float(selected)!)
68-
})
69-
self.customData[5].didSelect(completion: { (selected, index, id) in
70-
self.mainDropDown.rowHeight = CGFloat(Float(selected)!)
71-
})
72-
self.customData[6].didSelect(completion: { (selected, index, id) in
73-
self.mainDropDown.hideOptionsWhenSelect = Bool(selected)!
74-
})
75-
76-
segment.addTarget(self, action: #selector(ViewController1.segmentedDidChange(_:)), for: .valueChanged)
77-
78-
79-
49+
customData[0].didSelect(completion: { selected, _, _ in
50+
self.mainDropDown.isSearchEnable = Bool(selected)!
51+
})
52+
53+
customData[2].didSelect(completion: { selected, _, _ in
54+
if #available(iOS 11.0, *) {
55+
self.mainDropDown.selectedRowColor = UIColor(named: selected)!
56+
} else {
57+
// Fallback on earlier versions
58+
}
59+
})
60+
customData[3].didSelect(completion: { selected, _, _ in
61+
if #available(iOS 11.0, *) {
62+
self.mainDropDown.rowBackgroundColor = UIColor(named: selected)!
63+
} else {
64+
// Fallback on earlier versions
65+
}
66+
})
67+
customData[4].didSelect(completion: { selected, _, _ in
68+
self.mainDropDown.listHeight = CGFloat(Float(selected)!)
69+
})
70+
customData[5].didSelect(completion: { selected, _, _ in
71+
self.mainDropDown.rowHeight = CGFloat(Float(selected)!)
72+
})
73+
customData[6].didSelect(completion: { selected, _, _ in
74+
self.mainDropDown.hideOptionsWhenSelect = Bool(selected)!
75+
})
76+
77+
segment.addTarget(self, action: #selector(ViewController1.segmentedDidChange(_:)), for: .valueChanged)
8078
}
79+
8180
@objc func segmentedDidChange(_ sender: UISegmentedControl) {
8281
let index = sender.selectedSegmentIndex
8382
if index == 0 {
8483
customView.isHidden = true
8584
cstmbutn.isHidden = false
86-
}else{
85+
} else {
8786
customView.isHidden = false
88-
8987
}
90-
9188
}
9289

9390
@IBAction func doneActn(_ sender: Any) {
9491
customView.isHidden = true
95-
self.mainDropDown.touchAction()
92+
mainDropDown.touchAction()
9693
}
97-
94+
9895
@IBAction func custmAct(_ sender: Any) {
9996
customView.isHidden = false
10097
}
101-
102-
103-
@IBOutlet weak var cstmbutn: UIButton!
104-
105-
10698

99+
@IBOutlet var cstmbutn: UIButton!
107100
}

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,20 +129,23 @@ Closures
129129
}
130130
```
131131

132-
## Customize iOSDropDown 🖌
132+
## Customizes iOSDropDown 🖌
133133

134-
You can customize these properties of the drop down:
134+
You can customizes these properties of the drop down:
135135
- `isSearchEnabled ` : You can Enable or Disable on DropDown .Default value Is `true`
136136
- `hideOptionsWhenSelect` : This option to hide the list when click option one item. Default value is `true`
137137
- `selectedRowColor` : Color of selected Row item in DropDown Default value is `.cyan`
138138
- `rowBackgroundColor` : Color of DropDown Default value is `.white`
139139
- `listHeight`: The maximum Height of of List. Default value is `150 `
140140
- `rowHeight`: The Height of of List in the List. Default value is ` 30`
141141
- `selectedIndex`:For preSelection of any of item in list
142-
- `Alingment and Fonts are same as TextField You Can change it`
143142
- `arrowSize`: The Size of arrow . Default value is `15 `
144143
- `arrowColor`: The Color of arrow . Default value is `.black `
145144
- `checkMarkEnabled`: The check Mark Enabled for selection of Row. Default value is `true `
145+
- `textColor ` : You can change DropDown selected Text Color
146+
- `semanticContentAttribute ` : Semantic attribute for RTL or LTR
147+
-
148+
- `All Other TextField Properties are available with DropDown` like `alignment`,`font`,`textColor`,`semanticContentAttribute` ...etc
146149

147150
## Note :
148151

iOSDropDown.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88

99
Pod::Spec.new do |s|
1010
s.name = 'iOSDropDown'
11-
s.version = '0.3.4'
11+
s.version = '0.4.0'
1212
s.summary = ' iOSDropDown is an Awesome DropDown Library with Search and other customization options'
1313
s.swift_version = '5.0'
1414
s.description = <<-DESC
15-
iOSDropDown is an Awesome Drop Down Menu Library with Search & other customization options For iOS
15+
iOSDropDown is an Awesome Drop Down Menu Library with Search & other customizations options For iOS
1616
DESC
1717

1818
s.homepage = 'https://github.com/jriosdev/iOSDropDown'

0 commit comments

Comments
 (0)