Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add public initializer for TMAnimation #355

Merged
merged 1 commit into from
Dec 19, 2018
Merged

Add public initializer for TMAnimation #355

merged 1 commit into from
Dec 19, 2018

Conversation

netspencer
Copy link
Contributor

@netspencer netspencer commented Dec 19, 2018

From the Swift Documentation:

Default Memberwise Initializers for Structure Types

The default memberwise initializer for a structure type is considered private if any of the structure’s stored properties are private. Otherwise, the initializer has an access level of internal.

As with the default initializer above, if you want a public structure type to be initializable with a memberwise initializer when used in another module, you must provide a public memberwise initializer yourself as part of the type’s definition.

This makes it possible to create an instance of TMAnimation from outside the module.

In my app, I am creating a TMBar outside of a TabmanViewController, and in order to call bar.update(for:capacity:direction:animation:), I ned to be able to create an instance of TMAnimation, which is only possible if TMAnimation has a public initializer.

@msaps
Copy link
Member

msaps commented Dec 19, 2018

@netspencer ah yeah good catch, thanks! 😄

@msaps msaps merged commit dc88e20 into uias:master Dec 19, 2018
@msaps
Copy link
Member

msaps commented Dec 19, 2018

Available in Tabman 2.1.0 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants