How to Insert the UITextView into UIAlertview in iOS
the following link has resolved my problem, the link is https://github.com/wimagguc/ios-custom-alertview
the following content has resolved
- textview
- tableview
- ImageView
- UIWebView
both functionalities are worked as fine for me
UIAlertView + UITextView
I need to know how to achieve multiline text input on a UIAlertView
You don't. If you need more than what a built-in UIAlertView gives you, make your own presented view controller that looks and acts like a UIAlertView, except that the view is your view and you can customize it however you like.
Multiline editable text UITextview inside UIAlertController?
This is good appraoch ...
func popUpController()
{
let alertController = UIAlertController(title: "\n\n\n\n\n\n", message: nil, preferredStyle: UIAlertController.Style.actionSheet)
let margin:CGFloat = 8.0
let rect = CGRect(x: margin, y: margin, width: alertController.view.bounds.size.width - margin * 4.0, height: 100.0)
let customView = UITextView(frame: rect)
customView.backgroundColor = UIColor.clear
customView.font = UIFont(name: "Helvetica", size: 15)
// customView.backgroundColor = UIColor.greenColor()
alertController.view.addSubview(customView)
let somethingAction = UIAlertAction(title: "Something", style: UIAlertAction.Style.default, handler: {(alert: UIAlertAction!) in print("something")
print(customView.text)
})
let cancelAction = UIAlertAction(title: "Cancel", style: UIAlertAction.Style.cancel, handler: {(alert: UIAlertAction!) in print("cancel")})
alertController.addAction(somethingAction)
alertController.addAction(cancelAction)
self.present(alertController, animated: true, completion:{})
}
Related Topics
Uitableview Row Animation Duration and Completion Callback
An App Id with Identifier '' Is Not Available. Please Enter a Different String
(Swift) How to Print "\" Character in a String
How to Fix Xcode "Dtassetproviderservice Could Not Start.." Error
Uitableviewcell with Dynamic Height iOS
Unique Identification of iOS Device for iOS 7.0 and Above
Custom Annotation View for Userlocation Not Moving the Mapview
Swiftui Mvvm Coordinator/Router/Navigationlink
What's the Difference Between All the Selection Segues
How to Create an Empty Application in Xcode Without Storyboard
Cannot Install Cocoa Pods After Uninstalling, Results in Error
Automatic Preferred Max Layout Width Is Not Available on iOS Versions Prior to 8.0
How to Determine Which Apps Are Background and Which App Is Foreground on iOS by Application Id
Getting Local Notifications to Show While App Is in Foreground Swift 3
How to Trap on Uiviewalertforunsatisfiableconstraints
How to Test If a String Is Empty in Objective-C
Why Does Apple Recommend to Use Dispatch_Once for Implementing the Singleton Pattern Under Arc