Latest 0.6
Homepage https://github.com/jspahrsummers/libextobjc
License MIT Copyright (c) 2012 Justin Spahr-Summers

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Platforms osx , ios , tvos , watchos , requires ARC
Authors

The Extended Objective-C library extends the dynamism of the Objective-C programming language to support additional patterns present in other programming languages (including those that are not necessarily object-oriented).

libextobjc is meant to be very modular – most of its classes and modules can be used with no more than one or two dependencies.

Features

libextobjc currently includes the following features:

  • Safe categories, using EXTSafeCategory, for adding methods to a class without overwriting anything already there (identifying conflicts for you).
  • Concrete protocols, using EXTConcreteProtocol, for providing default implementations of the methods in a protocol.
  • Simpler and safer key paths, using EXTKeyPathCoding, which automatically checks key paths at compile-time.
  • Compile-time checking of selectors to ensure that an object declares a given selector, using EXTSelectorChecking.
  • Easier use of weak variables in blocks, using @weakify, @unsafeify, and @strongify from the EXTScope module.
  • Scope-based resource cleanup, using @onExit in the EXTScope module, for automatically cleaning up manually-allocated memory, file handles, locks, etc., at the end of a scope.
  • Algebraic data types generated completely at compile-time, defined using EXTADT.
  • Synthesized properties for categories, using EXTSynthesize.
  • Block-based coroutines, using EXTCoroutine.
  • EXTNil, which is like NSNull, but behaves much more closely to actual nil (i.e., doesn’t crash when sent unrecognized messages).
  • Lots of extensions and additional functionality built on top of <objc/runtime.h>, including extremely customizable method injection, reflection upon object properties, and various functions to extend class hierarchy checks and method lookups.

The experimental
branch contains additional features that may be interesting, but are not
considered stable or safe for production use. Check out the headers for more
information.

Running tests

To execute libextobjc’s tests, first run git submodule update --init --recursive
to bring in the xcconfigs submodule,
then open the project file and choose the desired test target.

Adding to your project

If you want to add libextobjc as a dependency to an application, add the
repository as a submodule,
then include the source files you care about in your Xcode project.

If you want to add libextobjc as a dependency to a framework or library,
prefer subtree merging,
which will allow you to rename symbols to avoid conflicts, and make any tweaks
you need to for your library.

To create a libextobjc subtree:

$ git remote add libextobjc https://github.com/jspahrsummers/libextobjc.git
$ git fetch libextobjc
$ git read-tree --prefix=External/ -u libextobjc/master
$ git reset

Rename any symbols or change whatever you want, git add the specific files
that you want in your library, and then add them to your Xcode project.

To bring in upstream changes later:

$ git fetch -p libextobjc
$ git merge -Xsubtree=External/ libextobjc/master
$ git reset

Then, again, just add the changes you want.

License

Released under the MIT License. See the
LICENSE
file for more information.

Requirements

libextobjc must be built with ARC enabled, and many of its macros require ARC in the calling files as well. MRR usage is not supported.

Latest podspec

{
    "name": "libextobjc",
    "version": "0.6",
    "summary": "A Cocoa library to extend the Objective-C programming language.",
    "homepage": "https://github.com/jspahrsummers/libextobjc",
    "authors": {
        "Justin Spahr-Summers": "[email protected]"
    },
    "source": {
        "git": "https://github.com/jspahrsummers/libextobjc.git",
        "tag": "0.6"
    },
    "requires_arc": true,
    "description": "                    The Extended Objective-C library extends the dynamism of the Objective-C programming language to support additional patterns present in other dynamic programming languages (including those that are not necessarily object-oriented).nn                    libextobjc is meant to be very modular u2013 most of its classes and modules can be used with no more than one or two dependencies.                    n",
    "license": {
        "type": "MIT",
        "text": "                      Copyright (c) 2012 Justin Spahr-Summersnn                      Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:nn                      The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.nn                      THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.n"
    },
    "platforms": {
        "osx": null,
        "ios": null,
        "tvos": null,
        "watchos": null
    },
    "subspecs": [
        {
            "name": "UmbrellaHeader",
            "source_files": "extobjc/extobjc.h"
        },
        {
            "name": "RuntimeExtensions",
            "source_files": [
                "extobjc/metamacros.h",
                "extobjc/EXTRuntimeExtensions.{h,m}"
            ]
        },
        {
            "name": "EXTADT",
            "source_files": "extobjc/EXTADT.{h,m}",
            "dependencies": {
                "libextobjc/RuntimeExtensions": []
            }
        },
        {
            "name": "EXTConcreteProtocol",
            "source_files": "extobjc/EXTConcreteProtocol.{h,m}",
            "dependencies": {
                "libextobjc/RuntimeExtensions": []
            }
        },
        {
            "name": "EXTKeyPathCoding",
            "source_files": "extobjc/EXTKeyPathCoding.{h,m}",
            "dependencies": {
                "libextobjc/RuntimeExtensions": []
            }
        },
        {
            "name": "EXTNil",
            "source_files": "extobjc/EXTNil.{h,m}",
            "dependencies": {
                "libextobjc/RuntimeExtensions": []
            }
        },
        {
            "name": "EXTSafeCategory",
            "source_files": "extobjc/EXTSafeCategory.{h,m}",
            "dependencies": {
                "libextobjc/RuntimeExtensions": []
            }
        },
        {
            "name": "EXTScope",
            "source_files": "extobjc/EXTScope.{h,m}",
            "dependencies": {
                "libextobjc/RuntimeExtensions": []
            }
        },
        {
            "name": "EXTSelectorChecking",
            "source_files": "extobjc/EXTSelectorChecking.{h,m}",
            "dependencies": {
                "libextobjc/RuntimeExtensions": []
            }
        },
        {
            "name": "EXTSynthesize",
            "source_files": "extobjc/EXTSynthesize.{h,m}",
            "dependencies": {
                "libextobjc/RuntimeExtensions": []
            }
        },
        {
            "name": "NSInvocation+EXT",
            "source_files": "extobjc/NSInvocation+EXT.{h,m}",
            "dependencies": {
                "libextobjc/RuntimeExtensions": []
            }
        },
        {
            "name": "NSMethodSignature+EXT",
            "source_files": "extobjc/NSMethodSignature+EXT.{h,m}",
            "dependencies": {
                "libextobjc/RuntimeExtensions": []
            }
        }
    ]
}

Pin It on Pinterest

Share This