This PR contains all the work related to setting up this project as required to implement the [Assignment](https://repo.rock-n-code.com/rock-n-code/deep-linking-assignment/wiki/Assignment) on top, as intended. To summarise this work: - [x] created a new **Xcode** project; - [x] cloned the `Wikipedia` app and inserted it into the **Xcode** project; - [x] created the `Locations` app and also, its `Libraries` package; - [x] created the `Shared` package to share dependencies between the apps; - [x] added a `Makefile` file and implemented some **environment** and **help** commands. Co-authored-by: Javier Cicchelli <javier@rock-n-code.com> Reviewed-on: rock-n-code/deep-linking-assignment#1
57 lines
2.3 KiB
Objective-C
57 lines
2.3 KiB
Objective-C
//
|
|
// MTLValueTransformer.h
|
|
// Mantle
|
|
//
|
|
// Created by Justin Spahr-Summers on 2012-09-11.
|
|
// Copyright (c) 2012 GitHub. All rights reserved.
|
|
//
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
#if __has_include(<Mantle/MTLTransformerErrorHandling.h>)
|
|
#import <Mantle/MTLTransformerErrorHandling.h>
|
|
#else
|
|
#import "MTLTransformerErrorHandling.h"
|
|
#endif
|
|
|
|
/// A block that represents a transformation.
|
|
///
|
|
/// value - The value to transform.
|
|
/// success - The block must set this parameter to indicate whether the
|
|
/// transformation was successful.
|
|
/// MTLValueTransformer will always call this block with *success
|
|
/// initialized to YES.
|
|
/// error - If not NULL, this may be set to an error that occurs during
|
|
/// transforming the value.
|
|
///
|
|
/// Returns the result of the transformation, which may be nil.
|
|
typedef id (^MTLValueTransformerBlock)(id value, BOOL *success, NSError **error);
|
|
|
|
///
|
|
/// A value transformer supporting block-based transformation.
|
|
///
|
|
@interface MTLValueTransformer : NSValueTransformer <MTLTransformerErrorHandling>
|
|
|
|
/// Returns a transformer which transforms values using the given block. Reverse
|
|
/// transformations will not be allowed.
|
|
+ (instancetype)transformerUsingForwardBlock:(MTLValueTransformerBlock)transformation;
|
|
|
|
/// Returns a transformer which transforms values using the given block, for
|
|
/// forward or reverse transformations.
|
|
+ (instancetype)transformerUsingReversibleBlock:(MTLValueTransformerBlock)transformation;
|
|
|
|
/// Returns a transformer which transforms values using the given blocks.
|
|
+ (instancetype)transformerUsingForwardBlock:(MTLValueTransformerBlock)forwardTransformation reverseBlock:(MTLValueTransformerBlock)reverseTransformation;
|
|
|
|
@end
|
|
|
|
@interface MTLValueTransformer (Deprecated)
|
|
|
|
+ (NSValueTransformer *)transformerWithBlock:(id (^)(id))transformationBlock __attribute__((deprecated("Replaced by +transformerUsingForwardBlock:")));
|
|
|
|
+ (NSValueTransformer *)reversibleTransformerWithBlock:(id (^)(id))transformationBlock __attribute__((deprecated("Replaced by +transformerUsingReversibleBlock:")));
|
|
|
|
+ (NSValueTransformer *)reversibleTransformerWithForwardBlock:(id (^)(id))forwardBlock reverseBlock:(id (^)(id))reverseBlock __attribute__((deprecated("Replaced by +transformerUsingForwardBlock:reverseBlock:")));
|
|
|
|
@end
|