Skip to content

Commit 23c5d44

Browse files
author
Artsem Lemiasheuski
committed
Add new configurations. Refactor.
1 parent 9d9257e commit 23c5d44

7 files changed

Lines changed: 88 additions & 65 deletions

File tree

OpenDocumentReader.xcodeproj/project.pbxproj

Lines changed: 66 additions & 46 deletions
Large diffs are not rendered by default.

OpenDocumentReader.xcodeproj/xcshareddata/xcschemes/ODR Full.xcscheme

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
</Testables>
4141
</TestAction>
4242
<LaunchAction
43-
buildConfiguration = "Full"
43+
buildConfiguration = "Debug"
4444
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4545
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
4646
launchStyle = "0"
@@ -82,7 +82,7 @@
8282
</AnalyzeAction>
8383
<ArchiveAction
8484
buildConfiguration = "Release"
85-
customArchiveName = "ODR Full"
85+
customArchiveName = "OpenDocumentReader Full"
8686
revealArchiveInOrganizer = "YES">
8787
</ArchiveAction>
8888
</Scheme>

OpenDocumentReader.xcodeproj/xcshareddata/xcschemes/ODR Lite.xcscheme

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@
2323
</BuildActionEntries>
2424
</BuildAction>
2525
<TestAction
26-
buildConfiguration = "Debug"
26+
buildConfiguration = "Debug Lite"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
2929
shouldUseLaunchSchemeArgsEnv = "YES">
3030
<Testables>
3131
</Testables>
3232
</TestAction>
3333
<LaunchAction
34-
buildConfiguration = "Lite"
34+
buildConfiguration = "Debug Lite"
3535
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
3636
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
3737
launchStyle = "0"
@@ -52,7 +52,7 @@
5252
</BuildableProductRunnable>
5353
</LaunchAction>
5454
<ProfileAction
55-
buildConfiguration = "Release"
55+
buildConfiguration = "Release Lite"
5656
shouldUseLaunchSchemeArgsEnv = "YES"
5757
savedToolIdentifier = ""
5858
useCustomWorkingDirectory = "NO"
@@ -69,11 +69,11 @@
6969
</BuildableProductRunnable>
7070
</ProfileAction>
7171
<AnalyzeAction
72-
buildConfiguration = "Debug">
72+
buildConfiguration = "Debug Lite">
7373
</AnalyzeAction>
7474
<ArchiveAction
75-
buildConfiguration = "Release"
76-
customArchiveName = "ODR Lite"
75+
buildConfiguration = "Release Lite"
76+
customArchiveName = "OpenDocumentReader Lite"
7777
revealArchiveInOrganizer = "YES">
7878
</ArchiveAction>
7979
</Scheme>

OpenDocumentReader/AppType.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import Foundation
2+
3+
enum AppType: String {
4+
case full = "at.tomtasche.reader"
5+
case lite = "at.tomtasche.reader.lite"
6+
}

OpenDocumentReader/ConfigurationManager.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ import Foundation
33
struct ConfigurationManager {
44
static let manager = ConfigurationManager()
55

6-
private(set) var configuration: String!
6+
private(set) var configuration: AppType!
77

88
private init () {
9-
if let configuration = Bundle.main.infoDictionary?["Configurations"] as? String {
10-
self.configuration = configuration
11-
}
9+
10+
if let productId = Bundle.main.bundleIdentifier {
11+
configuration = AppType(rawValue: productId.lowercased()) ?? .lite
12+
}
1213
}
1314
}

OpenDocumentReader/DocumentViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class DocumentViewController: UIViewController, DocumentDelegate {
7171
}
7272

7373
func loadBannerAd() {
74-
if ConfigurationManager.manager.configuration == Constants.configurationLite {
74+
if ConfigurationManager.manager.configuration == .lite {
7575
let frame = { () -> CGRect in
7676
if #available(iOS 11.0, *) {
7777
return view.frame.inset(by: view.safeAreaInsets)

OpenDocumentReader/Info.plist

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,8 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5-
<key>GADApplicationIdentifier</key>
6-
<string>ca-app-pub-3940256099942544~1458002511</string>
75
<key>CFBundleDevelopmentRegion</key>
86
<string>$(DEVELOPMENT_LANGUAGE)</string>
9-
<key>CFBundleDisplayName</key>
10-
<string>OpenDocument Reader</string>
117
<key>CFBundleDocumentTypes</key>
128
<array>
139
<dict>
@@ -56,8 +52,8 @@
5652
<string>$(MARKETING_VERSION)</string>
5753
<key>CFBundleVersion</key>
5854
<string>$(CURRENT_PROJECT_VERSION)</string>
59-
<key>Configurations</key>
60-
<string>$(CONFIGURATION)</string>
55+
<key>GADApplicationIdentifier</key>
56+
<string>ca-app-pub-3940256099942544~1458002511</string>
6157
<key>LSRequiresIPhoneOS</key>
6258
<true/>
6359
<key>UILaunchStoryboardName</key>

0 commit comments

Comments
 (0)