1

Вопрос по ios, objective-c – Как ускорить переходы и сегменты iOS?

Можно ли установить свойство для всего приложения, чтобы удвоить скорость переходов в приложении для iOS?

  • Error: User Rate Limit ExceededUIWindowError: User Rate Limit Exceededself.window.layer.speed = 2.0fError: User Rate Limit Exceeded

    от
  • 3

    Error: User Rate Limit Exceeded

    UIViewController+ShowModalFromView.h

    #import <Foundation/Foundation.h>
    #import <QuartzCore/QuartzCore.h>
    
    @interface UIViewController (ShowModalFromView)
    - (void)presentModalViewController:(UIViewController *)modalViewController fromView:(UIView *)view;
    @end
    

    UIViewController+ShowModalFromView.m

    #import "UIViewController+ShowModalFromView.h"
    
    @implementation UIViewController (ShowModalFromView)
    
    - (void)presentModalViewController:(UIViewController *)modalViewController fromView:(UIView *)view {
        modalViewController.modalPresentationStyle = UIModalPresentationFormSheet;
    
    // Add the modal viewController but don't animate it. We will handle the animation manually
    [self presentModalViewController:modalViewController animated:NO];
    
    // Remove the shadow. It causes weird artifacts while animating the view.
    CGColorRef originalShadowColor = modalViewController.view.superview.layer.shadowColor;
    modalViewController.view.superview.layer.shadowColor = [[UIColor clearColor] CGColor];
    
    // Save the original size of the viewController's view    
    CGRect originalFrame = modalViewController.view.superview.frame;
    
    // Set the frame to the one of the view we want to animate from
    modalViewController.view.superview.frame = view.frame;
    
    // Begin animation
    [UIView animateWithDuration:1.0f
                     animations:^{
                         // Set the original frame back
                         modalViewController.view.superview.frame = originalFrame;
                     }
                     completion:^(BOOL finished) {
                         // Set the original shadow color back after the animation has finished
                         modalViewController.view.superview.layer.shadowColor = originalShadowColor;
                     }];
    }
    
    @end
    

  • 7

    Error: User Rate Limit Exceeded