Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Objc header
- @import Realm;
- @interface Profile : RLMObject
- @property NSString *name;
- @end
- RLM_ARRAY_TYPE(Profile)
- @interface Account : RLMObject
- @property RLMArray<Profile *><Profile> *profiles;
- @end
- // generated swift 3 interface
- import Realm
- open class Profile : RLMObject {
- open var name: String!
- }
- public protocol ProfileProtocol : NSObjectProtocol {
- }
- open class Account : RLMObject {
- open var profiles: RLMArray<Profile>!
- }
- // generated swift 4 interface
- import Realm
- open class Profile : RLMObject {
- open var name: String!
- }
- public protocol ProfileProtocol : NSObjectProtocol {
- }
- open class Account : RLMObject {
- open var profiles: (RLMArray<Profile> & ProfileProtocol)!
- }
- // Code failing
- let account = Account()
- let profile = Profile()
- profile.name = "bob"
- account.profiles.add(profile)
- for profile in account.profiles { // Type '(RLMArray<Profile> & ProfileProtocol)!' does not conform to protocol 'Sequence'
- debugPrint(profile)
- }
Add Comment
Please, Sign In to add comment