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

RM Bug: Custom AppDelegate parent doesn't work #116

Closed
jamonholmgren opened this issue Jun 3, 2013 · 8 comments
Closed

RM Bug: Custom AppDelegate parent doesn't work #116

jamonholmgren opened this issue Jun 3, 2013 · 8 comments
Assignees
Labels
Milestone

Comments

@jamonholmgren
Copy link
Owner

https://twitter.com/codefriar/status/341595361619636225

Need to allow:

class AppDelegate < SomeOtherDelegate
  include PM::DelegateHelper
  def on_load(app, options)
    # ...
  end
end
@jamonholmgren
Copy link
Owner Author

I have a fix for this but it unfortunately is waiting on a RubyMotion bug I just discovered.

https://gist.github.com/jamonholmgren/5700121

Working on a workaround.

@jamonholmgren
Copy link
Owner Author

Workaround implemented in ProMotion 0.7.1.

https://github.com/clearsightstudio/ProMotion/blob/master/lib/ProMotion/delegate/delegate_helper.rb

class AppDelegate < FakeDelegate
  include ProMotion::ScreenTabs
  include ProMotion::SplitScreen if NSBundle.mainBundle.infoDictionary["UIDeviceFamily"].include?("2") # Only with iPad
  include ProMotion::DelegateHelper
  include ProMotion::DelegateNotifications

  def on_load(app, options)
    open HomeScreen.new(nav_bar: true)
  end
end

Working repo:

https://github.com/jamonholmgren/promotion_issue_116

@jamonholmgren
Copy link
Owner Author

@jamonholmgren jamonholmgren reopened this Jun 3, 2013
@jamonholmgren
Copy link
Owner Author

I'd like to make a mixin the standard way to use ProMotion in the AppDelegate.

@jamonholmgren
Copy link
Owner Author

class AppDelegate
  include PM::AppDelegate

  def on_load(app, options)

  end
end

I've had trouble when declaring PM::AppDelegate in the past, so I don't know if this will work.

@ghost ghost assigned jamonholmgren Jun 14, 2013
@jamonholmgren
Copy link
Owner Author

Fixed in the next release of RM.

http://hipbyte.myjetbrains.com/youtrack/issue/RM-159#comment=74-377

jamonholmgren added a commit that referenced this issue Jul 1, 2013
* Fixes issue #116 (custom delegate parent)
* Fixes issue #181 (table cell background)
* Renamed DelegateHelper to DelegateModule
@markrickert
Copy link
Contributor

Can we change the code to no longer have to do this and remove the comments? https://github.com/clearsightstudio/ProMotion/blob/master/lib/ProMotion/delegate/delegate_parent.rb

@markrickert markrickert reopened this May 16, 2015
@jamonholmgren
Copy link
Owner Author

Yeah, let's do that in ProMotion 3.

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

No branches or pull requests

2 participants