Pixate / pixate-freestyle-ios

Pixate Freestyle for iOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PixateFreestyle doesn't work well in iOS 9 beta

markddaa opened this issue · comments

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

}

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

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