PixateFreestyle doesn't work well in iOS 9 beta
markddaa opened this issue · comments
what I did:
- I use Xcode 7 beta, simulator iOS 9 beta, and Object-C
- create a demo project with one button and a UIAlertViewController with textfield
- add "pod 'PixateFreestyle'" in the podfile
- run pod install
- import <PixateFreestyle/PixateFreestyle.h> and add [PixateFreestyle initializePixateFreestyle]; in main.m
- run the app
what I got:
the textfield size is incorrect
===============source code=============
-
(IBAction)buttonPressed:(id)sender {
[self showAlert];
} -
(void)showAlert
{
// use UIAlertController
UIAlertController *alert= [UIAlertController
alertControllerWithTitle:@"Enter Folder Name"
message:@"Keep it short and sweet"
preferredStyle:UIAlertControllerStyleAlert];UIAlertAction* ok = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action){
//Do Some action here
UITextField *textField = alert.textFields[0];
NSLog(@"text was %@", textField.text);}];
UIAlertAction* cancel = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {NSLog(@"cancel btn"); [alert dismissViewControllerAnimated:YES completion:nil]; }];
[alert addAction:ok];
[alert addAction:cancel];[alert addTextFieldWithConfigurationHandler:^(UITextField *textField) {
textField.placeholder = @"folder name";
textField.keyboardType = UIKeyboardTypeDefault;
}];[self presentViewController:alert animated:YES completion:nil];
}
+1, in a swift project it is enough to just add the pod to the project, you do not even have to do number 5.
A work-around:
collection-view collection-view-cell > view{
width: 270px;
}
works on alert textfield but also affects on collection view cell.....
Yeah, skipped this workaround myself, since it conflicted with uiactivityviewcontroller, and rewrote the app to not contain any alerts with input fields. I guess Pixate Freestyle is kind of dead...
one more workaround
var list = alertController.view.subviews as! [UIView]
for _ in 0 ..< 7 {
list = list.flatMap { (view) in
return view.subviews as! [UIView]
}
}
for view in list {
if view is UICollectionView {
view.styleClass = "fix_text_field_in_alert_view"
}
}
where
.fix_text_field_in_alert_view collection-view-cell > view {
width: 270px;
}