Skip to content
This repository has been archived by the owner on Aug 24, 2019. It is now read-only.

Commit

Permalink
Fix shadowsHidden bug
Browse files Browse the repository at this point in the history
  • Loading branch information
soffes committed Jul 2, 2013
1 parent 784b5fd commit 4d7f792
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
24 changes: 12 additions & 12 deletions SAMWebView.podspec
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Pod::Spec.new do |s|
s.name = 'SAMWebView'
s.version = '0.1.0'
s.authors = {'Sam Soffes' => 'sam@soff.es'}
s.homepage = 'https://github.com/soffes/SAMWebView'
s.summary = 'Push UIWebView to its limits.'
s.source = {:git => 'https://github.com/soffes/SAMWebView.git', :tag => 'v0.1.0'}
s.license = { :type => 'MIT', :file => 'LICENSE' }
Pod::Spec.new do |spec|
spec.name = 'SAMWebView'
spec.version = '0.1.1'
spec.authors = {'Sam Soffes' => 'sam@soff.es'}
spec.homepage = 'https://github.com/soffes/SAMWebView'
spec.summary = 'Push UIWebView to its limits.'
spec.source = {:git => 'https://github.com/soffes/SAMWebView.git', :tag => "v#{spec.version}"}
spec.license = { :type => 'MIT', :file => 'LICENSE' }

s.platform = :ios
s.requires_arc = true
s.frameworks = 'UIKit'
s.source_files = 'SAMWebView'
spec.platform = :ios
spec.requires_arc = true
spec.frameworks = 'UIKit'
spec.source_files = 'SAMWebView'
end
8 changes: 5 additions & 3 deletions SAMWebView/SAMWebView.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ @interface SAMWebView ()

@implementation SAMWebView

@synthesize shadowsHidden = _shadowsHidden;

#pragma mark - NSObject

- (void)dealloc {
Expand Down Expand Up @@ -201,18 +203,18 @@ - (void)setBackgroundColor:(UIColor *)color {


- (void)setShadowsHidden:(BOOL)hide {
if (self.shadowsHidden == hide) {
if (_shadowsHidden == hide) {
return;
}

self.shadowsHidden = hide;
_shadowsHidden = hide;

// Thanks @flyosity http://twitter.com/flyosity/status/17951035384
for (UIView *view in [self.webView subviews]) {
if ([view isKindOfClass:[UIScrollView class]]) {
for (UIView *innerView in [view subviews]) {
if ([innerView isKindOfClass:[UIImageView class]]) {
innerView.hidden = self.shadowsHidden;
innerView.hidden = _shadowsHidden;
}
}
}
Expand Down

0 comments on commit 4d7f792

Please sign in to comment.