Почему в Haskell нет класса типов Cofunctor?

Я смог сделать это, создав пользовательский segue (на основе этой ссылки ).

  1. Создайте новый класс segue (см. ниже).
  2. Откройте свою раскадровку и выберите сего.
  3. Установите класс в PushNoAnimationSegue (или как вы его назвали).

Swift 4

import UIKit

/*
 Move to the next screen without an animation.
 */
class PushNoAnimationSegue: UIStoryboardSegue {

    override func perform() {
        self.source.navigationController?.pushViewController(self.destination, animated: false)
    }
}

Цель C

PushNoAnimationSegue.h

#import 

/*
 Move to the next screen without an animation.
 */
@interface PushNoAnimationSegue : UIStoryboardSegue

@end

PushNoAnimationSegue.m

#import "PushNoAnimationSegue.h"

@implementation PushNoAnimationSegue

- (void)perform {

    [self.sourceViewController.navigationController pushViewController:self.destinationViewController animated:NO];
}

@end

13
задан J. A. Corbal 12 January 2016 в 13:41
поделиться