IOS8: how to download xib from Dynamic Framework

I am using Cocoapods 0.36 Preview Release to create and deploy a private dynamic structure in an application bundle. I use the resource attribute to copy xibs and they appear in the application bundle.

s.subspec 'Views' do |ss|
    ...
    ss.resources = ['All/My/Folders/**/*.{xib,png}']
    ...

I am trying to load reusable controls from xibs as follows:

NSBundle.mainBundle().loadNibNamed("MyXib", owner:loader, options:nil)

but this fails, since it cannot find xib in my built-in subsystem. Actual xib (nib) paths follow the pattern: '

./Frameworks/MyPrivateFramework.framework/MyXib.nib

My question is, is there a simple, code agnostic way to download xib that will work when packaged in the iOS 8 infrastructure - or do I need to explicitly hardcode the above path? The above loading code worked until I think the dynamic framework is changing.

thank

+4
1

:

http://artsy.imtqy.com/blog/2015/01/04/cocoapods-and-frameworks/

, :

NSBundle(forClass: ClassInFramework.self)

xib :

NSBundle(forClass: ClassInFramework.self)
    .loadNibNamed("ClassInFramework", owner:loader, options:nil)

.

+16

Source: https://habr.com/ru/post/1570251/


All Articles