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

Objective-C compatibility #19

Closed
wants to merge 2 commits into from
Closed

Objective-C compatibility #19

wants to merge 2 commits into from

Conversation

felipowsky
Copy link
Contributor

  • Objective-C compatibility
  • Optional delegate functions

…viewcontroller extendedlayoutincludesopaquebars
@joshwalker
Copy link
Contributor

It would be better to implement a protocol extension that has implementations of the delegate methods that don't do anything. That way you can override them if you want. Lets keep the @objc out of our Swift code. Unfortunately there isn't much you can do on the Enum.

@@ -56,6 +56,9 @@ public class HidingNavigationBarManager: NSObject, UIScrollViewDelegate, UIGestu
if viewController.navigationController == nil || viewController.navigationController?.navigationBar == nil {
fatalError("ViewController must be within a UINavigationController")
}

viewController.extendedLayoutIncludesOpaqueBars = true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a separate issue from ObjC compatibility, and should be split into it's own PR/issue.

@tristanhimmelman
Copy link
Owner

I agree with the comments @joshwalker made above.

@felipowsky
Copy link
Contributor Author

I've removed extendedLayoutIncludesOpaqueBars from this pull request.

I think using optional has the same effect of what @joshwalker suggested.
The use of ? for optional functions on Swift 2 doesn't require extra implementation or checking. Also it is clearer whether a delegate function is optional or not which in my opinion results in cleaner code.

Is there any reason for not using @objc and for using Enum:String instead of a Enum:Int?

I will guess you don't want to limit Swift's capabilities with Objective-C compatibility and I understand. I just needed this for my Objective-C project.

@tristanhimmelman
Copy link
Owner

@felipowsky the reason I don't want to include @objc is simply because I prefer to keep this project swift only. Thanks for your PRs

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

3 participants