Skip to content

Commit

Permalink
added rating logic, updated take a look button
Browse files Browse the repository at this point in the history
  • Loading branch information
misteu committed May 27, 2024
1 parent 04a93fa commit fd1b429
Show file tree
Hide file tree
Showing 7 changed files with 433 additions and 36 deletions.
20 changes: 16 additions & 4 deletions VocabularyTrainer.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
28716F4E290EF54B00EACCA1 /* Coordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28716F4B290EF54B00EACCA1 /* Coordinator.swift */; };
28716F4F290EF54B00EACCA1 /* StoryBoarded.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28716F4C290EF54B00EACCA1 /* StoryBoarded.swift */; };
28716F50290EF54B00EACCA1 /* MainCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28716F4D290EF54B00EACCA1 /* MainCoordinator.swift */; };
4148B09C2C02774F009B29D2 /* TakeLookSwitchButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4148B09B2C02774F009B29D2 /* TakeLookSwitchButton.swift */; };
4148B09E2C0288FB009B29D2 /* RatingAlertHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4148B09D2C0288FB009B29D2 /* RatingAlertHelper.swift */; };
4148B0A02C0289F7009B29D2 /* MailManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4148B09F2C0289F7009B29D2 /* MailManager.swift */; };
41AA7F722B0D3094009DE4E9 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 41AA7F712B0D3094009DE4E9 /* Localizable.xcstrings */; };
B3606D1D294D3D55009E62E9 /* NewLanguageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3606D1C294D3D55009E62E9 /* NewLanguageViewController.swift */; };
B3657DFD290740D9000D76C8 /* AddNewWordViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3657DFC290740D8000D76C8 /* AddNewWordViewController.swift */; };
Expand Down Expand Up @@ -72,6 +75,9 @@
28716F4B290EF54B00EACCA1 /* Coordinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Coordinator.swift; sourceTree = "<group>"; };
28716F4C290EF54B00EACCA1 /* StoryBoarded.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StoryBoarded.swift; sourceTree = "<group>"; };
28716F4D290EF54B00EACCA1 /* MainCoordinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MainCoordinator.swift; sourceTree = "<group>"; };
4148B09B2C02774F009B29D2 /* TakeLookSwitchButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TakeLookSwitchButton.swift; sourceTree = "<group>"; };
4148B09D2C0288FB009B29D2 /* RatingAlertHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RatingAlertHelper.swift; sourceTree = "<group>"; };
4148B09F2C0289F7009B29D2 /* MailManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MailManager.swift; sourceTree = "<group>"; };
41AA7F712B0D3094009DE4E9 /* Localizable.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = Localizable.xcstrings; sourceTree = "<group>"; };
95333B92290B36A400016F8E /* hi */ = {isa = PBXFileReference; lastKnownFileType = text.html; name = hi; path = hi.lproj/pp.html; sourceTree = "<group>"; };
B3606D1C294D3D55009E62E9 /* NewLanguageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewLanguageViewController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -243,6 +249,7 @@
children = (
B3E01CEC298F260F004D86C1 /* TrainingView.swift */,
B38FD6C32A7740E700DF1043 /* TrainingEmptyView.swift */,
4148B09B2C02774F009B29D2 /* TakeLookSwitchButton.swift */,
);
path = View;
sourceTree = "<group>";
Expand Down Expand Up @@ -322,6 +329,8 @@
CE2EB8262245406A006B1C6D /* Launch Screen.storyboard */,
B3606D1E294D459E009E62E9 /* Localizable */,
CECD6344235E54350060911F /* pp.html */,
4148B09D2C0288FB009B29D2 /* RatingAlertHelper.swift */,
4148B09F2C0289F7009B29D2 /* MailManager.swift */,
);
path = VocabularyTrainer;
sourceTree = "<group>";
Expand Down Expand Up @@ -554,9 +563,11 @@
E37D170B261BCD59006C1F71 /* VocabularyDateFormatter.swift in Sources */,
CEF0605329510A27001D2CEA /* HomeViewController.swift in Sources */,
B3E01CEF298F2A7F004D86C1 /* TrainingViewController.swift in Sources */,
4148B0A02C0289F7009B29D2 /* MailManager.swift in Sources */,
CEB77943295E503F00D7BF35 /* NewLanguageScreenProtocol.swift in Sources */,
CEA8BCC52966108D00E2EAF9 /* AboutViewController.swift in Sources */,
B3E5421D294FB17A0015FD9C /* ModalCloseButton.swift in Sources */,
4148B09C2C02774F009B29D2 /* TakeLookSwitchButton.swift in Sources */,
B38C29D8294D578C006FCDEA /* UILabel+Extensions.swift in Sources */,
CE60940A2999210F00C74933 /* Textfield.swift in Sources */,
CEB77945295E563200D7BF35 /* UserDefaults+Extensions.swift in Sources */,
Expand All @@ -566,6 +577,7 @@
18943A0C2909726B0017E1A2 /* VocabularyCell.swift in Sources */,
28716F50290EF54B00EACCA1 /* MainCoordinator.swift in Sources */,
B3606D1D294D3D55009E62E9 /* NewLanguageViewController.swift in Sources */,
4148B09E2C0288FB009B29D2 /* RatingAlertHelper.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -745,15 +757,15 @@
CODE_SIGN_ENTITLEMENTS = VocabularyTrainer/VocabularyTrainer.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 6T68RPD4WZ;
INFOPLIST_FILE = VocabularyTrainer/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.6.2;
MARKETING_VERSION = 1.7.0;
PRODUCT_BUNDLE_IDENTIFIER = st.mic.VocabularyTrainer;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -770,15 +782,15 @@
CODE_SIGN_ENTITLEMENTS = VocabularyTrainer/VocabularyTrainer.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 6T68RPD4WZ;
INFOPLIST_FILE = VocabularyTrainer/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.6.2;
MARKETING_VERSION = 1.7.0;
PRODUCT_BUNDLE_IDENTIFIER = st.mic.VocabularyTrainer;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
5 changes: 4 additions & 1 deletion VocabularyTrainer/App/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
coordinator?.start()
window?.rootViewController = navigationController
window?.makeKeyAndVisible()


RatingAlertHelper.shared.incrementAppStart()
RatingAlertHelper.shared.showPopupIfNeeded()

return true
}

Expand Down
74 changes: 73 additions & 1 deletion VocabularyTrainer/Localizable/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -1371,7 +1371,7 @@
}
},
"home_import_button_title" : {
"comment" : "Title of the button for importing saved languages\nImport button title",
"comment" : "Import button title\nTitle of the button for importing saved languages",
"localizations" : {
"de" : {
"stringUnit" : {
Expand Down Expand Up @@ -1941,6 +1941,78 @@
}
}
},
"rating_alert_feedbackAlertMailButton" : {
"comment" : "Title of mail button",
"extractionState" : "extracted_with_value",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "new",
"value" : "Mail to [email protected]"
}
}
}
},
"rating_alert_feedbackAlertText" : {
"comment" : "Title of feedback alert appearing when user taps no",
"extractionState" : "extracted_with_value",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "new",
"value" : "Please do send an short feedback email to me for any requests, bug reports, etc.\n I highly do appreciate any feedback! ❤️\nTap the button below to open your mail app."
}
}
}
},
"rating_alert_feedbackAlertTitle" : {
"comment" : "Title of feedback alert appearing when user taps no",
"extractionState" : "extracted_with_value",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "new",
"value" : "Give Feedback"
}
}
}
},
"rating_alert_likeTheApp_title" : {
"comment" : "Title of the alert asking the user whether they like the app",
"extractionState" : "extracted_with_value",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "new",
"value" : "Do you like the App?"
}
}
}
},
"rating_alert_likeTheAppNoButton_title" : {
"comment" : "No button title",
"extractionState" : "extracted_with_value",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "new",
"value" : "No"
}
}
}
},
"rating_alert_likeTheAppYesButton_title" : {
"comment" : "Yes button title",
"extractionState" : "extracted_with_value",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "new",
"value" : "Yes"
}
}
}
},
"rightAnswer" : {
"extractionState" : "manual",
"localizations" : {
Expand Down
46 changes: 46 additions & 0 deletions VocabularyTrainer/MailManager.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
//
// MailManager.swift
// bread-timer
//
// Created by skrr on 24.05.20.
// Copyright © 2020 mic. All rights reserved.
//

import MessageUI
import SwiftUI

//struct MailManagerViewController: UIViewControllerRepresentable {
//
//}

final class MailManager: NSObject {
static var shared = MailManager()
func mailViewController() -> MFMailComposeViewController {
if MFMailComposeViewController.canSendMail() {
let mail = MFMailComposeViewController()
mail.mailComposeDelegate = self
mail.setToRecipients(["[email protected]"])
mail.setSubject("Mail from Flippy")
mail.setMessageBody("<p>Hello Michael!</p><br>", isHTML: true)
return mail
} else {
return MFMailComposeViewController(nibName: nil, bundle: nil)
}
}
}

extension MailManager: MFMailComposeViewControllerDelegate {
func mailComposeController(_ controller: MFMailComposeViewController, didFinishWith result: MFMailComposeResult, error: Error?) {
controller.dismiss(animated: true)
}
}

extension MailManager: UIViewControllerRepresentable {
func updateUIViewController(_ uiViewController: MFMailComposeViewController, context: Context) {
return
}

func makeUIViewController(context: Context) -> MFMailComposeViewController {
return MailManager.shared.mailViewController()
}
}
Loading

0 comments on commit fd1b429

Please sign in to comment.