How to Add AFIncrementalStore to an Existing Project
Add dependencies without Cocoapods
- Add Core Data
- Add Mobile Core Services
- Add System Configuration
- Add AFIncrementalStore
- Add AFNetworking
- Add InflectorKit
// DataManager.h | |
#import <Foundation/Foundation.h> | |
#import <CoreData/CoreData.h> | |
extern NSString * const DataManagerDidSaveNotification; | |
extern NSString * const DataManagerDidSaveFailedNotification; | |
@interface DataManager : NSObject { | |
} |
How to Add AFIncrementalStore to an Existing Project
Add dependencies without Cocoapods
// | |
// SKScene+DeterminingTouches.h | |
// Space Platypus | |
// | |
// Created by Andrew Paterson on 11/25/13. | |
// Copyright (c) 2013 Andrew Paterson. All rights reserved. | |
// | |
#import <SpriteKit/SpriteKit.h> |
// DataManager.h | |
#import <Foundation/Foundation.h> | |
#import <CoreData/CoreData.h> | |
extern NSString * const DataManagerDidSaveNotification; | |
extern NSString * const DataManagerDidSaveFailedNotification; | |
@interface DataManager : NSObject { | |
} |
struct InputStreamGenerator : Generator { | |
var inputStream : NSInputStream | |
var chunkSize : Int | |
init(inputStream : NSInputStream, chunkSize : Int) { | |
self.inputStream = inputStream | |
self.chunkSize = chunkSize | |
} | |
void DrawInsetBeveledRoundedRect( CGContextRef context, CGRect rect, CGFloat radius, UIColor *fillColor ) | |
{ | |
//contract the bounds of the rectangle in to account for the stroke | |
CGRect drawRect = CGRectInset(rect, 1.0f, 1.0f); | |
//contract the height by 1 to account for the white bevel at the bottom | |
drawRect.size.height -= 1.0f; | |
//Save the current state so we don't persist anything beyond this operation | |
CGContextSaveGState(context); |
import Foundation | |
typealias ObserverRemover = () -> Void | |
/*! An observable value | |
An `Observable` wraps any value. If you add an observer handler, then every time the value is set, your handler will be | |
called with the new value. Adding an observer returns a closure that is used to remove the observer. Note that the handler | |
is called every time the value is set, even if this does not change the value. If you only want the handler to be called | |
when the value changes, see `CoalescingObservable`. |
// | |
// NetworkIndicatorManager.swift | |
// Indicator | |
// | |
// Created by Curt Clifton on 5/17/16. | |
// Copyright © 2016 curtclifton.net. All rights reserved. | |
// | |
import Foundation | |
import UIKit |
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request | |
navigationType:(UIWebViewNavigationType)navigationType { | |
NSString *urlString = [[request URL] absoluteString]; | |
if ([urlString hasPrefix:@"js:"]) { | |
NSString *jsonString = [[[urlString componentsSeparatedByString:@"js:"] lastObject] | |
stringByReplacingPercentEscapes]; | |
NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding]; | |
NSError *error; |