WWDC 2006 2007 2008 2009 2010 2011 2012 2013 2014
Foundation offers a Thread class, internally based on pthread
, that can be used to create new threads and execute closures.
// Detaches a new thread and uses the specified selector as the thread entry point.
Thread.detachNewThreadSelector(selector: Selector>, toTarget: Any, with: Any)
// Subclass
class MyThread: Thread {
// path to documents directory to save our usdc file | |
NSString* usdcPath = [documentsDirectory stringByAppendingPathComponent:@"usdcExample.usdc"]; | |
NSURL *usdcUrl = [NSURL fileURLWithPath: usdcPath]; | |
// path to documents directory to save our final usdz file | |
NSString* usdzPath = [documentsDirectory stringByAppendingPathComponent:@"usdzExample.usdz"]; | |
NSURL *usdzUrl = [NSURL fileURLWithPath:usdzPath]; | |
// load the .obj file at filePath as an MDLAsset | |
NSURL *url = [NSURL fileURLWithPath:filePath]; |
#!/bin/sh | |
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal | |
# make sure the output directory exists | |
mkdir -p "${UNIVERSAL_OUTPUTFOLDER}" | |
# Step 1. Build Device and Simulator versions | |
xcodebuild -target "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build | |
xcodebuild -target "${PROJECT_NAME}" -configuration ${CONFIGURATION} -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build |
(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.
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
#pragma mark - Class Methods | |
+ (BOOL)requiresConstraintBasedLayout { | |
return YES; | |
} | |
#pragma mark - Init | |
- (id)initWithFrame:(CGRect)frame { |
There was [a tweet][tweetSoto] a couple of days ago that resulted in a discussion/question about what it wrong with the usage of removedOnCompletion = NO
in the [SparkRecordingCircle code][code] for that [Subjective-C post][post].
We all kept saying that the explanation doesn't fit in a tweet, so here is my rough explanation about the issues.
But, let me first say that I think that the Subjective-C articles are reallt cool and useful to learn from. This is trying to reason about the general usage of removedOnCompletion = NO
, using that code as an example, since that was what was discussed on twitter.
The root problem, as [Nacho Soto pointed out][rootProblem], is that removedOnCompletion = NO
in combination with fillMode = kCAFillModeForwards
is almost always used when you are not updating the model layer. This means that after the animation has finished, what you see on screen is not reflected in the property of the layer. The biggest issue that this can cause is that all the