I'm accustomed to using Autofac and with autofac with one line of code I can register all the interfaces in the assembly so that they resolve to whatever classes implement that interface.
In Unity it's looking like I need to register every interface manually. I'm wondering if there is a simpler way to globally register everything, then for lifecycle differences create individual entries.
thanks
There isn't in Unity 2.
There are however contrib projects that try to add this behavior on top of Unity, such as:
Unity Auto Registration
Unity Contrib project
TecX
UPDATE
Unity 3 seems to be just released that contains support for batch-registration.
Unity 3 now supports auto-registration.
Related
Is it possible to create a framework which only works on a specified app bundle identifier?
I want to prevent to reuse ur framework by shipping out my app source code / project which is using a selfmade framework
If you ship source code, you cannot prevent the code from being reused. If you want to ship the compiled framework, you can use the approach described in the answer of Reinier Melian.
You could also consider creating a pure library instead of a framework. See here and here for the differences.
I've got an iOS dynamic framework written in Swift and would like to know what ways I can "export" the framework for use in external projects, while leaving the implementation unexposed.
The "best" solution I've come across so far is from this article, but for some reason autocompletion stops working when I'm trying to use classes from the framework in a project.
Right now I'm using a Xcode workspace to use the framework within a project. However, as mentioned I don't want to have the implementation exposed.
I understand that Swift doesn't have separate interface and implementation files found in Objective-C, but am just curious as to how other people approach this.
I am fairly new to iOS and XCode and come from .Net background. So in Visual Studio I would usually separate the layers of my application (say WebApp layer, business logic layer, data access layer etc.) into separate project so I can have control over what each project depends on etc.
So my question is if there is something similar in XCode? I tried using the static library template for a target and it seems to be working but I am wondering if there are any drawbacks for this approach? All the examples I find on the Internet just show a folder structure in the app target for the layers is this the preferred way of doing it and why?
I am also using Swift if that makes any difference but I still do have dependencies on 3rd party libraries developed in Objective-C
New in Xcode 6 / iOS 8, you can make a framework, thus dividing your code into multiple targets. This is a nice easy way to separate reusable functionality. It also has the advantage of privacy; in Swift, each framework is a module, and one module that imports another module can see only those members of the imported module that are declared public.
In general, however, I would suggest that you not worry about this; just keep your classes organized conceptually using the MVC architecture that Cocoa encourages, and physically organize them within your project using "groups" (the fake folders that appear in Xcode's project navigator). The reason is that very little of your code is going to prove to be reusable anyway, so it's really just a matter of making editing / developing / maintaining this project as easy as possible.
I'm developing an App with Xamarin.Android (aka MonoDroid), using the great MvvmCross Framework. The application uses Fragments, and need an ActionBar.
I've noticed that the MvxFragmentActivity inherits from MvxEventSourceFragmentActivity, and this last inherits from FragmentActivity, which has no ActionBar support. To support ActionBar, i need a class that inherits from ActionBarActivity, wich is included in the Support Library, and inherits from FragmentActivity.
So, my question is: Is there any MvvmCross class that Inherits from ActionBarActivity?
If not,
Can I just create a MvxEventSourceActionBarActivity and a MvxActionBarActivity that inherits from the first one, with just the same code of the MvxEventSourceFragmentActivity and MvxFragmentActivity just changing the inherits?
The basic answer is "No. There's no existing class. But I f you want to add binding to any Activity, then you can do so using 2 layers of inheritance - adding first an eventsource and then an Mvx layer"
There is a bit more detail about this in a few questions - eg ActionBarSherlock with latest MVVMCross
For the latest android support library, there is one issue to be aware of currently - when building binaries you currently either have to choose the mono library which gives you compatibility with play services or you have to choose the new Xamarin component which gives you the latest support lib - see MvvmCross - trying to use Fragments AND latest support lib results in linking problems and https://bugzilla.xamarin.com/show_bug.cgi?id=15205
I have a question. Is it possible to load unity project from web, and show it in Xcode project? In some non-fullscreen view? Also, unity must handle touch events. Any ideas, suggestions, links or anything else?
Thanks for advice.
P.S. Sorry for my english.
P.P.S. Main project created in Xcode, without unity.
load unity project from web
What do you mean by that? If you mean a compiled unity webplayer application, forget it.
If you mean a standard non compiled Unity project, note that with the iOS plugin you can compile for mobile Apple hardware. This used to cost a lot of money but now they're giving it out for free (included in Unity free).
Also, unity must handle touch events.
The standard Input Unity class handles touch events with methods such as GetTouch() and variables like touchCount or touches.
Unity is a very big and complex package: integrating it into an existing project may be overwhelmingly difficult. I really don't think there are natives way to do so.
Rather, I'd advise you to port your current XCode project into Unity (which sounds a really strange thing to do if you ask me).
Unity and XCode are 2 completely different tools: the former is useful for Cocoa classes and iOS IDE while the latter is for managing 3d game assets in a real-time interactive environment. I don't see how you can possibly integrate the two things.
Manage your project in a single IDE, it will make things a lot simpler.