From ef167d2ad52ee181c5badad68186859bb09b9f95 Mon Sep 17 00:00:00 2001 From: Nate Cook Date: Fri, 11 Dec 2015 00:50:12 -0600 Subject: [PATCH] Switch to use asset url from configuration file. --- 2012-09-03-nslocale.md | 4 +-- 2012-09-10-uiaccessibility.md | 2 +- 2012-10-01-pragma.md | 2 +- 2012-10-29-uilocalizedindexedcollation.md | 2 +- 2012-11-26-nsorderedset.md | 4 +-- 2013-03-04-backrow.md | 6 ++--- 2013-04-22-nshipster-quiz-1.md | 20 +++++++------- 2013-05-06-gpuimage.md | 2 +- 2013-06-12-nshipster-quiz-2.md | 20 +++++++------- 2013-06-24-uuid-udid-unique-identifier.md | 2 +- 2013-07-31-nshipster-quiz-3.md | 20 +++++++------- 2013-09-02-xcode-snippets.md | 14 +++++----- 2013-09-09-network-link-conditioner.md | 12 ++++----- 2013-09-30-xcode-key-bindings-and-gestures.md | 22 ++++++++-------- ...nch-arguments-and-environment-variables.md | 6 ++--- 2013-10-28-nshipster-quiz-4.md | 20 +++++++------- 2013-11-04-xctool.md | 2 +- 2014-03-10-dictionary-services.md | 8 +++--- 2014-03-24-nsurl.md | 2 +- 2014-03-31-avspeechsynthesizer.md | 2 +- 2014-04-07-configuration-profiles.md | 2 +- 2014-04-14-xcode-plugins.md | 26 +++++++++---------- 2014-04-21-uiactivityviewcontroller.md | 6 ++--- 2014-04-28-mkgeodesicpolyline.md | 8 +++--- 2014-05-12-nshipster-quiz-5.md | 2 +- 2014-05-26-cocoapods.md | 4 +-- 2014-07-21-xctestcase.md | 2 +- 2014-08-11-swift-operators.md | 6 ++--- 2014-09-30-uialertcontroller.md | 12 ++++----- 2014-10-06-swift-system-version-checking.md | 10 ++++--- 2014-10-17-inter-process-communication.md | 2 +- 2014-10-28-cmdevicemotion.md | 10 +++---- 2014-11-03-uisplitviewcontroller.md | 26 +++++++++---------- 2014-11-10-core-location-in-ios-8.md | 10 +++---- 2014-11-17-uiprintinteractioncontroller.md | 18 ++++++------- 2014-12-08-apple-pay.md | 6 ++--- 2015-02-02-ibinspectable-ibdesignable.md | 8 +++--- 2015-03-02-nsscanner.md | 2 +- 2015-03-30-quick-look-debugging.md | 6 ++--- 2015-04-13-unmanaged.md | 2 +- 2015-05-05-swift-documentation.md | 10 +++---- 2015-05-11-xcplayground.md | 10 +++---- 2015-06-01-mirrortype.md | 4 +-- 2015-06-09-nshipster-quiz-7.md | 20 +++++++------- 2015-06-29-cloudkit.md | 2 +- 2015-07-27-uikeycommand.md | 2 +- 46 files changed, 195 insertions(+), 193 deletions(-) diff --git a/2012-09-03-nslocale.md b/2012-09-03-nslocale.md index c2649d5d..50bf828b 100644 --- a/2012-09-03-nslocale.md +++ b/2012-09-03-nslocale.md @@ -44,7 +44,7 @@ Locale identifiers can encode more explicit preferences about currency, calendar Users can change their locale settings in the "Language & Text" (or "International" on older versions of OS X) System Preferences on the Mac, or "General > International" in iOS Settings. -![Language & Text System Preferences](http://nshipster.s3.amazonaws.com/nslocale-international-system-preferences.png) +![Language & Text System Preferences]({{ site.asseturl }}/nslocale-international-system-preferences.png) ## Formatting Dates & Numbers @@ -112,7 +112,7 @@ NSLog(@"en_US: %@", [frLocale displayNameForKey:NSLocaleIdentifier value:@"en_US You should use this method any time you need to display information about the user's current locale, or any alternative locales available to them, like in this screen from the Settings app: -![Languages Settings](http://nshipster.s3.amazonaws.com/nslocale-languages-settings.png) +![Languages Settings]({{ site.asseturl }}/nslocale-languages-settings.png) ## `+preferredLanguages` diff --git a/2012-09-10-uiaccessibility.md b/2012-09-10-uiaccessibility.md index 774bfe5d..79393d56 100644 --- a/2012-09-10-uiaccessibility.md +++ b/2012-09-10-uiaccessibility.md @@ -43,7 +43,7 @@ Tap VoiceOver, and then tap the VoiceOver switch to turn it on. An alert will po Don't Panic--unlike setting your device to another language, there's no real risk of not being able to figure out how to turn VoiceOver off. -![VoiceOver Settings](http://nshipster.s3.amazonaws.com/uiaccessibility-voiceover.png) +![VoiceOver Settings]({{ site.asseturl }}/uiaccessibility-voiceover.png) Using the device in VoiceOver mode is a bit different than you're used to: diff --git a/2012-10-01-pragma.md b/2012-10-01-pragma.md index 316653ef..258d11b1 100644 --- a/2012-10-01-pragma.md +++ b/2012-10-01-pragma.md @@ -54,7 +54,7 @@ Good habits start with `#pragma mark`. Like so: Use `#pragma mark` in your `@implementation` to divide code into logical sections. Not only do these sections make it easier to read through the code itself, but it also adds visual cues to the Xcode source navigator (`#pragma mark` declarations starting with a dash (`-`) are preceded with a horizontal divider). -![Xcode Sections](http://nshipster.s3.amazonaws.com/pragma-xcode-sections.png) +![Xcode Sections]({{ site.asseturl }}/pragma-xcode-sections.png) If your class conforms to any `@protocols`, start by grouping all of the methods within each protocol together, and adding a `#pragma mark` header with the name of that protocol. Another good convention is to group subclassed methods according to their respective superclass. For example, an `NSInputStream` subclass should have a group marked `NSInputStream`, followed by a group marked `NSStream`. Things like `IBAction` outlets, or methods corresponding to target / action, notification, or KVO selectors probably deserve their own sections as well. diff --git a/2012-10-29-uilocalizedindexedcollation.md b/2012-10-29-uilocalizedindexedcollation.md index f346a2d3..e0274042 100644 --- a/2012-10-29-uilocalizedindexedcollation.md +++ b/2012-10-29-uilocalizedindexedcollation.md @@ -19,7 +19,7 @@ You could also add a `UISearchBar` to the top of your table view, allowing the u There is also a third approach, which is generally under-utilized in iOS applications: **section index titles**. These are the vertically flowing letters found along the right side of table views in your Address Book contacts list or Music library: -![Section Index Titles Example](http://nshipster.s3.amazonaws.com/uilocalizedindexedcollation-example.png) +![Section Index Titles Example]({{ site.asseturl }}/uilocalizedindexedcollation-example.png) As the user scrolls their finger down the list, the table view jumps to the corresponding section. Even the most tiresome table view is rendered significantly more usable as a result. diff --git a/2012-11-26-nsorderedset.md b/2012-11-26-nsorderedset.md index 15330f0c..3623c6ad 100644 --- a/2012-11-26-nsorderedset.md +++ b/2012-11-26-nsorderedset.md @@ -65,7 +65,7 @@ NSMutableOrderedSet* mutable = [immutable mutableCopy]; [mutable isKindOfClass:[NSMutableSet class]]; // NO (!) ~~~ - + That's no good... since `NSMutableOrderedSet` couldn't be used as a method parameter of type `NSMutableSet`. So what happens if we make `NSMutableOrderedSet` a subclass of `NSMutableSet` as well? @@ -93,7 +93,7 @@ NSMutableOrderedSet* mutable = [immutable mutableCopy]; [mutable isKindOfClass:[NSOrderedSet class]]; // NO (!) ~~~ - + This is perhaps even worse, as now `NSMutableOrderedSet` couldn't be used as a method parameter expecting an `NSOrderedSet`. diff --git a/2013-03-04-backrow.md b/2013-03-04-backrow.md index 7ec06720..39d7de1d 100644 --- a/2013-03-04-backrow.md +++ b/2013-03-04-backrow.md @@ -72,7 +72,7 @@ Here's a brief list of some Back Row classes & protocols and their UIKit equival ## Apple TV Appliance Structure -![Apple TV Home Screen](http://nshipster.s3.amazonaws.com/backrow-home-screen.jpg) +![Apple TV Home Screen]({{ site.asseturl }}/backrow-home-screen.jpg) In the current Apple TV interface, the home screen contains a grid of rectangular icons, similar to the home screen on iOS. Each icon corresponds to an _appliance_. @@ -84,7 +84,7 @@ An appliance also has an optional `topShelfController`, which is what displays a Pushing and popping controllers is managed by a shared `BRControllerStack`. When a controller is selected with in a list, it is pushed onto the stack. When the user presses the Menu button, the stack is popped. -![Apple TV YouTube](http://nshipster.s3.amazonaws.com/backrow-youtube.jpg) +![Apple TV YouTube]({{ site.asseturl }}/backrow-youtube.jpg) A typical controller consists of a menu list on the right, with some kind of complimentary view on the left. @@ -92,7 +92,7 @@ On top-level controllers, this sometimes takes the form of a `BRMarqueeStack`, w For controllers listing media that can be played, the complimentary view usually shows a preview image, along with meta data in a `BRMetadataControl`, such as runtime, date created, and other relevant information. -![Apple TV Movie](http://nshipster.s3.amazonaws.com/backrow-movie.jpg) +![Apple TV Movie]({{ site.asseturl }}/backrow-movie.jpg) iTunes store controllers also use a horizontally-stacked layout, with media information at the top, with related titles listed below. diff --git a/2013-04-22-nshipster-quiz-1.md b/2013-04-22-nshipster-quiz-1.md index d24879a5..a97825b0 100644 --- a/2013-04-22-nshipster-quiz-1.md +++ b/2013-04-22-nshipster-quiz-1.md @@ -60,43 +60,43 @@ Round 3: Picture Round - 1. What is this? -![Question 1](http://nshipster-quiz-1.s3.amazonaws.com/question-1.jpg) +![Question 1]({{ site.asseturl }}/quiz-1/question-1.jpg) - 2. What is this? -![Question 2](http://nshipster-quiz-1.s3.amazonaws.com/question-2.jpg) +![Question 2]({{ site.asseturl }}/quiz-1/question-2.jpg) - 3. What is this? -![Question 3](http://nshipster-quiz-1.s3.amazonaws.com/question-3.jpg) +![Question 3]({{ site.asseturl }}/quiz-1/question-3.jpg) - 4. What is this? -![Question 4](http://nshipster-quiz-1.s3.amazonaws.com/question-4.jpg) +![Question 4]({{ site.asseturl }}/quiz-1/question-4.jpg) - 5. WTF is this? -![Question 5](http://nshipster-quiz-1.s3.amazonaws.com/question-5.jpg) +![Question 5]({{ site.asseturl }}/quiz-1/question-5.jpg) - 6. Who is this? -![Question 6](http://nshipster-quiz-1.s3.amazonaws.com/question-6.jpg) +![Question 6]({{ site.asseturl }}/quiz-1/question-6.jpg) - 7. Who is this? -![Question 7](http://nshipster-quiz-1.s3.amazonaws.com/question-7.jpg) +![Question 7]({{ site.asseturl }}/quiz-1/question-7.jpg) - 8. Who is this? -![Question 8](http://nshipster-quiz-1.s3.amazonaws.com/question-8.jpg) +![Question 8]({{ site.asseturl }}/quiz-1/question-8.jpg) - 9. Who is this? -![Question 9](http://nshipster-quiz-1.s3.amazonaws.com/question-9.jpg) +![Question 9]({{ site.asseturl }}/quiz-1/question-9.jpg) - 10. In this photo, Bill Gates & Steve Jobs are being interviewed at the D5 conference in 2007 by a man and a woman just off-screen to the left. Who are they? (One point for each person) -![Question 10](http://nshipster-quiz-1.s3.amazonaws.com/question-10.jpg) +![Question 10]({{ site.asseturl }}/quiz-1/question-10.jpg) Round 4: Name That Framework! diff --git a/2013-05-06-gpuimage.md b/2013-05-06-gpuimage.md index a915fbe2..f0f88917 100644 --- a/2013-05-06-gpuimage.md +++ b/2013-05-06-gpuimage.md @@ -227,7 +227,7 @@ Seriously, the [Filter Showcase Example App](https://github.com/BradLarson/GPUIm ## Rendering Pipeline - + GPUImage is, at its core, an Objective-C abstraction around a rendering pipeline. Source images from the camera, network, or disk are loaded and manipulated according to a chain of filters, and finally outputted either a view, graphics context, or data stream. diff --git a/2013-06-12-nshipster-quiz-2.md b/2013-06-12-nshipster-quiz-2.md index 1b042171..ea986289 100644 --- a/2013-06-12-nshipster-quiz-2.md +++ b/2013-06-12-nshipster-quiz-2.md @@ -62,43 +62,43 @@ Round 3: Picture Round - 1. Which WWDC keynote was this from? -![Question 1](http://nshipster-quiz-2.s3.amazonaws.com/question-1.jpg) +![Question 1]({{ site.asseturl }}/quiz-2/question-1.jpg) - 2. Which WWDC keynote was this from? -![Question 2](http://nshipster-quiz-2.s3.amazonaws.com/question-2.jpg) +![Question 2]({{ site.asseturl }}/quiz-2/question-2.jpg) - 3. Which WWDC keynote was this from? -![Question 3](http://nshipster-quiz-2.s3.amazonaws.com/question-3.jpg) +![Question 3]({{ site.asseturl }}/quiz-2/question-3.jpg) - 4. Which WWDC keynote was this from? -![Question 4](http://nshipster-quiz-2.s3.amazonaws.com/question-4.jpg) +![Question 4]({{ site.asseturl }}/quiz-2/question-4.jpg) - 5. WTF is this? -![Question 5](http://nshipster-quiz-2.s3.amazonaws.com/question-5.jpg) +![Question 5]({{ site.asseturl }}/quiz-2/question-5.jpg) - 6. What is this? -![Question 6](http://nshipster-quiz-2.s3.amazonaws.com/question-6.jpg) +![Question 6]({{ site.asseturl }}/quiz-2/question-6.jpg) - 7. What is this? -![Question 7](http://nshipster-quiz-2.s3.amazonaws.com/question-7.jpg) +![Question 7]({{ site.asseturl }}/quiz-2/question-7.jpg) - 8. What is this? (and which generation?) -![Question 8](http://nshipster-quiz-2.s3.amazonaws.com/question-8.jpg) +![Question 8]({{ site.asseturl }}/quiz-2/question-8.jpg) - 9. Which "Core" framework is represented by this logo? -![Question 9](http://nshipster-quiz-2.s3.amazonaws.com/question-9.jpg) +![Question 9]({{ site.asseturl }}/quiz-2/question-9.jpg) - 10. Everybody loves Craig _/fɛdɹ̩igi/_ (Pictured). How do you spell his last name? -![Question 10](http://nshipster-quiz-2.s3.amazonaws.com/question-10.jpg) +![Question 10]({{ site.asseturl }}/quiz-2/question-10.jpg) Round 4: Name That Framework! ----------------------------- diff --git a/2013-06-24-uuid-udid-unique-identifier.md b/2013-06-24-uuid-udid-unique-identifier.md index b2010689..4d7fe060 100644 --- a/2013-06-24-uuid-udid-unique-identifier.md +++ b/2013-06-24-uuid-udid-unique-identifier.md @@ -45,7 +45,7 @@ As the sole component of the [Ad Support framework](http://developer.apple.com/l Users can opt out of ad targeting in a Settings screen added in iOS 6.1, found at **Settings > General > About > Advertising**: -![Limit Ad Tracking](http://nshipster.s3.amazonaws.com/ad-support-limit-ad-tracking.png) +![Limit Ad Tracking]({{ site.asseturl }}/ad-support-limit-ad-tracking.png) ## NSUUID & CFUUIDRef diff --git a/2013-07-31-nshipster-quiz-3.md b/2013-07-31-nshipster-quiz-3.md index 9e635983..149ca87b 100644 --- a/2013-07-31-nshipster-quiz-3.md +++ b/2013-07-31-nshipster-quiz-3.md @@ -62,43 +62,43 @@ With over 1 Million iOS & Mac Apps on the App Store, it's clear that the true se - 1. What is the name of this iOS game? -![Question 1](http://nshipster-quiz-3.s3.amazonaws.com/question-1.png) +![Question 1]({{ site.asseturl }}/quiz-3/question-1.png) - 2. What is the name of this iOS game? -![Question 2](http://nshipster-quiz-3.s3.amazonaws.com/question-2.png) +![Question 2]({{ site.asseturl }}/quiz-3/question-2.png) - 3. What is the name of this iOS app? -![Question 3](http://nshipster-quiz-3.s3.amazonaws.com/question-3.png) +![Question 3]({{ site.asseturl }}/quiz-3/question-3.png) - 4. What is the name of this popular iOS app? -![Question 4](http://nshipster-quiz-3.s3.amazonaws.com/question-4.png) +![Question 4]({{ site.asseturl }}/quiz-3/question-4.png) - 5. While not on the App Store, jailbreakers will know this icon well. What's its name? -![Question 5](http://nshipster-quiz-3.s3.amazonaws.com/question-5.png) +![Question 5]({{ site.asseturl }}/quiz-3/question-5.png) - 6. Which classic Mac app sports this delightful moving truck? -![Question 6](http://nshipster-quiz-3.s3.amazonaws.com/question-6.png) +![Question 6]({{ site.asseturl }}/quiz-3/question-6.png) - 7. Which indispensible development tool has this incongruous icon? -![Question 7](http://nshipster-quiz-3.s3.amazonaws.com/question-7.png) +![Question 7]({{ site.asseturl }}/quiz-3/question-7.png) - 8. Which app sports this sleek icon? -![Question 8](http://nshipster-quiz-3.s3.amazonaws.com/question-8.png) +![Question 8]({{ site.asseturl }}/quiz-3/question-8.png) - 9. Which app is represented by this delightful mail bag? -![Question 9](http://nshipster-quiz-3.s3.amazonaws.com/question-9.png) +![Question 9]({{ site.asseturl }}/quiz-3/question-9.png) - 10. Which (unfortunately stalled) app has this beautiful icon? -![Question 10](http://nshipster-quiz-3.s3.amazonaws.com/question-10.png) +![Question 10]({{ site.asseturl }}/quiz-3/question-10.png) Round 4: [REDACTED] diff --git a/2013-09-02-xcode-snippets.md b/2013-09-02-xcode-snippets.md index 6c63c6aa..345be52f 100644 --- a/2013-09-02-xcode-snippets.md +++ b/2013-09-02-xcode-snippets.md @@ -21,21 +21,21 @@ From `@interface` declarations to `if (!self) return nil;` incantations, there i To see the available code snippets, show the Utilities panel, to the right of your editor. On the bottom half the Utilities panel, there will be a horizontal divider with 4 icons. -![Utilities Divider](http://nshipster.s3.amazonaws.com/xcode-snippet-utilities-divider.png) +![Utilities Divider]({{ site.asseturl }}/xcode-snippet-utilities-divider.png) Click the `{ }` icon to show the Code Snippets Library. -![Utilities Panel](http://nshipster.s3.amazonaws.com/xcode-snippet-utilties-panel.png) +![Utilities Panel]({{ site.asseturl }}/xcode-snippet-utilties-panel.png) There are two ways to insert a snippet into your code: You can drag and drop from the code snippets library into your editor: -![Drag-and-Drop](http://nshipster.s3.amazonaws.com/xcode-snippet-drag-and-drop.gif) +![Drag-and-Drop]({{ site.asseturl }}/xcode-snippet-drag-and-drop.gif) ...or for snippets that include a text completion shortcut, you can start typing that: -![Text Completion Shortcut](http://nshipster.s3.amazonaws.com/xcode-snippet-text-completion-shortcut.gif) +![Text Completion Shortcut]({{ site.asseturl }}/xcode-snippet-text-completion-shortcut.gif) To get a sense of what you can do with snippets, here's an overview of the ones built-in to Xcode: @@ -57,11 +57,11 @@ Of course, what really makes snippets such a powerful feature is the ability to The process of creating a snippet is actually pretty unintuitive and difficult to explain. It uses an obscure OS X system feature that allows users to create a "Text Clipping" by dragging and dropping selected text. Much easier to just show it in action: -![Text Completion Shortcut](http://nshipster.s3.amazonaws.com/xcode-snippet-create.gif) +![Text Completion Shortcut]({{ site.asseturl }}/xcode-snippet-create.gif) After being added to the code snippet library, a user-defined snippet can be edited by double-clicking its listing: -![Text Completion Shortcut](http://nshipster.s3.amazonaws.com/xcode-snippet-editor.png) +![Text Completion Shortcut]({{ site.asseturl }}/xcode-snippet-editor.png) Each snippet has the following fields: @@ -87,7 +87,7 @@ Each snippet has the following fields: Something you may have noticed in using other Xcode snippets are placeholder tokens: -![Placeholder Token](http://nshipster.s3.amazonaws.com/xcode-snippet-token.png) +![Placeholder Token]({{ site.asseturl }}/xcode-snippet-token.png) In Xcode, placeholder tokens are delimited by `<#` and `#>`, with the placeholder text in the middle. Go ahead—try typing that into Xcode, and watch as the text between the octothorp tags magically transforms right in front of your eyes. diff --git a/2013-09-09-network-link-conditioner.md b/2013-09-09-network-link-conditioner.md index 81a9812e..a0e01410 100644 --- a/2013-09-09-network-link-conditioner.md +++ b/2013-09-09-network-link-conditioner.md @@ -20,19 +20,19 @@ This week on NSHipster, we'll be talking about the [Network Link Conditioner](ht Network Link Conditioner can be found in the "Hardware IO Tools for Xcode" package. This can be downloaded from the [Apple Developer Downloads](https://developer.apple.com/downloads/index.action?q=Hardware%20IO%20Tools) page. -![Download](http://nshipster.s3.amazonaws.com/network-link-conditioner-download.png) +![Download]({{ site.asseturl }}/network-link-conditioner-download.png) Search for "Hardware IO Tools for Xcode", and select the appropriate release of the package. -![Package](http://nshipster.s3.amazonaws.com/network-link-conditioner-dmg.png) +![Package]({{ site.asseturl }}/network-link-conditioner-dmg.png) Once the download has finished, open the DMG and double-click "Network Link Condition.prefPane" to install. -![System Preferences](http://nshipster.s3.amazonaws.com/network-link-conditioner-install.png) +![System Preferences]({{ site.asseturl }}/network-link-conditioner-install.png) From now on, you can enable the Network Link Conditioner from its preference pane at the bottom of System Preferences. -![Network Link Conditioner](http://nshipster.s3.amazonaws.com/network-link-conditioner-system-preference.png) +![Network Link Conditioner]({{ site.asseturl }}/network-link-conditioner-system-preference.png) When enabled, the Network Link Conditioner can change the network environment of the iPhone Simulator according to one of the built-in presets: @@ -46,7 +46,7 @@ When enabled, the Network Link Conditioner can change the network environment of Each preset can set a limit for uplink or downlink [bandwidth](http://en.wikipedia.org/wiki/Bandwidth_%28computing%29), [latency](http://en.wikipedia.org/wiki/Latency_%28engineering%29%23Communication_latency), and rate of [packet loss](http://en.wikipedia.org/wiki/Packet_loss) (when any value is set to 0, that value is unchanged from your computer's network environment). -![Preset](http://nshipster.s3.amazonaws.com/network-link-conditioner-preset.png) +![Preset]({{ site.asseturl }}/network-link-conditioner-preset.png) You can also create your own preset, if you wish to simulate a particular combination of factors simultaneously. @@ -65,6 +65,6 @@ To enable it, you need to set up your device for development: 3. Select your device in the sidebar 4. Click "Use for Development" -![iOS Devices](http://nshipster.s3.amazonaws.com/network-link-conditioner-ios.png) +![iOS Devices]({{ site.asseturl }}/network-link-conditioner-ios.png) Now you'll have access to the Developer section of the Settings app, where you'll find the Network Link Conditioner (just don't forget to turn it off after you're done testing!). diff --git a/2013-09-30-xcode-key-bindings-and-gestures.md b/2013-09-30-xcode-key-bindings-and-gestures.md index e37aa6f6..49ea63fc 100644 --- a/2013-09-30-xcode-key-bindings-and-gestures.md +++ b/2013-09-30-xcode-key-bindings-and-gestures.md @@ -43,7 +43,7 @@ Xcode key bindings and gestures not only shave off seconds of precious work, but ## Open Quickly (`⇧⌘O`) -![Open Quickly](http://nshipster.s3.amazonaws.com/xcode-shortcuts-quick-open.png) +![Open Quickly]({{ site.asseturl }}/xcode-shortcuts-quick-open.png) Learn to rely less on the Project Navigator by learning to love Open Quickly. There's a lot to love, too—with support for partial case- and position-insensitive matches, Xcode does a great job of finding what you want with just a minimal amount of input on your part. @@ -51,7 +51,7 @@ Learn to rely less on the Project Navigator by learning to love Open Quickly. Th ## Quick Documentation (`⌥ʘ` on Symbol / Three-Finger Tap)
Open Documentation (`⌥ʘʘ` on Symbol) -![Quick Documentation](http://nshipster.s3.amazonaws.com/xcode-shortcuts-quick-documentation.gif) +![Quick Documentation]({{ site.asseturl }}/xcode-shortcuts-quick-documentation.gif) Quick Documentation is probably the first Xcode shortcut developers should learn. Just alt-click (or three-finger tap) any class, variable, or constant value, and Xcode will give you a quick rundown of what you're looking at. Alt-double-click to bring up the documentation window, opened to the relevant entry. @@ -61,7 +61,7 @@ Also well-know to an expert Xcoder's workflow is Jump to Definition, which opens ## Jump to Next Counterpart (`^⌘↑` / `^⌘↓` / Three-Finger Vertical Swipe) -![Jump to Next Counterpart](http://nshipster.s3.amazonaws.com/xcode-shortcuts-counterpart.gif) +![Jump to Next Counterpart]({{ site.asseturl }}/xcode-shortcuts-counterpart.gif) Last, but certainly not least, there's Jump to Next Counterpart, which is very likely the shortcut used the most on any given day. Quickly switch between a `.h` header and it's corresponding `.m` implementation with a simple three-finger swipe up or down (or `^⌘↑` / `^⌘↓` if you feel so inclined). @@ -69,23 +69,23 @@ Last, but certainly not least, there's Jump to Next Counterpart, which is very l ## Comment Selection / Current Line (`⌘/`) -![Comment Selection](http://nshipster.s3.amazonaws.com/xcode-shortcuts-comment.gif) +![Comment Selection]({{ site.asseturl }}/xcode-shortcuts-comment.gif) Sure, you _could_ be debugging the "right way" by setting breakpoints and being clever with your code paths, but there's quite so refreshingly simple and powerful as phasing code in and out of computational existence with a comment. Add or remove `//` comments to the current line or selection. ## Show Standard Editor (`⌘↵`)
Show Assistant Editor (`⌥⌘↵`)
Show Version Editor (`⌥⇧⌘↵`) -![Editors](http://nshipster.s3.amazonaws.com/xcode-shortcuts-editors.gif) +![Editors]({{ site.asseturl }}/xcode-shortcuts-editors.gif) For how useful the Assistant Editor can be, surprisingly few developers can actually remember the key combo to turn it on and off. But now with `⌘↵` and `⌥⌘↵` fresh in your mind, you'll be helping Xcode help yourself more often. -![Assistant Editor Position](http://nshipster.s3.amazonaws.com/xcode-shortcuts-assistant-editor-position.png) +![Assistant Editor Position]({{ site.asseturl }}/xcode-shortcuts-assistant-editor-position.png) As an aside, if you're not big on how editors are stacking, a different horizontal or vertical arrangement can be chosen in View > Assistant Editor. --- -![Panels](http://nshipster.s3.amazonaws.com/xcode-shortcuts-panels.gif) +![Panels]({{ site.asseturl }}/xcode-shortcuts-panels.gif) Sandwiching the editors on the left and right flanks, the Navigator and Utilities panels encircle your code in their loving embrace. Learning how to get them to show what's useful and GTFO when needed are critical for inner peace and maximum productivity. @@ -122,7 +122,7 @@ Sandwiching the editors on the left and right flanks, the Navigator and Utilitie ## Show / Hide Debug Area (`⇧⌘Y`)
Activate Console (`⇧⌘C`) -![Show / Hide Debug Area](http://nshipster.s3.amazonaws.com/xcode-shortcuts-debug-area.gif) +![Show / Hide Debug Area]({{ site.asseturl }}/xcode-shortcuts-debug-area.gif) Anyone miss the option in Xcode 3 to have a detached debugger window? Yeah, me too. @@ -132,19 +132,19 @@ Knowing how to toggle the debug area and activate the console in a single keystr ## Find (`⌘F`) /
Find & Replace (`⌥⌘F`) /
Find in Project (`⇧⌘F`) /
Find & Replace in Project (`⌥⇧⌘F`) -![Find](http://nshipster.s3.amazonaws.com/xcode-shortcuts-find.gif) +![Find]({{ site.asseturl }}/xcode-shortcuts-find.gif) For when Xcode's refactoring capabilities come up short... which is to say: often. On the plus side, Xcode allows reference, definition, and regular expression search in addition to literal text. ## Spelling & Grammar (`⌘:`) -![Spelling & Grammar](http://nshipster.s3.amazonaws.com/xcode-shortcuts-spelling-and-grammar.png) +![Spelling & Grammar]({{ site.asseturl }}/xcode-shortcuts-spelling-and-grammar.png) All-powerful as Clang is, it still can't help your nightmarish grammar and punctuation in your comments. Especially for anyone releasing code into the open-source wilds, do yourself a favor and give it a once-over with a built-in OS X spelling and grammar check. --- -![Xcode Shortcut Preferences](http://nshipster.s3.amazonaws.com/xcode-shortcuts-preferences.png) +![Xcode Shortcut Preferences]({{ site.asseturl }}/xcode-shortcuts-preferences.png) But, of course, the fun doesn't stop there! Like any respectable editor, Xcode allows you to customize the key bindings for every menu item and action across the app. diff --git a/2013-10-21-launch-arguments-and-environment-variables.md b/2013-10-21-launch-arguments-and-environment-variables.md index b4745574..f3d39718 100644 --- a/2013-10-21-launch-arguments-and-environment-variables.md +++ b/2013-10-21-launch-arguments-and-environment-variables.md @@ -23,11 +23,11 @@ So this week on NSHipster, we'll take a look at the hidden world of Xcode runtim To enable launch arguments and set environment variables for your app, select your target from the Xcode toolbar and select "Edit Scheme..." -![Edit Scheme...](http://nshipster.s3.amazonaws.com/launch-arguments-edit-scheme.png) +![Edit Scheme...]({{ site.asseturl }}/launch-arguments-edit-scheme.png) On the left side of the panel, select "Run [AppName].app", and select the "Arguments" segment on the right side. There will be two drop-downs, for "Arguments Passed on Launch" and "Environment Variables". -![Edit Scheme Panel](http://nshipster.s3.amazonaws.com/launch-arguments-edit-scheme-panel.png) +![Edit Scheme Panel]({{ site.asseturl }}/launch-arguments-edit-scheme-panel.png) For the purposes of debugging an app target, launch arguments and environment variables can be thought to be equivalent—both change the runtime behavior by defining certain values. In practice, the main difference between the two is that launch arguments begin with a dash (`-`) and don't have a separate field for argument values. @@ -69,7 +69,7 @@ While you're waiting for the first batch of translations to come back, or are me -NSDoubleLocalizedStrings YES ~~~ -![NSDoubleLocalizedStrings - Before & After](http://nshipster.s3.amazonaws.com/launch-arguments-nsdoublelocalizedstrings.png) +![NSDoubleLocalizedStrings - Before & After]({{ site.asseturl }}/launch-arguments-nsdoublelocalizedstrings.png) #### NSShowNonLocalizedStrings diff --git a/2013-10-28-nshipster-quiz-4.md b/2013-10-28-nshipster-quiz-4.md index 4254a215..9d9a8769 100644 --- a/2013-10-28-nshipster-quiz-4.md +++ b/2013-10-28-nshipster-quiz-4.md @@ -62,16 +62,16 @@ Round 3: Picture Round - Indie Devs Following another tradition of the NSHipster quiz is everybody's favorite: the Picture Round! This time, the theme is indie developers. Earn up to 3 points for each set of pictures by naming the **founder**, the **name of the company** they're known for, and the **name of their flagship app** represented by the icon. -1. ![Question 1](http://nshipster-quiz-4.s3.amazonaws.com/nshipster-quiz-4-question-1.png) -2. ![Question 2](http://nshipster-quiz-4.s3.amazonaws.com/nshipster-quiz-4-question-2.png) -3. ![Question 3](http://nshipster-quiz-4.s3.amazonaws.com/nshipster-quiz-4-question-3.png) -4. ![Question 4](http://nshipster-quiz-4.s3.amazonaws.com/nshipster-quiz-4-question-4.png) -5. ![Question 5](http://nshipster-quiz-4.s3.amazonaws.com/nshipster-quiz-4-question-5.png) -6. ![Question 6](http://nshipster-quiz-4.s3.amazonaws.com/nshipster-quiz-4-question-6.png) -7. ![Question 7](http://nshipster-quiz-4.s3.amazonaws.com/nshipster-quiz-4-question-7.png) -8. ![Question 8](http://nshipster-quiz-4.s3.amazonaws.com/nshipster-quiz-4-question-8.png) -9. ![Question 9](http://nshipster-quiz-4.s3.amazonaws.com/nshipster-quiz-4-question-9.png) -10. ![Question 10](http://nshipster-quiz-4.s3.amazonaws.com/nshipster-quiz-4-question-10.png) +1. ![Question 1]({{ site.asseturl }}/quiz-4/nshipster-quiz-4-question-1.png) +2. ![Question 2]({{ site.asseturl }}/quiz-4/nshipster-quiz-4-question-2.png) +3. ![Question 3]({{ site.asseturl }}/quiz-4/nshipster-quiz-4-question-3.png) +4. ![Question 4]({{ site.asseturl }}/quiz-4/nshipster-quiz-4-question-4.png) +5. ![Question 5]({{ site.asseturl }}/quiz-4/nshipster-quiz-4-question-5.png) +6. ![Question 6]({{ site.asseturl }}/quiz-4/nshipster-quiz-4-question-6.png) +7. ![Question 7]({{ site.asseturl }}/quiz-4/nshipster-quiz-4-question-7.png) +8. ![Question 8]({{ site.asseturl }}/quiz-4/nshipster-quiz-4-question-8.png) +9. ![Question 9]({{ site.asseturl }}/quiz-4/nshipster-quiz-4-question-9.png) +10. ![Question 10]({{ site.asseturl }}/quiz-4/nshipster-quiz-4-question-10.png) Round 4: NSAnagram ------------------ diff --git a/2013-11-04-xctool.md b/2013-11-04-xctool.md index 54fb22cf..d71482b1 100644 --- a/2013-11-04-xctool.md +++ b/2013-11-04-xctool.md @@ -31,7 +31,7 @@ Rather than belabor the point by enumerating all of the flaws in this decade-old The first you'll notice about `xctool` is its gorgeous, colorized output. -![xctool in Action](http://nshipster.s3.amazonaws.com/xctool-example.gif) +![xctool in Action]({{ site.asseturl }}/xctool-example.gif) As consumers of Apple hardware and software ourselves, the role of design cannot be under-stated. In this respect, `xctool` absolutely nails it. Every step of the build process is neatly organized and reported in a way that is understandable and visually appealing, with ANSI colorization and a splash of Unicode ornamentation. diff --git a/2014-03-10-dictionary-services.md b/2014-03-10-dictionary-services.md index dc590d82..ad4ebebf 100644 --- a/2014-03-10-dictionary-services.md +++ b/2014-03-10-dictionary-services.md @@ -8,7 +8,7 @@ status: swift: t.b.c. --- -Librarian, illustrated by Conor Heelan +Librarian, illustrated by Conor Heelan This week's article is about dictionaries. Not the `NSDictionary` / `CFDictionaryRef` we encounter everyday, but those distant lexicographic vestiges of school days past. @@ -234,7 +234,7 @@ for (NSString *name in availableDictionariesKeyedByName) { Most surprising from this experimentation is the ability to access the raw HTML for entries, which combined with a dictionary's bundled CSS, produces the result seen in Dictionary.app. -![Entry for "apple" in Dictionary.app](http://nshipster.s3.amazonaws.com/dictionary.png) +![Entry for "apple" in Dictionary.app]({{ site.asseturl }}/dictionary.png) > For any fellow linguistics nerds or markup curious folks out there, here's [the HTML of the entry for the word "apple"](https://gist.github.com/mattt/9453538). @@ -258,13 +258,13 @@ UIReferenceLibraryViewController *referenceLibraryViewController = completion:nil]; ~~~ -![Presenting a UIReferenceLibraryViewController](http://nshipster.s3.amazonaws.com/uireferencelibraryviewcontroller-1.png) +![Presenting a UIReferenceLibraryViewController]({{ site.asseturl }}/uireferencelibraryviewcontroller-1.png) This is the same behavior that one might encounter by tapping the "Define" `UIMenuItem` on a highlighted word in a `UITextView`. > Tapping on "Manage" brings up a view to download additional dictionaries. -![Presenting a UIReferenceLibraryViewController](http://nshipster.s3.amazonaws.com/uireferencelibraryviewcontroller-2.png) +![Presenting a UIReferenceLibraryViewController]({{ site.asseturl }}/uireferencelibraryviewcontroller-2.png) `UIReferenceLibraryViewController` also provides the class method `dictionaryHasDefinitionForTerm:`. A developer would do well to call this before presenting a dictionary view controller that will inevitably have nothing to display. diff --git a/2014-03-24-nsurl.md b/2014-03-24-nsurl.md index f5cf25d1..810dc765 100644 --- a/2014-03-24-nsurl.md +++ b/2014-03-24-nsurl.md @@ -23,7 +23,7 @@ In its most basic form, a URI is comprised of a scheme name and a hierarchical p Many protocols, including HTTP, specify a regular structure for information like the username, password, port, and path in the hierarchical part: -![URL Structure](http://nshipster.s3.amazonaws.com/nsurl.png) +![URL Structure]({{ site.asseturl }}/nsurl.png) A solid grasp of network programming is rooted in an unshakeable familiarity with URL components. As a software developer, this means having a command over the URI functionality in your programming language's standard library. diff --git a/2014-03-31-avspeechsynthesizer.md b/2014-03-31-avspeechsynthesizer.md index 9ab3fa75..0b8e7856 100644 --- a/2014-03-31-avspeechsynthesizer.md +++ b/2014-03-31-avspeechsynthesizer.md @@ -136,7 +136,7 @@ willSpeakRangeOfSpeechString:(NSRange)characterRange } ~~~ -![AVSpeechSynthesizer Example](http://nshipster.s3.amazonaws.com/avspeechsynthesizer-example.gif) +![AVSpeechSynthesizer Example]({{ site.asseturl }}/avspeechsynthesizer-example.gif) See [this example app](https://github.com/mattt/AVSpeechSynthesizer-Example) for a demonstration of live text-highlighting for all of the supported languages. diff --git a/2014-04-07-configuration-profiles.md b/2014-04-07-configuration-profiles.md index 67eb1097..753bccec 100644 --- a/2014-04-07-configuration-profiles.md +++ b/2014-04-07-configuration-profiles.md @@ -43,7 +43,7 @@ There are several ways to deploy configuration profiles: > In addition to deploying configuration profiles, the [Apple Configurator](https://itunes.apple.com/us/app/apple-configurator/id434433123?mt=12) can generate profiles, as an alternative to hand-writing XML yourself. -![iOS Configurator - Generate](http://nshipster.s3.amazonaws.com/ios-configurator-generate.png) +![iOS Configurator - Generate]({{ site.asseturl }}/ios-configurator-generate.png) ## Use Cases diff --git a/2014-04-14-xcode-plugins.md b/2014-04-14-xcode-plugins.md index 8e74ae0b..759ed1f9 100644 --- a/2014-04-14-xcode-plugins.md +++ b/2014-04-14-xcode-plugins.md @@ -39,13 +39,13 @@ Finding it _too easy_ to quit Xcode? Try [XVim](https://github.com/JugglerShu/XV ### SublimeText -![SCXcodeMiniMap](http://nshipster.s3.amazonaws.com/scxcodeminimap.png) +![SCXcodeMiniMap]({{ site.asseturl }}/scxcodeminimap.png) Do you miss having a code minimap along the right gutter of your editor to put things into perspective? Install [SCXcodeMiniMap](https://github.com/stefanceriu/SCXcodeMiniMap) and never again miss the tree nodes for the forest. ### Atom -![Show in GitHub](http://nshipster.s3.amazonaws.com/showingithub.png) +![Show in GitHub]({{ site.asseturl }}/showingithub.png) Looking to be more in tune with GitHub? Add the [Show in GitHub / BitBucket](https://github.com/larsxschneider/ShowInGitHub) plugin to open to the selected lines of a file online. @@ -55,19 +55,19 @@ Rather than waiting with crossed fingers and clenched teeth each June, as Apple ### Add Line Breaks to Issue Navigator -![BBUFullIssueNavigator](http://nshipster.s3.amazonaws.com/bbufullissuenavigator.png) +![BBUFullIssueNavigator]({{ site.asseturl }}/bbufullissuenavigator.png) An annoyance going back to Xcode 4 has been the truncation of items in the Issues Navigator. Never again be frustrated by surprise ellipses when compiler warnings were just starting to get interesting, with [BBUFullIssueNavigator](https://github.com/neonichu/BBUFullIssueNavigator). ### Dismiss Debugging Console When Typing -![BBUDebuggerTuckAway](http://nshipster.s3.amazonaws.com/bbudebuggertuckaway.gif) +![BBUDebuggerTuckAway]({{ site.asseturl }}/bbudebuggertuckaway.gif) Another annoyance going back to Xcode 4 is how the debugging console seems to always get in the way. No more, with [BBUDebuggerTuckAway](https://github.com/neonichu/BBUDebuggerTuckAway). As soon as you start typing in the editor, the debugging window will get out of your way. ### Add ANSI Color Support to Debugging Console -![XcodeColors](http://nshipster.s3.amazonaws.com/xcodecolors.png) +![XcodeColors]({{ site.asseturl }}/xcodecolors.png) `ncurses` enthusiasts will no doubt be excited by the [XcodeColors](https://github.com/robbiehanson/XcodeColors) plugin, which adds support for ANSI colors to appear in the debugging console. @@ -85,13 +85,13 @@ Not being the most verbose language in existence, Objective-C can use all the he ### Autocomplete `switch` Statements -![SCXcodeSwitchExpander](http://nshipster.s3.amazonaws.com/scxcodeswitchexpander.gif) +![SCXcodeSwitchExpander]({{ site.asseturl }}/scxcodeswitchexpander.gif) Fact: `switch` statements and [`NS_ENUM`](http://nshipster.com/ns_enum-ns_options/) go together like mango and sweet sticky rice. The only way it could be improved would be with [SCXcodeSwitchExpander](https://github.com/stefanceriu/SCXcodeSwitchExpander) with automagically fills out a `case` statement for each value in the enumeration. ### Autocomplete Documentation -![VVDocumenter](http://nshipster.s3.amazonaws.com/vvdocumenter.gif) +![VVDocumenter]({{ site.asseturl }}/vvdocumenter.gif) [Documentation](http://nshipster.com/documentation/) adds a great deal of value to a code base, but it's a tough habit to cultivate. The [VVDocumenter-Xcode](https://github.com/onevcat/VVDocumenter-Xcode) plugin does a great deal to reduce the amount of work necessary to add [appledoc](http://gentlebytes.com/appledoc/)-compatible header documentation. Install it and wrap your code in a loving lexical embrace. @@ -105,7 +105,7 @@ Fact: `switch` statements and [`NS_ENUM`](http://nshipster.com/ns_enum-ns_option ### Statement Alignment -![XAlign](http://nshipster.s3.amazonaws.com/xalign.gif) +![XAlign]({{ site.asseturl }}/xalign.gif) Fancy yourself a code designer, automated formatters be damned? [XAlign](https://github.com/qfish/XAlign) automatically aligns assignments _just so_, to appease your most egregious OCD tendencies. @@ -115,7 +115,7 @@ In a similar vein to what [Bret Victor writes about Learnable Programming](http: ### Inspect `NSColor` / `UIColor` Instances -![ColorSense](http://nshipster.s3.amazonaws.com/colorsense.png) +![ColorSense]({{ site.asseturl }}/colorsense.png) Telling what a color is from its RGB values alone is a hard-won skill, so faced with an `NSColor` or `UIColor` value, we have little recourse to know what it'll look like until the code is built and run. Enter [ColorSense for Xcode](https://github.com/omz/ColorSense-for-Xcode) @@ -125,13 +125,13 @@ Quoth the README: ### Autocomplete Images from Project Bundle -![KSImageNamed](http://nshipster.s3.amazonaws.com/ksimagenamed.gif) +![KSImageNamed]({{ site.asseturl }}/ksimagenamed.gif) Similar to the ColorSense plugin, [KSImageNamed](https://github.com/ksuther/KSImageNamed-Xcode) will preview and autocomplete images in `[UIImage imageNamed:]` declarations. ### Semantics Highlighting -![Polychromatic](http://nshipster.s3.amazonaws.com/polychromatic.png) +![Polychromatic]({{ site.asseturl }}/polychromatic.png) Any editor worth its salt is expected to have some form of syntax highlighting. But [this recent post by Evan Brooks](https://medium.com/p/3a6db2743a1e) presents the idea of _semantic_ highlighting in editors. The idea is that each variable within a scope would be assigned a particular color, which would be consistent across references. This way, one could easily tell the difference between two instance variables in the same method. @@ -139,9 +139,9 @@ Any editor worth its salt is expected to have some form of syntax highlighting. ### Localization -![Lin](http://nshipster.s3.amazonaws.com/lin-1.png) +![Lin]({{ site.asseturl }}/lin-1.png) -![Lin](http://nshipster.s3.amazonaws.com/lin-2.png) +![Lin]({{ site.asseturl }}/lin-2.png) It's no secret that NSHipster has [a soft spot for localization](http://nshipster.com/nslocalizedstring/). For this reason, this publication is emphatic in its recommendation of [Lin](https://github.com/questbeat/Lin-Xcode5), a clever Xcode plugin that brings the localization editor to your code. diff --git a/2014-04-21-uiactivityviewcontroller.md b/2014-04-21-uiactivityviewcontroller.md index 858b9691..bf236034 100644 --- a/2014-04-21-uiactivityviewcontroller.md +++ b/2014-04-21-uiactivityviewcontroller.md @@ -52,7 +52,7 @@ UIActivityViewController *activityViewController = This would present the following at the bottom of the screen: -![UIActivityViewController](http://nshipster.s3.amazonaws.com/uiactivityviewcontroller.png) +![UIActivityViewController]({{ site.asseturl }}/uiactivityviewcontroller.png) By default, `UIActivityViewController` will show all available services supporting the provided items, but certain activity types can be excluded: @@ -302,8 +302,8 @@ As an example, let's create a custom activity type that takes an image URL and a - - + + diff --git a/2014-04-28-mkgeodesicpolyline.md b/2014-04-28-mkgeodesicpolyline.md index 88e3b7a8..ce070f8f 100644 --- a/2014-04-28-mkgeodesicpolyline.md +++ b/2014-04-28-mkgeodesicpolyline.md @@ -98,11 +98,11 @@ func mapView(mapView: MKMapView, rendererForOverlay overlay: MKOverlay) -> MKOve } ~~~ -![MKGeodesicPolyline on an MKMapView](http://nshipster.s3.amazonaws.com/mkgeodesicpolyline.jpg) +![MKGeodesicPolyline on an MKMapView]({{ site.asseturl }}/mkgeodesicpolyline.jpg) > For comparison, here's the same geodesic overlaid with a route created from [`MKDirections`](http://nshipster.com/mktileoverlay-mkmapsnapshotter-mkdirections/): -![MKGeodesicPolyline on an MKMapView compared to MKDirections Polyline](http://nshipster.s3.amazonaws.com/mkgeodesicpolyline-with-directions.jpg) +![MKGeodesicPolyline on an MKMapView compared to MKDirections Polyline]({{ site.asseturl }}/mkgeodesicpolyline-with-directions.jpg) [As the crow flies](http://en.wikipedia.org/wiki/As_the_crow_flies), it's 3,983 km.
As the wolf runs, it's 4,559 km—nearly 15% longer.
@@ -215,7 +215,7 @@ func mapView(mapView: MKMapView, viewForAnnotation annotation: MKAnnotation) -> } ~~~ -![MKAnnotationView without Rotation](http://nshipster.s3.amazonaws.com/mkgeodesicpolyline-airplane-animate.gif) +![MKAnnotationView without Rotation]({{ site.asseturl }}/mkgeodesicpolyline-airplane-animate.gif) Hmm… close but no [SkyMall Personalized Cigar Case Flask](http://www.skymall.com/personalized-cigar-case-flask/GC900.html). @@ -296,7 +296,7 @@ self.annotationView.transform = XXDegreesToRadians(self.planeDirection)); ~~~ -![MKAnnotationView with Rotation](http://nshipster.s3.amazonaws.com/mkgeodesicpolyline-airplane-animate-rotate.gif) +![MKAnnotationView with Rotation]({{ site.asseturl }}/mkgeodesicpolyline-airplane-animate-rotate.gif) Ah much better! At last, we have mastered the skies with a fancy visualization, worthy of any travel-related app. diff --git a/2014-05-12-nshipster-quiz-5.md b/2014-05-12-nshipster-quiz-5.md index 21d82d57..34e07c37 100644 --- a/2014-05-12-nshipster-quiz-5.md +++ b/2014-05-12-nshipster-quiz-5.md @@ -39,7 +39,7 @@ Current events, miscellaneous tidbits, and random trivia. Following a time-honor 9. What hot new social networking app allows you to anonymously chat with patrons of its eponymous, popular American chain restaurant? 10. If one were to sit down at a NeXTstation and open "/NextLibrary/Frameworks/AppKit.framework/Resources/", they would find the file "NSShowMe.tiff". Who is pictured in this photo? -![NSShowMe.tiff](http://nshipster.s3.amazonaws.com/NSShowMe.tiff) +![NSShowMe.tiff]({{ site.asseturl }}/NSShowMe.tiff) Round 2: Core Potpourri ----------------------- diff --git a/2014-05-26-cocoapods.md b/2014-05-26-cocoapods.md index 1680b940..43c29a4f 100644 --- a/2014-05-26-cocoapods.md +++ b/2014-05-26-cocoapods.md @@ -8,7 +8,7 @@ status: swift: n/a --- -Egg Merchant, illustrated by Conor Heelan +Egg Merchant, illustrated by Conor Heelan Civilization is built on infrastructure: roads, bridges, canals, sewers, pipes, wires, fiber. When well thought-out and implemented, infrastructure is a multiplying force that drives growth and development. But when such formative structures are absent or ad hoc, it feels as if progress is made _in spite of_ the situation. @@ -150,7 +150,7 @@ Invoking `$ pod try` with the name of a project in the public specs database ope $ pod try Ono ~~~ -![Ono.xcworkspace](http://nshipster.s3.amazonaws.com/cocoapods-try-ono.png) +![Ono.xcworkspace]({{ site.asseturl }}/cocoapods-try-ono.png) ## Creating a CocoaPod diff --git a/2014-07-21-xctestcase.md b/2014-07-21-xctestcase.md index c70cf866..a06f7f8f 100644 --- a/2014-07-21-xctestcase.md +++ b/2014-07-21-xctestcase.md @@ -115,7 +115,7 @@ func testOnePlusOneEqualsTwo() { ### All of the XCTest Assertions You _Really_ Need To Know -`XCTest` comes with [a number of built-in assertions](https://developer.apple.com/library/prerelease/ios/documentation/DeveloperTools/Conceptual/testing_with_xcode/testing_3_writing_test_classes/testing_3_writing_test_classes.html#//apple_ref/doc/uid/TP40014132-CH4-SW34), but one could narrow them down to just a few essentials: +`XCTest` comes with a number of built-in assertions, but one could narrow them down to just a few essentials: #### Fundamental Test diff --git a/2014-08-11-swift-operators.md b/2014-08-11-swift-operators.md index 1b8d6f8e..3c76af00 100644 --- a/2014-08-11-swift-operators.md +++ b/2014-08-11-swift-operators.md @@ -21,7 +21,7 @@ If we were to take apart a statement—say `1 + 2`—decomposing it into its con Although expressions are flat, the compiler will construct a tree representation, or AST: -![1 + 2 AST](http://nshipster.s3.amazonaws.com/swift-operators-one-plus-two.svg) +![1 + 2 AST]({{ site.asseturl }}/swift-operators-one-plus-two.svg) Compound statements, like `1 + 2 + 3` @@ -31,7 +31,7 @@ Compound statements, like `1 + 2 + 3` | left operand | operator | right operand | -![1 + 2 + 3 AST](http://nshipster.s3.amazonaws.com/swift-operators-one-plus-two-plus-three.svg) +![1 + 2 + 3 AST]({{ site.asseturl }}/swift-operators-one-plus-two-plus-three.svg) Or, to take an even more complex statement, `1 + 2 * 3 % 4`, the compiler would use operator precedence to resolve the expression into a single statement: @@ -40,7 +40,7 @@ Or, to take an even more complex statement, `1 + 2 * 3 % 4`, the compiler would | left operand | operator | right operand | -![1 + 2 * 3 % 4 AST](http://nshipster.s3.amazonaws.com/swift-operators-one-plus-two-times-three-mod-four.svg) +![1 + 2 * 3 % 4 AST]({{ site.asseturl }}/swift-operators-one-plus-two-times-three-mod-four.svg) Operator precedence rules, similar to the ones [you learned in primary school](http://en.wikipedia.org/wiki/Order_of_operations), provide a canonical ordering for any compound statement: diff --git a/2014-09-30-uialertcontroller.md b/2014-09-30-uialertcontroller.md index 83443db6..4ffcb742 100644 --- a/2014-09-30-uialertcontroller.md +++ b/2014-09-30-uialertcontroller.md @@ -43,7 +43,7 @@ Rather than specifying all of an alert's buttons in an initializer, instances of ### A Standard Alert -![A Standard Alert](http://nshipster.s3.amazonaws.com/uialertcontroller-alert-defautl-style.png) +![A Standard Alert]({{ site.asseturl }}/uialertcontroller-alert-defautl-style.png) #### The Old Way: UIAlertView @@ -83,7 +83,7 @@ self.presentViewController(alertController, animated: true) { ### A Standard Action Sheet -![A Standard Action Sheet](http://nshipster.s3.amazonaws.com/uialertcontroller-action-sheet-automatic-style.png) +![A Standard Action Sheet]({{ site.asseturl }}/uialertcontroller-action-sheet-automatic-style.png) #### UIActionSheet @@ -132,7 +132,7 @@ self.presentViewController(alertController, animated: true) { ### Alert with Destructive Button -![Alert with Destructive Button](http://nshipster.s3.amazonaws.com/uialertcontroller-alert-cancel-destroy.png) +![Alert with Destructive Button]({{ site.asseturl }}/uialertcontroller-alert-cancel-destroy.png) The type of an action is specified by `UIAlertActionStyle`, which has three values: @@ -162,7 +162,7 @@ self.presentViewController(alertController, animated: true) { ### Alert with >2 Buttons -![Alert with More Than 2 Buttons](http://nshipster.s3.amazonaws.com/uialertcontroller-alert-one-two-three-cancel.png) +![Alert with More Than 2 Buttons]({{ site.asseturl }}/uialertcontroller-alert-one-two-three-cancel.png) With one or two actions, buttons in an alert are stacked horizontally. Any more than that, though, and it takes on a display characteristic closer to an action sheet: @@ -180,7 +180,7 @@ alertController.addAction(cancelAction) ### Creating a Login Form -![Creating a Login Form](http://nshipster.s3.amazonaws.com/uialertcontroller-alert-username-password-login-forgot-password-cancel.png) +![Creating a Login Form]({{ site.asseturl }}/uialertcontroller-alert-username-password-login-forgot-password-cancel.png) iOS 5 added the `alertViewStyle` property to `UIAlertView`, which exposed much sought-after private APIs that allowed login and password fields to be displayed in an alert, as seen in several built-in system apps. @@ -218,7 +218,7 @@ alertController.addAction(cancelAction) ### Creating a Sign Up Form -![Creating a Sign Up Form](http://nshipster.s3.amazonaws.com/uialertcontroller-alert-sign-up.png) +![Creating a Sign Up Form]({{ site.asseturl }}/uialertcontroller-alert-sign-up.png) `UIAlertController` goes even further to allow any number of text fields, each with the ability to be configured and customized as necessary. This makes it possible to create a fully-functional signup form in a single modal alert: diff --git a/2014-10-06-swift-system-version-checking.md b/2014-10-06-swift-system-version-checking.md index bdf101e2..0c0a2125 100644 --- a/2014-10-06-swift-system-version-checking.md +++ b/2014-10-06-swift-system-version-checking.md @@ -79,13 +79,15 @@ For more involved version comparison, the `operatingSystemVersion` can be inspec ~~~{swift} let os = NSProcessInfo().operatingSystemVersion switch (os.majorVersion, os.minorVersion, os.patchVersion) { -case (9, _, _): - println("iOS >= 9.0.0") case (8, 0, _): println("iOS >= 8.0.0, < 8.1.0") +case (8, _, _): + println("iOS >= 8.1.0, < 9.0") +case (9, _, _): + println("iOS >= 9.0.0") default: - // this case is never run for IOS < 8.0.0 as NSProcessInfo().operatingSystemVersion crashes app if run on iOS earlier than 8.0.0 - println("iOS > 8.1.0, < 9.0.0, or iOS >= 10.0.0") + // this code will have already crashed on iOS 7, so >= iOS 10.0 + println("iOS >= 10.0.0") } ~~~ diff --git a/2014-10-17-inter-process-communication.md b/2014-10-17-inter-process-communication.md index 84d38c22..c21104e8 100644 --- a/2014-10-17-inter-process-communication.md +++ b/2014-10-17-inter-process-communication.md @@ -8,7 +8,7 @@ status: swift: t.b.c. --- -IPC Postman, illustrated by Conor Heelan +IPC Postman, illustrated by Conor Heelan In many ways, the story of Apple has been about fusing together technologies through happy accidents of history to create something better than before: OS X as a hybrid of MacOS & NeXTSTEP. Objective-C as the combination of Smalltalk's OOP paradigm and C. iCloud as the byproduct of MobileMe and _actual_ clouds (presumably). diff --git a/2014-10-28-cmdevicemotion.md b/2014-10-28-cmdevicemotion.md index 8be1510b..9d761b98 100644 --- a/2014-10-28-cmdevicemotion.md +++ b/2014-10-28-cmdevicemotion.md @@ -21,7 +21,7 @@ Both accelerometer and gyroscope data are presented in terms of three axes that The composited device motion data are presented in a few different ways, each with their own uses, as we'll see below. -![Device X-, Y-, and Z-axes](http://nshipster.s3.amazonaws.com/cmdm-axes.png) +![Device X-, Y-, and Z-axes]({{ site.asseturl }}/cmdm-axes.png) ## CMMotionManager @@ -112,7 +112,7 @@ Each packet of `CMAccelerometerData` includes an `x`, `y`, and `z` value—each We're calculating the rotation by computing the [`arctan2`](http://en.wikipedia.org/wiki/Atan2) of the `x` and `y` components from the accelerometer data and then using that rotation in a `CGAffineTransform`. Our image should stay right-side up no matter how the phone is turned—here it is in a hypothetical app for the *National Air & Space Museum* (my favorite museum as a kid): -![Rotation with accelerometer](http://nshipster.s3.amazonaws.com/cmdm-accelerometer.gif) +![Rotation with accelerometer]({{ site.asseturl }}/cmdm-accelerometer.gif) The results are not terribly satisfactory—the image movement is jittery, and moving the device in space affects the accelerometer as much as or even more than rotating. These issues *could* be mitigated by sampling multiple readings and averaging them together, but instead let's look at what happens when we involve the gyroscope. @@ -148,7 +148,7 @@ if (manager.deviceMotionAvailable) { Much better! -![Rotation with gravity](http://nshipster.s3.amazonaws.com/cmdm-gravity.gif) +![Rotation with gravity]({{ site.asseturl }}/cmdm-gravity.gif) ## UIClunkController @@ -184,7 +184,7 @@ if (manager.deviceMotionAvailable) { And it works like a charm—tapping the device in a detail view immediately takes us back to the list of exhibits: -![Clunk to go back](http://nshipster.s3.amazonaws.com/cmdm-clunk.gif) +![Clunk to go back]({{ site.asseturl }}/cmdm-clunk.gif) @@ -312,7 +312,7 @@ if (manager.deviceMotionAvailable) { Having implemented all that, let's take a look at the interaction. As the device rotates, the display automatically switches views and the quizee never sees the answer: -![Prompt by turning the device](http://nshipster.s3.amazonaws.com/cmdm-prompt.gif) +![Prompt by turning the device]({{ site.asseturl }}/cmdm-prompt.gif) ### Further Reading diff --git a/2014-11-03-uisplitviewcontroller.md b/2014-11-03-uisplitviewcontroller.md index b317dbcf..aeed156b 100644 --- a/2014-11-03-uisplitviewcontroller.md +++ b/2014-11-03-uisplitviewcontroller.md @@ -12,11 +12,11 @@ The introduction of iPhone 6+ brought on a new importance for `UISplitViewContro Check out the `UISplitViewController` doing its magic on iPhone 6+: -
Jony Ive BeforeJony Ive AfterJony Ive BeforeJony Ive After
Before