Script:
cd ${SRCROOT}
if [ -e "Pods" ]
then
pod install
else
touch Pods
// | |
// ViewController.m | |
// AVPlayerCaching | |
// | |
// Created by Anurag Mishra on 5/19/14. | |
// Sample code to demonstrate how to cache a remote audio file while streaming it with AVPlayer | |
// | |
#import "ViewController.h" | |
#import <AVFoundation/AVFoundation.h> |
/** | |
* ArcUtils.java | |
* | |
* Copyright (c) 2014 BioWink GmbH. | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is |
#ifndef NS_DESIGNATED_INITIALIZER | |
#if __has_attribute(objc_designated_initializer) | |
#define NS_DESIGNATED_INITIALIZER __attribute((objc_designated_initializer)) | |
#else | |
#define NS_DESIGNATED_INITIALIZER | |
#endif | |
#endif |
require 'sinatra' # gem install sinatra --no-rdoc --no-ri | |
set :port, 3000 | |
set :environment, :production | |
html = <<-EOT | |
<html><head><style> | |
#text{width:100%; font-size: 15px; padding: 5px; display: block;} | |
</style></head><body> | |
<input id="text" placeholder="Write then press Enter."/> | |
<div id="chat"></div> |
-(NSArray*)objectForKeyedSubscript:(NSString*)pattern | |
{ | |
NSError *error; | |
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:pattern options:0 error:&error]; | |
NSAssert( ! error, @"regex processing error"); | |
NSMutableArray *strings = [NSMutableArray new]; | |
NSArray *matches = [regex matchesInString:self options:0 range:self.fullRange]; | |
for(NSTextCheckingResult *match in matches) { | |
for (NSInteger i = 0; i < match.numberOfRanges; i++) { |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>People</key> | |
<array> | |
<string>😄</string> | |
<string>😃</string> | |
<string>😀</string> | |
<string>😊</string> |
@interface PSPDFThreadSafeMutableDictionary : NSMutableDictionary | |
@end | |
#import "PSPDFThreadSafeMutableDictionary.h" | |
#import <libkern/OSAtomic.h> | |
@implementation PSPDFThreadSafeMutableDictionary { | |
OSSpinLock _lock; | |
NSMutableDictionary *_dictionary; // Class Cluster! |
Storyboard Segues initially seem like a pretty cool way to construct interfaces using minimal glue code. But actually, ordinary nibs already support this, and in a much more flexible way.
Certainly, a Storyboard lets you bind a button action up to display a view controller with no code, but in practice you will usually want to pass some data to the new controller, depending on which button you used to get there, and this means implementing the -prepareForSegue:sender: method, which rapidly becomes a giant if/elseif statement of doom, negating most of the benefit of the codeless segue:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segue.identifier isEqualToString:@"modalSegue"])
{
ModalViewController *controller = (ModalViewController *)segue.destination;
controller.someProperty = someValue;