Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PixateFreestyle doesn't work well in iOS 9 beta #178

Open
markddaa opened this issue Jul 2, 2015 · 6 comments
Open

PixateFreestyle doesn't work well in iOS 9 beta #178

markddaa opened this issue Jul 2, 2015 · 6 comments

Comments

@markddaa
Copy link

markddaa commented Jul 2, 2015

what I did:

  1. I use Xcode 7 beta, simulator iOS 9 beta, and Object-C
  2. create a demo project with one button and a UIAlertViewController with textfield
  3. add "pod 'PixateFreestyle'" in the podfile
  4. run pod install
  5. import <PixateFreestyle/PixateFreestyle.h> and add [PixateFreestyle initializePixateFreestyle]; in main.m
  6. run the app

what I got:

qq20150702-1

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];

}

@tobiasgr
Copy link

+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.

@tobiasgr
Copy link

A work-around:

collection-view collection-view-cell > view{
width: 270px;
}

@markddaa
Copy link
Author

works on alert textfield but also affects on collection view cell.....

@tobiasgr
Copy link

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...

@Pitsko
Copy link

Pitsko commented Sep 24, 2015

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;
}

@markddaa
Copy link
Author

@Pitsko that works! thx so much for the provided workaround.
Hopefully Pixate will update their product to support iOS 9 soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants