This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import UIKit | |
private let InstagramAppURL = URL(string: "instagram://app")! | |
class InstagramActivity: UIActivity, UIDocumentInteractionControllerDelegate { | |
override class var activityCategory: UIActivityCategory { return .share } | |
override var activityType: UIActivityType? { return UIActivityType("postToInstagram") } | |
override var activityTitle: String? { return "Instagram" } | |
override var activityImage: UIImage? { return #imageLiteral(resourceName: "instagram_activity") } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Zips elements of two signals into pairs. The elements of any Nth pair | |
/// are the Nth elements of the two input signals. | |
public func zipWith<T, U, E>(otherSignal: Signal<U, E>)(signal: Signal<T, E>) -> Signal<(T, U), E> { | |
return Signal { observer in | |
let lock = NSRecursiveLock() | |
lock.name = "org.reactivecocoa.ReactiveCocoa.zipWith" | |
var signalValues: [T] = [] | |
var otherValues: [U] = [] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "DefaultParamsSerializer.h" | |
@implementation DefaultParamsSerializer | |
- (NSMutableURLRequest *)requestWithMethod:(NSString *)method URLString:(NSString *)URLString parameters:(id)parameters error:(NSError *__autoreleasing *)error | |
{ | |
if (parameters) { | |
if ([parameters isKindOfClass:[NSDictionary class]]) { | |
NSMutableDictionary *mParams = [parameters mutableCopy]; | |
mParams[@"key"] = @"value"; |