Comments (4)
As I mentioned here, I will add support for inputView and accessoryView. I will try to add it very soon.
Currently, you can override your ViewController's inputView and return your date picker, or you can create your own textView/textField, conform to TextInput
protocol and pass your date picker.
Something like this:
// For a more in-depth example, take a look at `AnimatedTextView` or `AnimatedTextField`. These classes are now internal, but they will be public in the next release.
class MyTextView: UITextView, TextInput {
var view: UIView {
return self
}
var currentText: String? {
get { return text }
set { self.text = newValue }
}
var currentSelectedTextRange: UITextRange? {
get { return self.selectedTextRange }
set { self.selectedTextRange = newValue }
}
var textAttributes: [String: Any]? {
didSet {
guard let attributes = textAttributes else { return }
typingAttributes = attributes
}
}
weak var textInputDelegate: TextInputDelegate?
var currentBeginningOfDocument: UITextPosition? {
return self.beginningOfDocument
}
func changeReturnKeyType(with newReturnKeyType: UIReturnKeyType) {
returnKeyType = newReturnKeyType
}
func currentPosition(from: UITextPosition, offset: Int) -> UITextPosition? {
return position(from: from, offset: offset)
}
}
class ViewController: UIViewController {
@IBOutlet var textInput: AnimatedTextInput!
override func viewDidLoad() {
textInput.placeHolderText = "Date picker"
let myTextInput = MyTextView()
//Configure and assign your input view
myTextInput.inputView = UIDatePicker()
textInputs[2].type = .generic(textInput: myTextInput)
}
}
from animatedtextinput.
@mukulm24 did you manage to do this?
from animatedtextinput.
@victorBaro Any clue for me being able to set inputView in AnimatedTextInput? Like UIPickerView or UIDatePicker
from animatedtextinput.
@mukulm24 @cesarmtz93 @jorgerebolloj
This PR has just been approved and merged in master. I will be generating a new version very soon with the new changes.
from animatedtextinput.
Related Issues (20)
- Underlyne style HOT 1
- How can i limit height for multiline HOT 4
- LineHeight only applies correctly to the first input in ViewController
- 'weak' should not be applied to a property declaration in a protocol and will be disallowed in future versions HOT 1
- RxSwift and AnimatedTextInput HOT 1
- how set textContentType? eg: oneTimeCode
- how to sent custom placeholder font HOT 1
- Label cut off bottom HOT 1
- Secured Entry HOT 1
- compile errors when using with Swift 3
- Setting first height bigger
- Numeric field
- how to do deleteBackward() and func textRange(from fromPosition: UITextPosition, to toPosition: UITextPosition) -> UITextRange?
- Add SPM Support
- I can't see it when I put the emoji as a value in the placeholder HOT 2
- iOS 13 dark mode support is not available
- Performance issue during text input HOT 1
- How to focus in AnimatedTextInput? HOT 1
- How to change text format? HOT 1
- After backspace, the letter after capital letter makes keyboard uppercase HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from animatedtextinput.