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

[dev question][help needed] Unable to Resize UIReferenceLibraryView #72

Closed
jktzes opened this issue Mar 9, 2020 · 3 comments
Closed

Comments

@jktzes
Copy link

jktzes commented Mar 9, 2020

Hi Will, I am using the Kotoba app and it's very helpful! I am a newbie to iOS dev so my apologies in advance if I'm asking some stupid questions. I am trying to make the UIReferenceLibraryView smaller so that I can add a search bar on the top. No offense to your design, that's just how I see fit in my read-lookup workflow. I read some documentation on UIReferenceLibraryView and can't find methods to resize the view. Later I noticed that UIReferenceLibraryView inherits from UIViewController, which has a preferredContentSize instance property. Therefore I did something like this:

let dictionaryViewController = UIReferenceLibraryViewController(term: word.text)
dictionaryViewController.preferredContentSize = CGSize(width: 200, height: 300)

However, it won't work. Is this feature possible? If so, could you tell me the right way to do it? If not, could you elaborate on why not? Thanks a lot!

Yuan

@willhains
Copy link
Owner

Hi Yuan, I’m glad you’re enjoying Kotoba.

In the very first version of Kotoba, that’s how it worked. I can’t remember exactly, but I think we changed it precisely because that design no longer worked in iOS. The UIReferenceLibraryViewController doesn’t give many options on how the view is presented, and I think there’s no way to embed it into a view hierarchy.

If you figure out a way to do it, let me know!

@jktzes
Copy link
Author

jktzes commented Mar 12, 2020

Hi Yuan, I’m glad you’re enjoying Kotoba.

In the very first version of Kotoba, that’s how it worked. I can’t remember exactly, but I think we changed it precisely because that design no longer worked in iOS. The UIReferenceLibraryViewController doesn’t give many options on how the view is presented, and I think there’s no way to embed it into a view hierarchy.

If you figure out a way to do it, let me know!

Thanks for the answer! If possible, could you provide more details on how it "precisely no longer worked"? I'm still very new to iOS development so I am currently at the stage where I don't even know how to start to investigate where the limitation you mentioned is.

But also please feel free to ignore this message if you are busy or can't spare time on this matter.

Thanks again for reading this!

@willhains
Copy link
Owner

Hi Yuan, sorry, I can’t remember the details. Perhaps you should ask on StackOverflow?

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

No branches or pull requests

2 participants