Swift 3
You need to declare the access level of the RewardHistoryModel
& BaseObject
class & their internal members like functions or variables as public
or open
(open is available in swift 3).
public class BaseObject {
// set member of this class as public that you want to access outside (Project/Framework Level)
}
public class RewardHistoryModel :BaseObject {
// set members as public or open - // open is available in swift 3.
public (or open) var rewardValue : String!
public (or open) var recordedByName : String!
public (or open) var rewardFor : String!
}
As stated in the documentation (The Swift Programming Language - Access Control) :
A public variable cannot be defined as having an internal or private
type, because the type might not be available everywhere that the
public variable is used.
Classes are declared as internal by default, so you have to add the public keyword to make them public.
A similar rule exists for functions as well.
A function cannot have a higher access level than its parameter types and return type, because the function could be used in situations where its constituent types are not available to the surrounding code.