Skip to content
This repository has been archived by the owner on Mar 3, 2022. It is now read-only.

Commit

Permalink
nuspecs. README updates
Browse files Browse the repository at this point in the history
Added nuspec files for Unity and TinyIoC packages. Updated README with
external links, and note about limitations with TinyIoC.
  • Loading branch information
jamesmblair committed Feb 4, 2015
1 parent 1a98c63 commit f46ea23
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 5 deletions.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
iOS Dependency Swizzler
=======================

> Uses "method swizzling" from the Objective-C runtime to allow property-setter dependency injection of UIViewControllers instantiated by storyboards.
> A Xamarin.iOS library that uses "method swizzling" from the Objective-C runtime to allow property-setter dependency injection of UIViewControllers instantiated by storyboards. If you're unfamiliar with the concept of method swizzling see [Mattt Thompson's excellent post](http://nshipster.com/method-swizzling/) at NSHipster. For a deeper dive, see Apple's documentation for the [Objective-C runtime reference](https://developer.apple.com/library/ios/documentation/Cocoa/Reference/ObjCRuntimeRef/index.html).
## Examples
### Unity
### [Unity](https://unity.codeplex.com/)
```C#
var container = new UnityContainer();

Expand All @@ -15,14 +15,14 @@ var buildUpStrategy = new UnityBuildUpStrategy(container);
StoryboardInjector.SetUp(buildUpStrategy);

```
*Note: With Unity you must use the `[Dependency]` attribute for property-setter injection, or you may
*__Note__: With Unity you must use the `[Dependency]` attribute for property-setter injection, or you may
optionally configure the strategy to add a Unity extension and remove the attribute requirement. In this case,
all publicly settable properties of a type registered with the container will be build up.*
```C#
var buildUpStrategy = new UnityBuildUpStrategy(container, configurePropertyInjectionExtension: true);
```

### TinyIoC
### [TinyIoC](https://github.com/grumpydev/TinyIoC)
```C#
var container = new TinyIoCContainer();

Expand All @@ -32,6 +32,7 @@ var buildUpStrategy = new TinyIoCBuildUpStrategy(container);

StoryboardInjector.SetUp(buildUpStrategy);
```
*__Note__: Because TinyIoC is not installable as a DLL via [NuGet](http://www.nuget.org) (it is installed as a single C# source file), TinyIoC is included with the DependencySwizzler.TinyIoC [NuGet](http://www.nuget.org) package. If you want to install this package via NuGet, you __cannot__ do so with TinyIoC already installed in your project.*

### Custom
```C#
Expand All @@ -51,7 +52,10 @@ StoryboardInjector.SetUp(viewController => {
```

## Installation
Installation is simplest via NuGet. There are separate packages for the core library and each container implementation. You may also compile the source directly in your project.
Installation is simplest via [NuGet](http://www.nuget.org). There are separate packages for the core library and each container implementation. You may also compile the source directly in your project.
- `Install-Package DependencySwizzler` ([NuGet Page](https://www.nuget.org/packages/DependencySwizzler/))
- `Install-Package DependencySwizzler.Unity` ([Nuget Page](https://www.nuget.org/packages/DependencySwizzler.Unity/))
- `Install-Package DependencySwizzler.TinyIoC` ([Nuget Page](https://www.nuget.org/packages/DependencySwizzler.TinyIoC/))

## License
This project is subject to the MIT license.
25 changes: 25 additions & 0 deletions build/DependencySwizzler.TinyIoC.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<package>
<metadata>
<id>DependencySwizzler.TinyIoC</id>
<version>1.0.0</version>
<title>Dependency Swizzler (TinyIoC)</title>
<authors>James Blair</authors>
<owners>feature[23]</owners>
<copyright>Copyright 2015 feature[23]</copyright>
<description>
A Xamarin iOS library to enable dependency injection of UIViewControllers that use storyboards.
This package provides a default implementation for the TinyIoC container.
</description>
<summary>A Xamarin iOS library to enable dependency injection of UIViewControllers that use storyboards.</summary>
<language>en-US</language>
<projectUrl>https://github.com/feature23/DependencySwizzler</projectUrl>
<licenseUrl>https://raw.githubusercontent.com/feature23/DependencySwizzler/master/LICENSE.md</licenseUrl>
<iconUrl>https://raw.githubusercontent.com/feature23/DependencySwizzler/master/logo.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<tags>dependency swizzler swizzle ios unity tinyioc .net</tags>
</metadata>
<files>
<file src="../src/F23.Mobile.iOS.DependencySwizzler.TinyIoC/bin/release/F23.Mobile.iOS.DependencySwizzler.TinyIoC.dll" target="lib" />
</files>
</package>
28 changes: 28 additions & 0 deletions build/DependencySwizzler.Unity.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<package>
<metadata>
<id>DependencySwizzler.Unity</id>
<version>1.0.0</version>
<title>Dependency Swizzler (Unity)</title>
<authors>James Blair</authors>
<owners>feature[23]</owners>
<copyright>Copyright 2015 feature[23]</copyright>
<description>
A Xamarin iOS library to enable dependency injection of UIViewControllers that use storyboards.This package provides a default implementation for the Microsoft Unity container.
</description>
<summary>A Xamarin iOS library to enable dependency injection of UIViewControllers that use storyboards.</summary>
<language>en-US</language>
<projectUrl>https://github.com/feature23/DependencySwizzler</projectUrl>
<licenseUrl>https://raw.githubusercontent.com/feature23/DependencySwizzler/master/LICENSE.md</licenseUrl>
<iconUrl>https://raw.githubusercontent.com/feature23/DependencySwizzler/master/logo.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<tags>dependency swizzler swizzle ios unity tinyioc .net</tags>
<dependencies>
<dependency id="CommonServiceLocation" version="1.0.0" />
<dependency id="Unity" version="3.5.1404.0" />
</dependencies>
</metadata>
<files>
<file src="../src/F23.Mobile.iOS.DependencySwizzler.Unity/bin/release/F23.Mobile.iOS.DependencySwizzler.Unity.dll" target="lib" />
</files>
</package>

0 comments on commit f46ea23

Please sign in to comment.