Skip to content

Commit

Permalink
Merge pull request #91 from hyperoslo/improve/iphone-examples
Browse files Browse the repository at this point in the history
Improve: Universal examples
  • Loading branch information
vadymmarkov authored Mar 23, 2017
2 parents 01126ae + 9ad8ced commit 1c1af41
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions Example/Parallax/Parallax.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "no.hyper.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
Expand All @@ -360,6 +361,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "no.hyper.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
Expand Down
5 changes: 3 additions & 2 deletions Example/Parallax/Parallax/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ class ViewController: PresentationController {
// MARK: - Configuration

func configureSlides() {
let font = UIFont(name: "HelveticaNeue", size: 34.0)!
let ratio: CGFloat = UIDevice.current.userInterfaceIdiom == .pad ? 1 : 0.6
let font = UIFont(name: "HelveticaNeue", size: 34.0 * ratio)!
let color = UIColor(hex: "FFE8A9")
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.alignment = NSTextAlignment.center
Expand All @@ -87,7 +88,7 @@ class ViewController: PresentationController {
"The term is derived from the Greek word παράλλαξις (parallaxis), meaning 'alteration'.",
"Nearby objects have a larger parallax than more distant objects when observed from different positions.",
"http://en.wikipedia.org/wiki/Parallax"].map { title -> Content in
let label = UILabel(frame: CGRect(x: 0, y: 0, width: 550, height: 200))
let label = UILabel(frame: CGRect(x: 0, y: 0, width: 550 * ratio, height: 200 * ratio))
label.numberOfLines = 5
label.attributedText = NSAttributedString(string: title, attributes: attributes)
let position = Position(left: 0.7, top: 0.35)
Expand Down
4 changes: 2 additions & 2 deletions Example/Tutorial/Tutorial.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "no.hyper.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = Tutorial;
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = 2;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
Expand All @@ -347,7 +347,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "no.hyper.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = Tutorial;
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = 2;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
Expand Down
3 changes: 2 additions & 1 deletion Example/Tutorial/Tutorial/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
}

func configureSlides() {
let font = UIFont(name: "ArialRoundedMTBold", size: 42.0)!
let ratio: CGFloat = UIDevice.current.userInterfaceIdiom == .pad ? 1 : 0.4
let font = UIFont(name: "ArialRoundedMTBold", size: 42.0 * ratio)!
let color = UIColor.white
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.alignment = .center
Expand Down

0 comments on commit 1c1af41

Please sign in to comment.