简体   繁体   中英

How to set an UIView subclass from a framework as a storyboard custom class?

I have an UIScrollView subclass defined in an external framework. If I create instances of this class in code, it works as expected. If I try to set this class as a custom class on an UIScrollView in Scoryboard, it's not listed in available custom classes. If I set it, when I check the object's class it's an UIScrollView (so it doesn't allow to call methods of the subclass).

This happens in a Swift 2.0 project targetting iOS 8.1 (Xcode7) The framework is using Swift 2.0 too and targetting iOS 8.0 The framework is included manually in the project (copy paste + add to Embedded Binaries)

Hope it's clear enough :D

You must specify a module together with class.

In this example we use class MyCustomScrollView from the framework MyScrollViews.framework .

在此输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM