forked from layoutBox/PinLayout
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Luc Dion
committed
Mar 19, 2018
1 parent
2d504e1
commit e5334c2
Showing
38 changed files
with
944 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+5.71 KB
...LayoutSample/Supporting Files/Assets.xcassets/SafeArea/Arrow.imageset/Arrow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions
21
...le/PinLayoutSample/Supporting Files/Assets.xcassets/SafeArea/Arrow.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "Arrow.png", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...LayoutSample/Supporting Files/Assets.xcassets/SafeArea/ArrowCorner.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "arrow_corner_tl.png", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Binary file added
BIN
+16.9 KB
...porting Files/Assets.xcassets/SafeArea/ArrowCorner.imageset/arrow_corner_tl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions
23
.../PinLayoutSample/Supporting Files/Assets.xcassets/SafeArea/Barcode.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "icon_scan barcode_white.png", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "icon_scan [email protected]", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "icon_scan [email protected]", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Binary file added
BIN
+198 Bytes
...ing Files/Assets.xcassets/SafeArea/Barcode.imageset/icon_scan barcode_white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+302 Bytes
... Files/Assets.xcassets/SafeArea/Barcode.imageset/icon_scan [email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+419 Bytes
... Files/Assets.xcassets/SafeArea/Barcode.imageset/icon_scan [email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.4 KB
...youtSample/Supporting Files/Assets.xcassets/SafeArea/Center.imageset/Center.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions
21
...e/PinLayoutSample/Supporting Files/Assets.xcassets/SafeArea/Center.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "Center.png", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
Example/PinLayoutSample/Supporting Files/Assets.xcassets/SafeArea/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
...inLayoutSample/Supporting Files/Assets.xcassets/SafeArea/IconOrder.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "IconPickupLarge.png", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "[email protected]", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "[email protected]", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Binary file added
BIN
+2.13 KB
...upporting Files/Assets.xcassets/SafeArea/IconOrder.imageset/IconPickupLarge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.87 KB
...orting Files/Assets.xcassets/SafeArea/IconOrder.imageset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+7.56 KB
...orting Files/Assets.xcassets/SafeArea/IconOrder.imageset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions
23
...ple/PinLayoutSample/Supporting Files/Assets.xcassets/SafeArea/Tab1.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "icon orders.png", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "icon [email protected]", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "icon [email protected]", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Binary file added
BIN
+478 Bytes
...tSample/Supporting Files/Assets.xcassets/SafeArea/Tab1.imageset/icon orders.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+823 Bytes
...mple/Supporting Files/Assets.xcassets/SafeArea/Tab1.imageset/icon [email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.28 KB
...mple/Supporting Files/Assets.xcassets/SafeArea/Tab1.imageset/icon [email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions
23
...ple/PinLayoutSample/Supporting Files/Assets.xcassets/SafeArea/Tab2.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "IconBin.png", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "[email protected]", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "[email protected]", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Binary file added
BIN
+477 Bytes
...ayoutSample/Supporting Files/Assets.xcassets/SafeArea/Tab2.imageset/IconBin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+987 Bytes
...utSample/Supporting Files/Assets.xcassets/SafeArea/Tab2.imageset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.57 KB
...utSample/Supporting Files/Assets.xcassets/SafeArea/Tab2.imageset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93 changes: 93 additions & 0 deletions
93
Example/PinLayoutSample/UI/Examples/SafeArea/SafeAreaCornersView.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
// Copyright (c) 2017 Luc Dion | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in | ||
// all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
// THE SOFTWARE. | ||
|
||
import UIKit | ||
import PinLayout | ||
|
||
class SafeAreaCornersView: UIView { | ||
fileprivate let safeAreaZoneView = UIView() | ||
|
||
fileprivate let centerImageView = UIImageView(image: UIImage(named: "Center")!) | ||
|
||
// Corners | ||
fileprivate let topLeftImageView = UIImageView(image: UIImage(named: "ArrowCorner")!) | ||
fileprivate let topRightImageView = UIImageView(image: UIImage(named: "ArrowCorner")!) | ||
fileprivate let bottomRightImageView = UIImageView(image: UIImage(named: "ArrowCorner")!) | ||
fileprivate let bottomLeftImageView = UIImageView(image: UIImage(named: "ArrowCorner")!) | ||
|
||
// Edges | ||
fileprivate let topImageView = UIImageView(image: UIImage(named: "Arrow")!) | ||
fileprivate let rightImageView = UIImageView(image: UIImage(named: "Arrow")!) | ||
fileprivate let bottomImageView = UIImageView(image: UIImage(named: "Arrow")!) | ||
fileprivate let leftImageView = UIImageView(image: UIImage(named: "Arrow")!) | ||
|
||
init() { | ||
super.init(frame: .zero) | ||
backgroundColor = .white | ||
|
||
safeAreaZoneView.backgroundColor = UIColor.black.withAlphaComponent(0.2) | ||
addSubview(safeAreaZoneView) | ||
|
||
addSubview(centerImageView) | ||
|
||
addSubview(topLeftImageView) | ||
topRightImageView.transform = .init(rotationAngle: CGFloat.pi / 2) | ||
addSubview(topRightImageView) | ||
bottomRightImageView.transform = .init(rotationAngle: CGFloat.pi) | ||
addSubview(bottomRightImageView) | ||
bottomLeftImageView.transform = .init(rotationAngle: CGFloat.pi * 3 / 2) | ||
addSubview(bottomLeftImageView) | ||
|
||
addSubview(topImageView) | ||
rightImageView.transform = .init(rotationAngle: CGFloat.pi / 2) | ||
addSubview(rightImageView) | ||
bottomImageView.transform = .init(rotationAngle: CGFloat.pi) | ||
addSubview(bottomImageView) | ||
leftImageView.transform = .init(rotationAngle: CGFloat.pi * 3 / 2) | ||
addSubview(leftImageView) | ||
} | ||
|
||
required init?(coder aDecoder: NSCoder) { | ||
super.init(coder: aDecoder) | ||
} | ||
|
||
override func safeAreaInsetsDidChange() { | ||
if #available(iOS 11.0, *) { | ||
super.safeAreaInsetsDidChange() | ||
} | ||
} | ||
|
||
override func layoutSubviews() { | ||
super.layoutSubviews() | ||
|
||
safeAreaZoneView.pin.all(pin.safeArea) | ||
|
||
centerImageView.pin.center().size(40) | ||
|
||
topRightImageView.pin.top(pin.safeArea).right(pin.safeArea).size(40) | ||
topLeftImageView.pin.top(pin.safeArea).left(pin.safeArea).size(40) | ||
bottomRightImageView.pin.bottom(pin.safeArea).right(pin.safeArea).size(40) | ||
bottomLeftImageView.pin.bottom(pin.safeArea).left(pin.safeArea).size(40) | ||
|
||
topImageView.pin.top(pin.safeArea).hCenter().size(40) | ||
rightImageView.pin.right(pin.safeArea).vCenter().size(40) | ||
bottomImageView.pin.bottom(pin.safeArea).hCenter().size(40) | ||
leftImageView.pin.left(pin.safeArea).vCenter().size(40) | ||
} | ||
} |
Oops, something went wrong.