(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| #!/bin/sh | |
| # build.sh | |
| # | |
| # Created by IRSHAD PC on 10/02/17. | |
| # Copyright © 2017 IRSHAD PC. All rights reserved. | |
| PROJDIR=${WORKSPACE}/___PROJECT NAME___ | |
| PROJECT_NAME=___XCODE PROJECT NAME___ | |
| TARGET_SDK="iphonesimulator4.0" |
| // CalculatorView.swift | |
| // as seen in http://nshipster.com/ibinspectable-ibdesignable/ | |
| // | |
| // (c) 2015 Nate Cook, licensed under the MIT license | |
| /// The alignment for drawing an String inside a bounding rectangle. | |
| enum NCStringAlignment { | |
| case LeftTop | |
| case CenterTop | |
| case RightTop |
| APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}" | |
| # This script loops through the frameworks embedded in the application and | |
| # removes unused architectures. | |
| find "$APP_PATH" -name '*.framework' -type d | while read -r FRAMEWORK | |
| do | |
| FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable) | |
| FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME" | |
| echo "Executable is $FRAMEWORK_EXECUTABLE_PATH" |
| // | |
| // Created by Ian Dundas on 16/03/15. | |
| // | |
| #import "UIImagePickerController+cats.h" | |
| #import <AVFoundation/AVFoundation.h> | |
| #import "Photos/Photos.h" | |
| /* | |
| example usage: |
| ########################################## | |
| # | |
| # c.f. http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4 | |
| # | |
| # Version 2.82 | |
| # | |
| # Latest Change: | |
| # - MORE tweaks to get the iOS 10+ and 9- working | |
| # - Support iOS 10+ | |
| # - Corrected typo for iOS 1-10+ (thanks @stuikomma) |
| MKMapRect zoomRect = MKMapRectNull; | |
| for (id <MKAnnotation> annotation in mapView.annotations) { | |
| MKMapPoint annotationPoint = MKMapPointForCoordinate(annotation.coordinate); | |
| MKMapRect pointRect = MKMapRectMake(annotationPoint.x, annotationPoint.y, 0, 0); | |
| if (MKMapRectIsNull(zoomRect)) { | |
| zoomRect = pointRect; | |
| } else { | |
| zoomRect = MKMapRectUnion(zoomRect, pointRect); | |
| } | |
| } |
| // The trick is to link the DeviceSupport folder from the beta to the stable version. | |
| ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/10.1\ \(14B54\)/ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport | |
| // Then restart Xcode and recommect your devices. You will need to do that for every beta of iOS 10.1+/Xcode 8. | |
| // sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :) |
| ######################### | |
| # .gitignore file for Xcode4 and Xcode5 Source projects | |
| # | |
| # Apple bugs, waiting for Apple to fix/respond: | |
| # | |
| # 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation? | |
| # | |
| # Version 2.6 | |
| # For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects | |
| # |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| + (NSArray*)allEntriesInContext:(NSManagedObjectContext*)context fromDate:(NSDate*)fromDate toDate:(NSDate*)toDate{ | |
| // Create the request | |
| NSFetchRequest *request = [[NSFetchRequest alloc]initWithEntityName:@"Entry"]; | |
| // Build the predicate | |
| NSPredicate *predicate = [NSPredicate predicateWithFormat: @"date >= %@ && date <= %@ ", fromDate, toDate]; | |
| request.predicate = predicate; | |
| // Define sorting | |
| NSSortDescriptor *sortDesc = [NSSortDescriptor sortDescriptorWithKey:@"date" ascending:YES]; | |
| request.sortDescriptors = @[sortDesc]; |