Skip to content
This repository has been archived by the owner on Nov 18, 2018. It is now read-only.

Commit

Permalink
Merge pull request #2 from Label305/feature_landscape
Browse files Browse the repository at this point in the history
Fixed bug with ViewInPhone
  • Loading branch information
tscheepers committed Aug 29, 2014
2 parents 347b35a + 2b9b5f3 commit 230dbec
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
4 changes: 2 additions & 2 deletions IVPhoneView.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "IVPhoneView"
s.version = "0.2"
s.version = "0.2.1"
s.summary = "Basic view containing an iPhone graphic, in which you can place a screenshot. Can be used for onboarding experiences."

s.description = <<-DESC
Expand All @@ -13,7 +13,7 @@ Pod::Spec.new do |s|
s.license = { :type => 'Apache License, Version 2.0', :file => 'LICENSE' }
s.author = { "Thijs Scheepers" => "thijs@label305.com" }

s.source = { :git => "https://github.com/Label305/IVPhoneView.git", :tag => "0.2" }
s.source = { :git => "https://github.com/Label305/IVPhoneView.git", :tag => "0.2.1" }

s.platform = :ios, '7.0'
s.requires_arc = true
Expand Down
16 changes: 12 additions & 4 deletions IVPhoneView/IVPhoneView.m
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,18 @@ - (void)layoutSubviews
{
[super layoutSubviews];

self.viewInPhone.frame = CGRectMake(self.sideBezzel * 1.25,
self.topBezzel + self.sideBezzel * 0.25,
self.bounds.size.width - self.sideBezzel * 2.25,
self.bounds.size.height - self.sideBezzel * 0.25 - self.topBezzel * 2);
if (self.orientation == IVPhoneViewOrientationLandscape) {
self.viewInPhone.frame = CGRectMake(self.topBezzel,
self.sideBezzel * 1.25 ,
self.bounds.size.width - self.sideBezzel * 0.25 - self.topBezzel * 2,
self.bounds.size.height - self.sideBezzel * 2.25);
} else {
self.viewInPhone.frame = CGRectMake(self.sideBezzel * 1.25,
self.topBezzel + self.sideBezzel * 0.25,
self.bounds.size.width - self.sideBezzel * 2.25,
self.bounds.size.height - self.sideBezzel * 0.25 - self.topBezzel * 2);
}

[self.viewInPhone setNeedsLayout];
[self setNeedsDisplay];
}
Expand Down

0 comments on commit 230dbec

Please sign in to comment.