Giter VIP home page Giter VIP logo

towebviewcontroller's Issues

Wrong to add one more TabBar :(

When I was at the top of the TabBarController, there was TabBar. Then I use the following code:

TOWebViewController *webViewController = [[TOWebViewController alloc] initWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",kHostURLString,@"jr_abouts.html"]]];
webViewController.title = @"产品介绍";
webViewController.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:webViewController animated:YES];

Pop hand gesture to return to half, and then I cancel the pop gesture, stay in the TOWebViewController, it occurs Bug.
My TabBarController is wrong to add one more TabBar.

Preserve Application Buttons (e.g. Left Menu hamburger button)

Hi,
I have found your pod quite easy to use, but I am facing some issues when it comes to using it within app which is based on Left Menu navigation (e.g. https://github.com/gotosleep/JASidePanels )

The case is that I want to use TOWebViewcontroller wrapped in UINavigationController and still show Menu hamburger button as the leftBarButtonItem so that user could open menu still.

I have tried adding my hamburger button to the applicationBarButtonItems but then it goes to the toolbar.

Update podspec file

Hi, I noticed the podspec file is not the latest version. The master branch has fixed some bugs, please update the podspec file, thank you very much.

Russian and ukranian localizations are located at wrong path

Hi!

Directories for ru.lproj and uk.lproj are located inside of en.lproj directory, so these localizations don't work.
I would also suggest to use initWithBarButtonSystemItem:UIBarButtonSystemItemDone for Done button. It will use system localization for 'Done' text, so no localization is needed on iOS 6+, while UI looks the same.

Error when using tab bar controller

Hi When i use a standard tab bar the towebviecontrooler loads fine... However if i use a storyboard tabbar controller i get the following error.

Can you assist?

screen shot 2015-10-02 at 10 09 49 pm

Communications error

When I tap action button, my app crash. It also happens in example app.

My ios version is 8.1.2, and my xcode version is 6.1.1.

Test my app on iphone 5.

screenshot 2014-12-16 10 21 56

there is not way to use webViewDidFinishLoad

i want to add a JSContext to webview in webViewDidFinishLoad function,but there is no way to implementation this method,Can you add a block like shouldStartLoadRequestHandler?thank you

Conflict with any localization in the main app.

When using TOWebViewController via CocoaPods, the lproj directories are copied to the root of the main bundle. This causes two issues:

  1. They conflict with any localization in the main app.
  2. The App Store detects these localized bundles and assumes the app is fully localized into all 6 languages TOWebViewController supports (de, en, es, ja, ko, pl, ..). We only support German.

This is a real problem. I think best idea for pods is to use ressource_bundles instead of resources. http://guides.cocoapods.org/syntax/podspec.html#resource_bundles

iOS 8 Support

_NDA Disclaimer: In case you hadn't heard, Apple is not enforcing a Non-Disclosure Agreement on code changes and new APIs in the iOS beta releases this time around. While we're not allowed to post screenshots of iOS 8, or release any review-style articles, we ARE allowed to discuss these sorts of code changes publicly._

I'm going to post this issue and leave it open for the time being, since I think I can guarantee that other developers might be wondering about this.

If you haven't watched the WWDC session videos on Cocoa Touch and UIKit yet, you might be surprised to learn that Apple has decided to completely overhaul the iOS paradigm when it comes to the UI handling device rotations. No longer does the code recognise the concept of 'portrait' or 'landscape' orientation modes, but they now simply treat these events as the UI's boundary sizes changing.

Because of this new design paradigm in iOS 8, a LOT of the internal animation code behind UIView and UIViewController appears to have been modified, so much so that a lot of the assumptions I had made when developing TOWebViewController for iOS 6 and iOS 7 no longer directly apply.

After testing the last build of TOWebViewController in one of my own apps running iOS 8, I discovered that the rotation code was causing the app to crash. I also noticed that the 'snapshot' image displayed when the device is rotated also stopped displaying. I spent a little time this evening and was able to fix the crash, and get the majority of the snapshot animations working properly again on iOS 8, although they sometimes don't match up properly. Those fixes are now pushed to this library, but not submitted to CocoaPods yet.

In any case, given past iOS beta releases, it's pretty likely that iOS 8 will undergo a pretty heavy set of revisions before it is finally released to the public, so it's probably not worth trying to perfect the class for iOS 8 just yet. As such, I'm going to hold off from any more iOS 8 'fixes' in the codebase until iOS 8 goes gold.

Either way, if you're using TOWebViewController in one of your apps, and are starting to test for iOS 8, this is something to be aware of. :)

Happy coding!

iOS 9 App transport security

Hi;

I could not get it work with iOS 9. It was working fine when I was compiling with base iOS 8. But the new security changes for iOS 9 has broken my current implementation.

When I tried to open a page it gives the error below.

App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.

I've added the property below to my plist file it also didn't help.

    <key>NSAllowArbitraryLoads</key>
    <true/>

Do you have any idea about this problem?

Typo in readme

Hey there,

Thanks for the lib. Looks great and excited to use it.
Want to let you know about a minor typo.

TOWebViewController *webViewController = [[TOWebViewController alloc] initWithURL:[NSURL URLWithString:@"http://www.apple.com/"];

should be

TOWebViewController *webViewController = [[TOWebViewController alloc] initWithURL:[NSURL URLWithString:@"http://www.apple.com/"]];

Suppress iOS8 detection warning when using cocoapods

When using the cocoapod, I noticed that there are compiler warnings due to some detection in TOWebViewController.m for the new iOS8 device rotation system. The macro checks if UIViewController responds to the new selector viewWillTransitionToSize:withTransitionCoordinator:, which raises the warning

"TOWebViewController.m:1519:9: Undeclared selector 'viewWillTransitionToSize:withTransitionCoordinator:'" where the NEW_ROTATIONS identifier is used.

I don't see this warning when I download the source and use the demo project. I also don't see it when using Xcode6-beta, so I'm wondering if this may be an Xcode5 bug or something else.

To test, create a single view app, pod install TOWebViewController as usual, then import TOWebViewController.h in your view controller implementation file. Build with Xcode5 targeting 7.1 and you should see the warnings.

For what it's worth, maybe a better option is replacing the macro with:

#define NEW_ROTATIONS   ([[UIViewController class] instancesRespondToSelector:NSSelectorFromString(@"viewWillTransitionToSize:withTransitionCoordinator:")])

which creates the selector at runtime instead instead of compile time, which suppresses the warning(s).

WrongTitle when come back from other View Controller

I push a view controller from TOWebViewController, and then pop to TOWebViewController, the title becomes "Loading...", actually, the web view is completed!

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];

    //Show placehodler title until we work out the new one
    [self showPlaceholderTitle]; //<===== wrong here 
    ...
}

- (void)showPlaceholderTitle
{
    //set the title to the URL until we load the page properly
    if (self.url && self.showPageTitles && self.showUrlWhileLoading) {
        NSString *url = [_url absoluteString];
        url = [url stringByReplacingOccurrencesOfString:@"http://" withString:@""];
        url = [url stringByReplacingOccurrencesOfString:@"https://" withString:@""];
        self.title = url;
    }
    else if (self.showPageTitles) {

    //===== wrong here ======
    //you should check the current page real status
        self.title = NSLocalizedStringFromTable(@"Loading...", @"TOWebViewControllerLocalizable", @"Loading...");
    //===== wrong here ======
    }
}

When I learned your WebView before the call to the getview method in the push, will lead to premature call loadview and viewwillload, self.navigationController at this time of nil, so it will bring a lot of dependencies in navigationController whether the empty allocation failure

When I learned your WebView before the call to the getview method in the push, will lead to premature call loadview and viewwillload, self.navigationController at this time of nil, so it will bring a lot of dependencies in navigationController whether the empty allocation failure

Navigation toolbar not hiding properly

I'm using this (awesome) viewcontroller but I need to hide the toolbar in some cases. Doing something like this will hide the buttons but the toolbar stays there.

TOWebViewController *controller = [[TOWebViewController alloc] initWithURLString:webpageUrl];
controller.navigationButtonsHidden = YES;
[[self navigationController] pushViewController:controller animated:YES];

I dived in the code and saw that the navigationButtonsHidden setter tries to hide the toolbar but it makes it before viewwillappear so when viewwillappear gets called, the toolbar will show again (empty).

Doing it like this (dispathing it in the next update cycle) works but it's not ideal.

TOWebViewController *controller = [[TOWebViewController alloc] initWithURLString:webpageUrl];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
    controller.navigationButtonsHidden = YES;
});
[[self navigationController] pushViewController:controller animated:YES];

part of screen is black while initialize and load request

I found this problem. when i run demo app on iOS simulator,it can load request at first time appear.
Network environment: 100% lost,make sure it waiting until time out.
Result: contentSize of UIWebView not equal CGSizeZero, I swipe to bottom, found bottom part of screen is display black .
thank you.

iOS7 deprecations

Hi Tim,
Getting a lot of warnings about depracations on iOS7.1 and Xcode 5.1

Planning on upgrading this or are these a necessary evil to keep backwards compatibility?

TabBar error

if the web view add interactivePopGestureRecognizer , when view back with popGesture again , the property navigationButtonsHidden set is the tabbar title is hidden ,but the tabbar is not hidden. how to reslut this . the error image like this .
bug gif Image
this is test demo, the bug.gif is the error gif image , you can look it

Toolbar Not Hiding

I've been getting a bug sporadically where after poping the web view controller the toolbar is still there.

Please update Pod.

The current Pod release doesn't match the repo.
Please update the Pod. Thanks.

Thoughts on allowing NSURLRequest to be modified?

I have a scenario where I need to pass a HTTP header with a request. (It's an oauth bearer token)

Normally, I would make a mutable request and then use the built in methods for adding header fields, but TOWebViewController doesn't seem to expose the request in a manner that I can modify.

I'm posting this more for discussion than anything. What are your thoughts on adding methods to enable exposing the request?

Best way to implement interstitialPresentationPolicy

Hi,

Is there a way to implement interstitialPresentationPolicy = ADInterstitialPresentationPolicyAutomatic; for iAd?

Is it ok to do this:

TOWebViewController *webViewController = [[TOWebViewController alloc] initWithURL:@"url"];

        webViewController.interstitialPresentationPolicy = ADInterstitialPresentationPolicyAutomatic;

        [self presentViewController:[[UINavigationController alloc] initWithRootViewController:webViewController] animated:YES completion:^{
            NSLog(@"presentViewController");
        }];

Because this way it only happens once, and the other times I try to open other links it won't display the iAd Interstitial. I am not sure if this is the development issue that Interstitial is not ready or is there a better place to set the interstitialPresentationPolicy.

Thanks

TOWebViewControllerDelegate?

Hi, I wish you can design TOWebViewControllerDelegate, so we can hook on webView: shouldStartLoadWithRequest:navigationType method to implement JS-to-cocoa bridge features ourselves.

In some webs, NetworkActivityIndicator is always Visible

In some webs, NetworkActivityIndicator is always Visible.

There seems to be something wrong when checking whether a url is redirected which leads to not call finishLoadProgress finally.

    BOOL isNotRedirect = self.url && [self.url isEqual:self.webView.request.mainDocumentURL];

Nav bar is always visible.

I've been pushing the TOWebViewController on a UINavigationController and the hideNavBarOnClose is always NO. When I change the stack of view controllers (wanting to keep the web view in memory - but not in view) the toolbar at the bottom remains visible gray and no buttons.

Can you think of a way that I'm mis-using this and can get this control to hide the navbar at the bottom when the viewWillDisappear runs?

Create subspecs/pod for Chrome/Safari UIActivities

These would be super useful to have as subspecs (or as a separate Pod entirely that TOWebViewController depends on) for those who just need the Chrome/Safari UIActivitys without the custom web view controller. They seem to be some pretty solid implementations with some great icons as well. Good work!

load automatically fin view controller

Hi... I am having a little problem as i am new to this. I simply want to hardcode the url in a view controller and when i access the view controller it loads the url automatically. I don't want to have a page before with a tableview that when i click the page loads.

How do i do this?

navigationController.navigationBar becomes visible after leaving the TOWevViewController

Hello there!
Thanx for the amazing tool you've created
Please take a look at a small problem I've confronted

- (void)viewDidLoad
{
    [super viewDidLoad];

    if (self.navigationController) {
        self.hideToolbarOnClose = self.navigationController.toolbarHidden;
        self.hideNavBarOnClose  = self.navigationBar.hidden;
    }
...

In some rare cases it may occur, that viewDidLoad gets called before the view controller gets inserted in the navigation controller's stack. This will cause the toolbar to appear after the view disappears

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];

    if (self.beingPresentedModally == NO) {
        [self.navigationController setToolbarHidden:self.hideToolbarOnClose animated:animated];
        [self.navigationController setNavigationBarHidden:self.hideNavBarOnClose animated:animated];
    }
}

Could you please move your code

    if (self.navigationController) {
        self.hideToolbarOnClose = self.navigationController.toolbarHidden;
        self.hideNavBarOnClose  = self.navigationBar.hidden;
    }

to the viewWillAppear: method ?

Thanx in advance

Landscape support for portrait app

Hi,

My app is only working in one orientation (portrait). This is how the app is designed, however when the url is opened by TOWebViewController I don't mind user rotate the device to landscape especially when the webpage contains video.

At the moment it only displays the portrait orientation (even when the video is playing). Is there a way to set the shouldRotate for TOWebViewController *webViewController before it opens?

Thanks.

ios 7 toolbar

Hi
in ios7 iphone the bottom toolbar appears at the top. both in modal view and navigation view.
also in your example...

Address Bar

Add an address bar for free browsing. Great library, Thanks!

How to avoid navbar background/text overrides?

Hello, I recently tried to plug your control in place of the SVWebViewController. I like the approach this control is taking but I ran into a couple issues I'm not sure how to work around.

  • Issue 1:

    I'm pushing the control onto a UINavigationController where I'd like the background and text colors to remain the same (as were previously there). It seems like this control is plugging it's own style onto it. Can this be done?

  • Issue 2

    I have a 'hamburger icon' menu for the left navigation bar when it's the first view controller on the stack. How can I get this control to play nice with this scenario? I'd like there to not be a disabled (left/back arrow) and instead display my custom Hamburger Menu icon.

Question on same-origin policy (SOP) across iframes

Does TOWebViewController's webkit implementation allow access to web preferences so that one can disable SOP across iframes that have different origins? Or is it just a view controller built over the standard iOS Webkit library?

Change webView public scope to work with Javascript injection

Ususally, we want to inject javascript to webview for some native/js invokation. Like

[WebViewJavascriptBridge bridgeForWebView:self.webView webViewDelegate:self handler:^(id data, WVJBResponseCallback responseCallback) {
        NSLog(@"ObjC received message from JS: %@", data);
        responseCallback(@"Response for message from ObjC");
    }];

Is that okay to move the

@property (nonatomic,strong)    UIWebView *webView;

to .h ?

Change tab bar tintColor

Am I making a mistake or is it impossible in iOS 7 to change the tintColor of the tab bar buttons?
Would perhaps require to use a real UITabBar?

How to use modalCompletionHandler

Hi Tim,

I found out modalCompletionHandler in doneButtonTapped. Is there any way to use this when I use presentViewController to find out if the TOWebViewController dismissed?

Thakns

Landscape mode

Hi, how use your view controller in landscape mode in a only portrait app?

Toolbar not hide(Cocoapods version 2.0.14)

TOWebViewController *webViewController = [[TOWebViewController alloc] initWithURLString:[@"google.com" stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
webViewController.navigationButtonsHidden = YES;
[[UIViewController currentViewController].navigationController pushViewController:webViewController animated:YES];

The toolbar will not hide in Cocoapods version 2.0.14.
Download the ZIP and add the files into your project. The github version is OK.

Status Bar color

If in your app you have a white status bar when call TOWebViewController status bar is not visible.

In my case i put in TOWebViewController.m viewDidLoad add

[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault];

and in doneButtonTapped

[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];

But maybe is better create a system that check the previous status bar colo and reset it when controller is dismissed

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.