This repository was archived by the owner on Nov 19, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 144
Allowing screen title to be UIImageView #415
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Link to CONTRIBUTING.md file rather than edit.
Conflicts: Gemfile.lock
Contributor
|
Nice! Really good PR. I'm in favor of merging this. 👍 |
Owner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple nitpicky things:
- We should explicitly check whether it's a String, UIView, or UIImage.
- String = what you have in line 60
- UIView =
self.navigationItem.titleView = self.class.send(:get_title) - UIImage = what you have in line 62
- Else =
PM.logger.warn("title expects string, UIView, or UIImage, but #{self.class.send(:get_title).class.to_s} given."
Contributor
Author
|
All set, @jamonholmgren. |
jamonholmgren
added a commit
that referenced
this pull request
Feb 5, 2014
Allowing screen title to be UIImageView
Owner
|
Thanks @forrestgrant !! |
Contributor
|
Wiki? 😁 |
Contributor
Author
|
I'll add it to the Wiki, @markrickert. |
Contributor
|
💖 👍 💖 |
Contributor
Author
|
So it looks like the Should we move it here: # /lib/ProMotion/cocoatouch/view_controller.rb
module ProMotion
class ViewController < UIViewController
# ...
def loadView
super
self.send(:on_load) if self.respond_to?(:on_load)
self.send(:resolve_title) if self.respond_to?(:resolve_title)
end
# ...
end
end |
Owner
|
Ooh, didn't catch that. :/ Another question is if it works to change the title in a method: class HomeScreen < PM::Screen
title UIImage.imageNamed("loading")
def on_load
self.title = UIView.imageNamed("loading_complete")
end |
Contributor
Author
|
I didn't catch it either, until I started writing more robust tests. In any case, I think we have 3 options:
Thoughts? |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.