alias xcbuild=$(xcode-select -p)/../SharedFrameworks/XCBuild.framework/Versions/A/Support/xcbuild
# THIS DOESNT WORK YET: xcbuild openIDEConsole # … then switch to Xcode ➡️
xcbuild showSpecs
xcbuild build <foo.pif> [—target <target>]| #!/bin/bash | |
| # This is a simple script that sets up a public SSH key and copies it to the | |
| # clipboard, so you can paste it into your GitHub account here: | |
| # https://github.com/settings/keys | |
| # | |
| # It only handles the default public key name, id_rsa. Deal with it :D | |
| # Check for existing public key | |
| KEY=`find ~/.ssh -type f -name 'id_rsa.pub'` |
Following the tradition from last year, here's my complete list of all interesting features and updates I could find in Apple's OSes, SDKs and developer tools that were announced at this year's WWDC. This is based on the keynotes, the "What's New In ..." presentations and some others, Apple's release notes, and blog posts and tweets that I came across in the last few weeks.
If for some reason you haven't watched the talks yet, I really recommend watching at least the "State of the Union" and the "What's New In" intros for the platforms you're interested in. The unofficial WWDC Mac app is great way to download the videos and keep track of what you've already watched.
If you're interested, here are my WWDC 2015 notes (might be useful if you're planning to drop support for iOS 8 now and start using some iOS 9 APIs).
| // Taken from the commercial iOS PDF framework http://pspdfkit.com. | |
| // Copyright (c) 2014 Peter Steinberger, PSPDFKit GmbH. All rights reserved. | |
| // Licensed under MIT (http://opensource.org/licenses/MIT) | |
| // | |
| // You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it. | |
| #import <UIKit/UIKit.h> | |
| #import <objc/runtime.h> | |
| #import <objc/message.h> |
| import UIKit | |
| import XCPlayground | |
| XCPlaygroundPage.currentPage.needsIndefiniteExecution = true | |
| func perform(initial: Int) { | |
| var value: Int = initial | |
| dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1), dispatch_get_main_queue()) { [myConstant = value] in | |
| print("constant in first block \(myConstant)") | |
| print("captured \(value)") | |
| value = initial * 2 |
If your system is running slowly, perhaps a process is using too much CPU time and won't let other processes run smoothly. To find out which processes are taking up a lot of CPU time, you can use Apple's Activity Monitor.
The CPU pane shows how processes are affecting CPU (processor) activity:
| /*----------------------------------------------------*/ | |
| #pragma mark - XCTAsserts | |
| /*----------------------------------------------------*/ | |
| XCTAssert(expression, format...); | |
| XCTAssertTrue(expression, format...); | |
| XCTAssertFalse(expression, format...); | |
| XCTAssertEqual(expression1, expression2, format...); | |
| XCTAssertNotEqual(expression1, expression2, format...); | |
| XCTAssertNil(expression, format...); |
| extension UIImage { | |
| public func imageRotatedByDegrees(degrees: CGFloat) -> UIImage { | |
| let radiansToDegrees: (CGFloat) -> CGFloat = { | |
| return $0 * (180.0 / CGFloat(M_PI)) | |
| } | |
| let degreesToRadians: (CGFloat) -> CGFloat = { | |
| return $0 / (180.0 * CGFloat(M_PI)) | |
| } | |
| // calculate the size of the rotated view's containing box for our drawing space |
| // Taken from the commercial iOS PDF framework http://pspdfkit.com. | |
| // Copyright (c) 2014 Peter Steinberger, PSPDFKit GmbH. All rights reserved. | |
| // Licensed under MIT (http://opensource.org/licenses/MIT) | |
| // | |
| // You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it. | |
| // PLEASE DUPE rdar://27192338 (https://openradar.appspot.com/27192338) if you would like to see this in UIKit. | |
| #import <objc/runtime.h> | |
| #import <objc/message.h> |
