mattwyskiel / LicensesKit

A simple way to list third-party licenses in your iOS apps
Other
58 stars 16 forks source link

StringBuilder issue #1

Closed Kowaio closed 9 years ago

Kowaio commented 9 years ago

Hello,

First of all, thanks a lot for this idea and your work on this lib. I'm really sure that it will help me a lot in a near future in order to centralize all the third party libs I use in my apps.

I'm just posting an issue here because I couldn't try your sample. When building I've got an error saying this: NoticesHtmlBuilder.swift:10:8: No such module 'StringBuilder'

I checked and indeed, there is no trace of StringBuilder in the archive.

Since my apps still need to manage iOS 7, I couldn't install it with cocoapods. Do you have any idea regarding this issue? (for your sample app, but also when including headers in iOS 7 projects)

Thanks a lot for your help!

Best regards,

K

mattwyskiel commented 9 years ago

Hi K, thanks for letting me know!

The sample project should now include StringBuilder (it was not checked out; my mistake!) I'll push a new version of the pod today so that pod try would bring in the updated project.

On the issue of OS compatibility: the target for this project is a framework, which is only supported on iOS 8 (a bad design choice by Apple if you ask me). As well, CocoaPods puts swift code into frameworks because swift only supports modules, not static libraries. If you really need to support iOS 7, you would need to copy the files into the target directly. Again, not a design choice by Apple that I agree with, but that's the way it is.

Again, thanks for the input, and enjoy using the library!

Kowaio commented 9 years ago

Hi @mattwyskiel,

Thanks a lot for your answer. I'm glad I was not mistaken regarding StringBuilder.

About iOS 7, yes, I already met a library written in swift (Spring to name it) with the same issue with the need to copy the files into the target. I'll do that with your lib too, no worries :-)

Thanks again for your hard work and your quick response.

Have a nice day!

K

Kowaio commented 9 years ago

Hello again @mattwyskiel,

I'm coming back to you after some tests on your new version 0.0.4.

When building the project on my iPhone 6 8.1.3 device, I've got this rather strange error:

dyld: Library not loaded: @rpath/StringBuilder.framework/StringBuilder Referenced from: /private/var/mobile/Containers/Bundle/Application/A515C838-B4FC-46C9-8CCC-3A6DF222459F/LicensesKitSample-Swift.app/LicensesKitSample-Swift Reason: image not found

However, it is building fine on iPhone 6 simulator. I checked the build settings and everything seems to be in place so I don't really know what the matter is, here.

Second issue, please check the screenshots I took on iPhone 6 simulator below. As you can see, by displaying the Licenses when tapping on Show Licenses in the MainViewController, I've got nothing but a white UIWebView.

screenshot1: http://cl.ly/image/0S441S3V0a2t screenshot2 (while trying to scroll the UIWebView a little bit): http://cl.ly/image/142P3j0J2B0i

Thanks a lot again for your time and work!

Best,

mattwyskiel commented 9 years ago

Thanks for the continued feedback; this is my first library with active users and every piece of feedback helps!

It seems I've not put as much care into my sample project as I should have. :) So last night I completely reworked the sample project to use CocoaPods. Now it shouldn't crash on device (I tested for that.). I pushed a new version of the pod to work well with however you may integrate it: CocoaPods or embedded framework.

As far as the UIWebView issue goes, to be honest I do not know what is going on. I tried hacking and hacking away at the issue last night and nothing worked. I have all the HTML right there (you can see it in the logs); it seems that the UIWebView is having issues with its loadHTMLString() method - that's the only reason I could think of for this issue. Maybe the best way to test the library is to use it in a test project on your own? I don't know; because this library does work in my app Call2Disciple (I will post images of what it looks like as soon as I can).

Kowaio commented 9 years ago

Hello @mattwyskiel,

No worries, really! I know what you mean. I'm currently working on one of my own and I know there will have some trouble at launch for sure! :-)

I've tested 0.0.5 version and it now builds correctly on my device, so I think we can close this thread!

However, the UIWebView still doesn't work. I tried to add the code programmatically in my app (in Obj-c though) but I got the same behavior. I also tried to change the background and text color but no changes. Your hint about loadHTMLString() might be good though. I'll try to make it work in my side sometime and I'll go back to your with a PR if I succeed!

K

mattwyskiel commented 9 years ago

Hi @Kowaio, After some refactoring, I finally managed to get the web view to work -- the trick: WKWebView! Yes, I changed the backing for the LicensesViewController from UIKit to WebKit, and loading HTML via a provided string actually works! Hope this provides true closure for this issue, and you can pod update the library to get the latest version, which includes these changes.