• Stars
    star
    142
  • Rank 258,495 (Top 6 %)
  • Language
    Objective-C
  • License
    Other
  • Created about 12 years ago
  • Updated about 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A collection of category methods designed to simplify the process of HTTP request construction and manipulation in Cocoa.

Build Status

Purpose

RequestUtils is a collection of category methods designed to simplify the process of HTTP request construction and manipulation in Cocoa. It extends NSString, NSURL and NSURLRequest with some additional utility methods that were left out of the standard API.

Supported OS & SDK Versions

  • Supported build target - iOS 9.2 / Mac OS 10.11 (Xcode 7.2, Apple LLVM compiler 7.1)
  • Earliest supported deployment target - iOS 7.1 / Mac OS 10.10
  • Earliest compatible deployment target - iOS 4.3 / Mac OS 10.6.8

NOTE: 'Supported' means that the library has been tested with this version. 'Compatible' means that the library should work on this iOS version (i.e. it doesn't rely on any unavailable SDK features) but is no longer being tested for compatibility and may require tweaking or bug fixes to run correctly.

ARC Compatibility

As of version 1.1, RequestUtils requires ARC. If you wish to use RequestUtils in a non-ARC project, just add the -fobjc-arc compiler flag to the RequestUtils.m class file. To do this, go to the Build Phases tab in your target settings, open the Compile Sources group, double-click RequestUtils.m in the list and type -fobjc-arc into the popover.

If you wish to convert your whole project to ARC, comment out the #error line in RequestUtils.m, then run the Edit > Refactor > Convert to Objective-C ARC... tool in Xcode and make sure all files that you wish to use ARC for (including RequestUtils.m) are checked.

Thread Safety

All the RequestUtils methods should be safe to use concurrently on multiple threads.

Installation

To use the RequestUtils categories in an app, just drag the RequestUtils.h and .m files (demo files and assets are not needed) into your project and import the header file into any class where you wish to make use of the RequestUtils functionality, or include it in your prefix.pch file to make it available globally within your project.

NSString Extensions

RequestUtils extends NSString with the following methods:

@property(nonatomic, readonly) NSString *URLEncodedString;

This is a method to URL-encode a string so that it may be safely used within a URL path or query parameter. This method is different from the standard stringByAddingPercentEscapesUsingEncoding: method because that only ensures that the string does not contain characters that are invalid for use in a string, but it doesn't encode characters that are valid to use in a url (e.g. "?", "&") but which cannot be used inside a query string parameter or path component without affecting the URL structure.

- (NSString *)URLDecodedString:(BOOL)decodePlusAsSpace;

This reverses the effects of URLEncodedString by replacing all percent escape sequences with their original characters. Internally this method uses to stringByReplacingPercentEscapesUsingEncoding: with NSUTF8StringEncoding. The parameter decodePlusAsSpace will cause "+" characters to be converted to spaces, which is useful if the parameters were generated by a web form.

- (NSString *)stringByAppendingURLPathExtension:(NSString *)extension;

NSString has a useful method stringByAppendingPathExtension: which can be used to add a path extension to the end of the string, correctly separated by a dot. Unfortunately the stringByAppendingPathExtension: method is not URL-aware, and incorrectly strips the double // from URLs when a path is appended. stringByAppendingURLPathExtension: is much smarter, and not only avoids stripping the // from the URL schema, but will also correctly insert the path extension before the URL query or fragment string.

@property(nonatomic, readonly) NSString *stringByDeletingURLPathExtension;

This is a URL-aware version of the stringByDeletingURLPathExtension method. It will remove the last component of the path without disrupting the query or fragment strings, or mangling // (if present).

@property(nonatomic, readonly) NSString *URLPathExtension;

This is a URL-aware version of the pathExtension method. It will return the path file extension without including the query or fragment strings (if present).

- (NSString *)stringByAppendingURLPathComponent:(NSString *)str;

NSString has a useful method stringByAppendingPathComponent: which can be used to add path components to the end of the string whilst correctly adding a dividing / and avoiding double / if one or both path components already include it. Unfortunately the stringByAppendingPathComponent: method is not URL-aware, and incorrectly strips the double // from URLs when a path is appended. stringByAppendingURLPathComponent: is much smarter, and not only avoids stripping the // from the URL schema, but will also correctly insert the path component before the URL query or fragment string.

@property(nonatomic, readonly) NSString *stringByDeletingLastURLPathComponent;

This is a URL-aware version of the stringByDeletingLastPathComponent method. It will remove the last component of the path without disrupting the query or fragment strings, or mangling // (if present).

@property(nonatomic, readonly) NSString *lastURLPathComponent;

This is a URL-aware version of the lastPathComponent method. It will return the last component of the path without including the query or fragment strings (if present).

+ (NSString *)URLQueryWithParameters:(NSDictionary *)parameters;

This method generates a URL query string from a dictionary of keys and values. The values in the dictionary can either be individual values such as strings or numbers, or arrays of values, in which case the last value in the array will be used by default. All key and values in the dictionary will be automatically URL-encoded. See below for more options around how parameter arrays are handled.

+ (NSString *)URLQueryWithParameters:(NSDictionary *)parameters options:(URLQueryOptions)options;

This method generates a URL query string from a dictionary of keys and values, but provides an additional options argument to control how parameter arrays are handled. All keys and values in the dictionary will be automatically URL encoded. See URLQueryOptions below for discussion of the options.

@property(nonatomic, readonly) NSString *URLQuery;

This method attempts to find and return a URL query string within the string. It is similar to the query method of NSURL, but works better with partial URLs/URIs or URLs with non-standard structures, e.g. bespoke schemas.

@property(nonatomic, readonly) NSString *stringByDeletingURLQuery;

This method finds and removes the URL query from the string. It is URL fragment/hash aware and will leave the URL fragment untouched if present.

- (NSString *)stringByReplacingURLQueryWithQuery:(NSString *)query

Replaces the current query string (if present) with the specified query string. Passing nil or an empty string as the query parameter is equivalent to calling stringByDeletingURLQuery;

- (NSString *)stringByAppendingURLQuery:(NSString *)query;

This method will append a URL query to the string. It is URL fragment/hash aware and will insert the query string before the # if present. It will also correctly join the string to an existing query string if present. If there is already a query string present, the two strings will be concatenated with no regard for duplicate parameters, however a joining & will be inserted if needed. For more options around merging query strings, see below:

- (NSString *)stringByMergingURLQuery:(NSString *)query;

This method will append a URL query to the string, merging any duplicate values. Duplicate query parameter keys will be replaced by the last value encountered for that key. For more merging options, see below:

- (NSString *)stringByMergingURLQuery:(NSString *)query options:(URLQueryOptions)options;

This method will append a URL query to the string, merging any duplicate values. By default, duplicate query parameters will be replaced by the last value encountered for that key, but you can override that behaviour using the options argument. See URLQueryOptions below for discussion of the options.

@property(nonatomic, readonly) NSDictionary *URLQueryParameters;

This method attempts to locate a query string within the string and then splits it into a dictionary of key/value pairs. Each key and value will be URL decoded. If duplicate parameter keys are encountered, the last value encountered for that key is used. To override this behaviour, use URLQueryParametersWithOptions: instead.

- (NSDictionary *)URLQueryParametersWithOptions:(URLQueryOptions)options;

This method attempts to locate a query string within the string and then splits it into a dictionary of key/value pairs. Each key and value will be URL decoded. The options argument controls how duplicate parameters should be handled. See URLQueryOptions below for discussion of the options.

@property(nonatomic, readonly) NSString *URLFragment;

This method returns the URL fragment identifier or hash part of the string. It is similar to the fragment method of NSURL, but works better with partial URLs/URIs or URLs with non-standard structures, e.g. bespoke schemas.

@property(nonatomic, readonly) NSString *stringByDeletingURLFragment;

This method finds and removes the URL fragment identifier from the string (if present).

- (NSString *)stringByAppendingURLFragment:(NSString *)fragment;

This method will append a URL fragment identifier to the string. It will also correctly concatenate the string to an existing fragment identifier if present. No attempt is made to analyse the structure of the fragment, or handle path concatenation correctly within the fragment string. If you need to do that, generate the fragment separately and then set it in one go.

@property(nonatomic, readonly) NSURL *URLValue;

This method converts the string to a URL. It is similar to using [NSURL URLWithString:], but with a couple of benefits: 1) It doesn't throw an exception if the string is nil, and 2) It automatically detects if the string is a file path and uses [NSURL fileURLWithString:] instead of [NSURL URLWithString:], thereby eliminating a common source of bugs.

- (NSURL *)URLValueRelativeToURL:(NSURL *)baseURL;

This method converts the string to a URL. It is similar to using [NSURL URLWithString:relativeToURL], but won't throw an exception if the string is nil.

@property(nonatomic, readonly) NSString *base64EncodedString;

Encodes the string as UTF8 data and then encodes that as a base-64-encoded string without any wrapping (line breaks). For more advanced base 64 encoding options, check out my Base64 library (https://github.com/nicklockwood/Base64).

@property(nonatomic, readonly) NSString *base64DecodedString;

Treats the string as a base-64-encoded string and returns an autoreleased NSString object containing the decoded data, interpreted using UTF8 encoding. Any non-base-64 characters in the string are ignored, so it is safe to use a string containing line breaks or other delimiters. For more advanced base 64 decoding options, check out my Base64 library (https://github.com/nicklockwood/Base64).

NSURL Extensions

RequestUtils extends NSURL with the following methods:

+ (NSURL *)URLWithComponents:(NSDictionary *)components;

This builds a URL from the supplied dictionary of components. The dictionary may contain any or all of the following: scheme, host, port, user, password, path, parameterString, query, fragment (there are a set of constants defined for all of these values). All values are optional and the method will attempt to build as much of the URL as possible given the values supplied. All values supplied should be NSStrings, with the exception of the URLQueryComponent, which can be either an NSString or an NSDictionary of query parameters.

@property(nonatomic, readonly) NSDictionary *components;

Returns a dictionary of URL components containing any or all of the following: scheme, host, port, user, password, path, parameterString, query, fragment.

- (NSURL *)URLWithScheme:(NSString *)scheme;

Sets or replaces the current URL scheme with the supplied value.

- (NSURL *)URLWithHost:(NSString *)host;

Sets or replaces the current URL host with the supplied value.

- (NSURL *)URLWithPort:(NSString *)port;

Sets or replaces the current URL port with the supplied value.

- (NSURL *)URLWithUser:(NSString *)user;

Sets or replaces the current URL user with the supplied value.

- (NSURL *)URLWithPassword:(NSString *)password;

Sets or replaces the current URL password with the supplied value.

- (NSURL *)URLWithPath:(NSString *)path;

Sets or replaces the current URL path with the supplied value.

- (NSURL *)URLWithParameterString:(NSString *)parameterString;

Sets or replaces the current URL parameterString with the supplied value.

- (NSURL *)URLWithQuery:(NSString *)query;

Sets or replaces the current URL query with the supplied value.

- (NSURL *)URLWithFragment:(NSString *)fragment;

Sets or replaces the current URL fragment with the supplied value.

NSURLRequest Extensions

RequestUtils extends NSURLRequest with the following methods:

+ (id)HTTPRequestWithURL:(NSURL *)URL method:(NSString *)method parameters:(NSDictionary *)parameters;

Creates a new, autoreleased NSURLRequest using the specified URL, HTTP method and parameters. For GET request, the parameters are encoded in the query string. For all other methods the parameters are encoded in the POST body.

+ (id)GETRequestWithURL:(NSURL *)URL parameters:(NSDictionary *)parameters;

Creates a new, autoreleased NSURLRequest using the GET method and the specified URL and parameters. The Parameters are URL encoded and set as the query string of the request URL. If the URL already includes a query string, the passed parameters will be appended to the existing query according to the rules used for the NSString stringByMergingURLQuery: extension method.

+ (id)POSTRequestWithURL:(NSURL *)URL parameters:(NSDictionary *)parameters;

Creates a new, autoreleased NSURLRequest using the POST method and the specified URL and parameters. The parameters are URL encoded and set as the body of the request.

@property(nonatomic, readonly) NSDictionary *GETParameters;

Returns the GET (query string) parameters of the request as a dictionary.

@property(nonatomic, readonly) NSDictionary *POSTParameters;

Returns the POST (request body) parameters of the request as a dictionary.

@property(nonatomic, readonly) NSString *HTTPBasicAuthUser;

Returns the HTTP basic auth user. If the request has an Authorization header then that will be used to get the user, otherwise if there is a user specified in the URL itself, that will be used instead.

@property(nonatomic, readonly) NSString *HTTPBasicAuthPassword;

Returns the HTTP basic auth password. If the request has an Authorization header then that will be used to get the password, otherwise if there is a password specified in the URL itself, that will be used instead.

NSMutableURLRequest Extensions

RequestUtils extends NSMutableURLRequest with the following methods:

@property(nonatomic, copy) NSDictionary *GETParameters;

- (void)setGETParameters:(NSDictionary *)parameters options:(URLQueryOptions)options

This method sets the GET parameters of the request using a dictionary. The Parameters are URL encoded and set as the query string of the request URL. Any existing query string parameters will be replaced by the new values. The optional options argument allows you to control how the query parameters are serialised (see the URLQueryOptions section below for details).

- (void)addGETParameters:(NSDictionary *)parameters options:(URLQueryOptions)options

This method works like the setGETParameters: method except that the parameters are merged with the existing request parameters instead of replacing them. The rules by which the merging occurs are controlled by the options argument (see the URLQueryOptions section below for details).

@property(nonatomic, copy) NSDictionary *POSTParameters;

- (void)setPOSTParameters:(NSDictionary *)parameters options:(URLQueryOptions)options

This method sets the POST parameters of the request using a dictionary. The parameters are URL encoded and set as the body of the request. Any existing request body contents will be replaced. The optional options argument allows you to control how the POST parameters are serialised (see the URLQueryOptions section below for details).

- (void)addPOSTParameters:(NSDictionary *)parameters options:(URLQueryOptions)options

This method works like the setPOSTParameters: method except that the parameters are merged with the existing POST parameters instead of replacing them. The rules by which the merging occurs are controlled by the options argument (see the URLQueryOptions section below for details).

- (void)setHTTPBasicAuthUser:(NSString *)user password:(NSString *)password;

This method sets the HTTP basic auth username and password for the request. The username and password are set using the Authorization header of the request.

URLQueryOptions

The query string manipulation methods offer some options for how query strings should be generated or interpreted. The options can be combined using the | (pipe) or + (plus) operators. Some of these options are mutually exclusive however, and should not be combined.

URLQueryOptionDefault

The default option if no alternative is specified. When generating query strings from dictionaries using URLQueryWithParameters:, this maps to URLQueryOptionUseArrays meaning that any arrays of values will be expanded into multiple parameters.

When parsing query strings into parameter dictionaries using URLQueryParameters this maps to URLQueryOptionKeepLastValue meaning that if duplicate parameter keys are encountered, the value of the last duplicate will be used.

URLQueryOptionKeepLastValue

This is the default option when parsing query strings into parameter dictionaries using URLQueryParameters. When this option is used and duplicate parameter keys are encountered, the value of the last duplicate will be used.

If this option is used when generating a query string from a dictionary using URLQueryWithParameters:options: and an array of values is provided for a given parameter, only the last value will be used to construct the query string.

URLQueryOptionKeepFirstValue

If this option is used when parsing query strings into parameter dictionaries using URLQueryParametersWithOptions: and duplicate parameter keys are encountered, the first encountered value with a given key will be used.

If this option is used when generating a query string from a dictionary using URLQueryWithParameters:options: and an array of values is provided for a given parameter, only the first value will be used to construct the query string.

URLQueryOptionUseArrays

If this option is used when parsing query strings into parameter dictionaries using URLQueryParametersWithOptions: and duplicate parameter keys are encountered, or the key has a "[]" array suffix, the values will be gathered into an array. The resultant parameter array will therefore contain a mix of array and string values, and you will need to add code to check the type of each dictionary entry when processing.

If this option is used when generating a query string from a dictionary using URLQueryWithParameters:options: and an array of values is provided for a given parameter, duplicate parameters will be added to the query string with that key.

URLQueryOptionAlwaysUseArrays

If this option is used when parsing query strings into parameter dictionaries using URLQueryParametersWithOptions:, each dictionary entry will be created as an array, even if there is only one parameter with a given key (in which case the array will contain one item). The advantage of this is that you can guarantee that every dictionary entry will be an array, avoiding the need to add code to check the type of each dictionary entry when processing.

When generating a query string from a dictionary using URLQueryWithParameters:options:, this option is equivalent to URLQueryOptionUseArrays unless URLQueryOptionUseArraySyntax is also enabled. If URLQueryOptionUseArraySyntax is enabled, using URLQueryOptionUseArrays means that every key in the resultant query string will be suffixed with "[]", even if there is only one value associated with it. This may then impact how those parameters are interpreted later (i.e. as single-item arrays rather than strings). See URLQueryOptionUseArraySyntax for more discussion.

URLQueryOptionUseArraySyntax

Unlike the previous options, which are mutually exclusive, URLQueryOptionUseArraySyntax can be combined with URLQueryOptionUseArrays or URLQueryOptionAlwaysUseArrays to affect output. When generating a query string from a dictionary using URLQueryWithParameters:options:, setting this option means that any key with multiple value (or any key period if URLQueryOptionAlwaysUseArrays is used) will be suffixed with the "[]" syntax to indicate that it is part of a parameter array.

Use of the "[]" key suffix is not an official part of the RFC 1808 URL specification, but it is an ad-hoc standard used by a number of popular web server platforms including PHP, and so it can be useful to be able to interpret and/or generate query strings in this format. By default, this option is disabled.

URLQueryOptionUseArraySyntax has no effect when parsing query strings using the URLQueryParameters: method.

URLQueryOptionSortKeys

The URLQueryOptionSortKeys option can be combined with any of the previous options. It is used when generating a query string to ensure that the keys in the resultant string will be outputted in a consistent order (alphabetical). This can be useful when performing unit tests, or cryptographic hashes on the resultant string, where you need to be able to depend on the order remaining consistent.

Release Notes

Version 1.1.2

  • Added nullability annotations
  • Added lightweight generics annotations
  • Converted getters to readonly properties
  • Fixed deprecation warnings in iOS9
  • Added watchOS and tvOS to Podspec

Version 1.1.1

  • Fixed warnings on Xcode 6.3 and 7.0
  • Removed redundant [self description] calls

Version 1.1

  • Added URLQueryOptionSortKeys option
  • Now requires ARC

Version 1.0.4

  • Fixed bug in -[NSURL URLWithPath:]

Version 1.0.3

  • Fixed crash when request parameter dictionary keys or values are not strings
  • Improved test coverage

Version 1.0.2

  • Fixed bug in stringByAppendingURLQuery: method
  • Updated to use native base64 support
  • Now conforms to -Weverything warning level

Version 1.0.1

  • Updated for Xcode 4.6
  • URLEncoding now copes gracefully with non-string values (e.g NSNumber)
  • Fixed bug in stringByMergingURLQuery:options: method

Version 1.0

  • Initial release.

More Repositories

1

iCarousel

A simple, highly customisable, data-driven 3D carousel for iOS and Mac OS
Objective-C
11,999
star
2

SwiftFormat

A command-line tool and Xcode Extension for formatting Swift code
Swift
7,781
star
3

FXBlurView

[DEPRECATED]
Objective-C
4,942
star
4

iRate

[DEPRECATED]
Objective-C
4,100
star
5

FXForms

[DEPRECATED]
Objective-C
2,926
star
6

SwipeView

SwipeView is a class designed to simplify the implementation of horizontal, paged scrolling views on iOS. It is based on a UIScrollView, but adds convenient functionality such as a UITableView-style dataSource/delegate interface for loading views dynamically, and efficient view loading, unloading and recycling.
Objective-C
2,646
star
7

layout

A declarative UI framework for iOS
Swift
2,231
star
8

iVersion

[DEPRECATED]
Objective-C
1,947
star
9

NullSafe

NullSafe is a simple category on NSNull that returns nil for unrecognised messages instead of throwing an exception
Objective-C
1,943
star
10

RetroRampage

Tutorial series demonstrating how to build a retro first-person shooter from scratch in Swift
Swift
1,486
star
11

XMLDictionary

[DEPRECATED]
Objective-C
1,139
star
12

AutoCoding

AutoCoding is a category on NSObject that provides automatic support for NSCoding and NSCopying to every object.
Objective-C
1,068
star
13

GZIP

A simple NSData category for gzipping/unzipping data in iOS and Mac OS
Objective-C
983
star
14

FastCoding

A faster and more flexible binary file format replacement for NSCoding, Property Lists and JSON
C
976
star
15

AsyncImageView

[DEPRECATED]
Objective-C
906
star
16

iConsole

[DEPRECATED]
Objective-C
859
star
17

Expression

A cross-platform Swift library for evaluating mathematical expressions at runtime
Swift
822
star
18

FXLabel

[DEPRECATED]
Objective-C
816
star
19

CountryPicker

CountryPicker is a custom UIPickerView subclass that provides an iOS control allowing a user to select a country from a list. It can optionally display a flag next to each country name, and the library includes a set of 249 high-quality, public domain flag images from FAMFAMFAM (http://www.famfamfam.com/lab/icons/flags/) that have been painstakingly re-named by country code to work with the library.
Objective-C
740
star
20

Euclid

A Swift library for creating and manipulating 3D geometry
Swift
637
star
21

SoundManager

Simple sound and music player class for playing audio on Mac and iPhone
Objective-C
630
star
22

FXImageView

FXImageView is a class designed to simplify the application of common visual effects such as reflections and drop-shadows to images, and also to help the performance of image loading by handling it on a background thread.
Objective-C
628
star
23

Base64

[DEPRECATED]
Objective-C
578
star
24

FXKeychain

[DEPRECATED]
Objective-C
554
star
25

MustOverride

Provides a macro that you can use to ensure that a method of an abstract base class *must* be overriden by its subclasses.
Objective-C
523
star
26

LayerSprites

LayerSprites is a library designed to simplify the use of sprite sheets (image maps containing multiple sub-images) in UIKit applications without using OpenGL or 3rd-party game libraries. Can load sprite sheets in the Coco2D format.
Objective-C
504
star
27

GLView

[DEPRECATED]
Objective-C
477
star
28

FXNotifications

An alternative API for NSNotificationCenter that doesn't suck
Objective-C
392
star
29

ShapeScript

The ShapeScript 3D modeling app for macOS and iOS
Swift
391
star
30

LRUCache

LRUCache is an open-source replacement for NSCache that behaves in a predictable, debuggable way
Swift
378
star
31

VectorMath

A Swift library for Mac and iOS that implements common 2D and 3D vector and matrix functions, useful for games or vector-based graphics
Swift
367
star
32

ReflectionView

[DEPRECATED]
Objective-C
359
star
33

Swiftenstein

Simple Wolfenstein 3D clone written in Swift
Swift
359
star
34

JPNG

JPNG is a bespoke image file format that combines the compression benefits of JPEG with the alpha channel support of a PNG file. The JPNG library provides an Objective-C implementation of this format along with transparent JPNG loading support for iOS and Mac OS.
Objective-C
340
star
35

StandardPaths

StandardPaths is a category on NSFileManager for simplifying access to standard application directories on iOS and Mac OS and abstracting the iCloud backup flags on iOS. It also provides support for working with device-specific file suffixes, such as the @2x suffix for Retina displays, or the -568h suffix for iPhone 5 and can optionally swizzle certain UIKit methods to support these suffixes more consistently.
Objective-C
336
star
36

ViewUtils

ViewUtils is a collection of category methods designed that extend UIView with all the handy little properties and functionality that you always wished were built-in to begin with.
Objective-C
324
star
37

FXPageControl

Simple, drop-in replacement for the iPhone UIPageControl that allows customisation of the dot colour, size and spacing.
Objective-C
298
star
38

BaseModel

BaseModel provides a base class for building model objects for your iOS or Mac OS projects. It saves you the hassle of writing boilerplate code, and encourages good practices by reducing the incentive to cut corners in your model implementation.
Objective-C
288
star
39

OrderedDictionary

This library provides OrderedDictionary and MutableOrderedDictionary subclasses.
Objective-C
278
star
40

ColorUtils

[DEPRECATED]
Objective-C
256
star
41

Tribute

A command-line tool for tracking Swift project licenses
Swift
246
star
42

OSNavigationController

[DEPRECATED]
Objective-C
233
star
43

Consumer

Mac and iOS library for parsing structured text
Swift
226
star
44

iNotify

[DEPRECATED]
Objective-C
225
star
45

FPSControls

An experimental implementation of touch-friendly first-person shooter controls using SceneKit and Swift
Swift
215
star
46

OSCache

OSCache is an open-source re-implementation of NSCache that behaves in a predictable, debuggable way.
Objective-C
200
star
47

Chess

A simple Chess game for iOS, written in Swift
Swift
177
star
48

RequestQueue

[DEPRECATED]
Objective-C
174
star
49

FXReachability

Lightweight reachability class for Mac and iOS
Objective-C
173
star
50

Sprinter

A library for formatting strings on iOS and macOS
Swift
166
star
51

CryptoCoding

CryptoCoding is a superset of the NSCoding protocol that allows for simple, seamless AES encryption of any NSCoding-compatible object.
Objective-C
148
star
52

CubeController

CubeController is a UIViewController subclass that can be used to create a rotating 3D cube navigation.
Objective-C
142
star
53

HTMLLabel

[DEPRECATED]
Objective-C
139
star
54

NSOperationStack

[DEPRECATED]
Objective-C
118
star
55

SVGPath

Cross-platform Swift library for parsing SVGPath strings
Swift
111
star
56

HRCoder

HRCoder is a replacement for the NSKeyedArchiver and NSKeyedUnarchiver classes that uses a human-readable/editable format that can easily be stored in a regular Plist or JSON file.
Objective-C
104
star
57

iPrompt

[DEPRECATED]
Objective-C
99
star
58

Presentations

Code samples and projects for presentations that I have given
Objective-C
98
star
59

FXPhotoEditView

[DEPRECATED]
Objective-C
92
star
60

StackView

StackView is a class designed to simplify the implementation of vertical stacks of views on iOS. You can think of it as a bit like a simplified version of UITableView.
Objective-C
73
star
61

WebContentView

[DEPRECATED]
Objective-C
69
star
62

StringCoding

StringCoding is a simple Mac/iOS library for setting object properties of any type using string values. It can automatically detect the property type and attempt to interpret the string as the right kind of value. It's particularly oriented towards iOS app theming (see README for details).
Objective-C
57
star
63

ArrayUtils

[DEPRECATED]
Objective-C
49
star
64

Swune

Swift/UIKit reimplementation of the Dune II RTS game
Swift
46
star
65

Parsing

Supporting code for my talk entitled "Parsing Formal Languages with Swift"
Swift
42
star
66

MACAddress

[DEPRECATED]
Objective-C
39
star
67

FXParser

[DEPRECATED]
Objective-C
34
star
68

RotateView

Objective-C
34
star
69

RandomSequence

A class for creating independent, repeatable pseudorandom number sequences on Mac and iOS
Objective-C
28
star
70

FloatyBalloon

This is the source code for a simple game called Floaty Balloon, based on the gameplay of Flappy Bird. It was created as a tutorial for http://iosdevelopertips.com
Objective-C
25
star
71

Concurrency

Full source code for a simple currency calculator app
Objective-C
15
star
72

FXJSON

[DEPRECATED]
Objective-C
15
star
73

PNGvsJPEG

This is a simple benchmark app to compare JPEG vs PNG loading performance on iOS. Spoiler: JPEG wins.
Objective-C
6
star