Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/AliSoftware/Xcode-Utils
A set of useful templates, macros, etc. to use with the Apple Developer Tools
https://github.com/AliSoftware/Xcode-Utils
Last synced: about 2 hours ago
JSON representation
A set of useful templates, macros, etc. to use with the Apple Developer Tools
- Host: GitHub
- URL: https://github.com/AliSoftware/Xcode-Utils
- Owner: AliSoftware
- Created: 2010-05-25T18:20:28.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2013-01-18T02:33:33.000Z (almost 12 years ago)
- Last Synced: 2024-11-07T04:52:08.555Z (5 days ago)
- Language: Objective-C
- Homepage:
- Size: 1.05 MB
- Stars: 32
- Watchers: 4
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This repository aims to share some useful resources for Xcode and other Developer Tools.
## [File Templates](Xcode-Utils/tree/master/File%20Templates) for Xcode
This folder contains some File Templates so you can have a nice and homogeneous organization of your code in all your files.
## [LibraryWithRsrc](Xcode-Utils/tree/master/LibraryWithRsrc) : Static Library **with Resource Bundle**
This is an example of how to create a Xcode projet that generate **both** a static library **and** a _resource bundle_.
The aim of this project is to show how you can have a library that provide both functional code but also **resources like
XIB files, PNG files, xcdatamodels, and even Localized strings**, without the need for you to copy
each and every single resource in your application project.There are a lot of advantages in this practice:
* Your library can provide `UIViewControllers` that are based on XIB files if necessary, and the XIB files will be provided by the library
and not need to be copied in the application for this to work
* If your XIB files (used and provided by the library and its resource bundle) use themselves some images in an `UIImageView`,
the image will be loaded from the same bundle than the XIB, namely the resource bundle provided by the library too, and not the application
* If your library needs to provide some localized strings, there is no need to merge your own `Localizable.strings` of your app
with the strings needed for the library: the library will have its own `Localizable.strings` and will be able to pick localized strings
from it instead of the one from the application itself.Once you have implemented a simple method in your library main class that returns an `NSBundle` object that will represent the
resource bundle generated by the library (see demo project), you can use all the standard methods of `NSBundle` like
`pathForResource:ofType:` and `localizedStringForKey:value:table:` to retrieve those resources.For images, the `+[UIImage imageNamed:inBundle:]` method is unfortunately a private method, but the demo project provides a workaround
(see the `UIImage+Bundle.h` category in the demo project).## [`ObjcSubscriptingSupport.h`](Xcode-Utils/tree/master/ObjcSubscriptingSupport.h)
This file allows support for Objective-C Subscripting for SDKs prior to iOS SDK 6 and OSX SDK 10.7:
* `array[n]` is the same as `[array objectAtIndex:n]` / `[array setObject:... atIndex:n]`
* `dict[k]` is the same as `[dict objectForKey:k]` / `[dict setObject:... forKey:k]`If you compile your code with those older SDKs and need subscripting support anyway, simply include this file to have the definitions.
## [`TODOMacros.h`](Xcode-Utils/tree/master/TODOMacros.h)
A header defining a lot of useful macros like `TODO(x)`, `FIXME(x)`, `NOTE(x)` to generate nice warnings to let you know you will have
to do some more work in that part of your code.This is much more efficient that simply using "TODO" comments for example, because it generate a warning that you can't forget about
(whereas a simple "TODO" comment will be forgotten quite quickly in practice, we all know that…) and that directly locate the part
of the code that need more work to be done later.## [Xcode3](Xcode-Utils/tree/master/Xcode3)
Legacy templates and Text Macros (snippets) for Xcode3. Now obsolete.