Skip to content

Commit eff00e2

Browse files
committed
Add intro.
1 parent 5116af2 commit eff00e2

20 files changed

Lines changed: 414 additions & 3 deletions

OpenDocumentReader/AppDelegate.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
7171

7272
return true
7373
}
74+
75+
/// Set orientations you want to be allowed in this property by default
76+
var orientationLock = UIInterfaceOrientationMask.all
77+
78+
func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
79+
return self.orientationLock
80+
}
7481
}
7582

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
//
2+
// AppUtility.swift
3+
// OpenDocumentReader
4+
//
5+
// Created by Artsem Lemiasheuski on 19.12.19.
6+
// Copyright © 2019 Thomas Taschauer. All rights reserved.
7+
//
8+
9+
import Foundation
10+
import UIKit
11+
12+
struct AppUtility {
13+
14+
static func lockOrientation(_ orientation: UIInterfaceOrientationMask) {
15+
16+
if let delegate = UIApplication.shared.delegate as? AppDelegate {
17+
delegate.orientationLock = orientation
18+
}
19+
}
20+
21+
/// Added method to adjust lock and rotate to the desired orientation
22+
static func lockOrientation(_ orientation: UIInterfaceOrientationMask, andRotateTo rotateOrientation:UIInterfaceOrientation) {
23+
24+
self.lockOrientation(orientation)
25+
26+
UIDevice.current.setValue(rotateOrientation.rawValue, forKey: "orientation")
27+
UINavigationController.attemptRotationToDeviceOrientation()
28+
}
29+
30+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"version" : 1,
4+
"author" : "xcode"
5+
}
6+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"filename" : "onboard1@1x.png",
6+
"scale" : "1x"
7+
},
8+
{
9+
"idiom" : "universal",
10+
"filename" : "onboard1@2x.png",
11+
"scale" : "2x"
12+
},
13+
{
14+
"idiom" : "universal",
15+
"filename" : "onboard1@3x.png",
16+
"scale" : "3x"
17+
}
18+
],
19+
"info" : {
20+
"version" : 1,
21+
"author" : "xcode"
22+
}
23+
}
122 KB
Loading
277 KB
Loading
496 KB
Loading
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"filename" : "onboard2@1x.png",
6+
"scale" : "1x"
7+
},
8+
{
9+
"idiom" : "universal",
10+
"filename" : "onboard2@2x.png",
11+
"scale" : "2x"
12+
},
13+
{
14+
"idiom" : "universal",
15+
"filename" : "onboard2@3x.png",
16+
"scale" : "3x"
17+
}
18+
],
19+
"info" : {
20+
"version" : 1,
21+
"author" : "xcode"
22+
}
23+
}
231 KB
Loading
534 KB
Loading

0 commit comments

Comments
 (0)