Skip to content

Commit

Permalink
Fixed bugs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Karkatof authored and Karkatof committed May 30, 2022
1 parent 5621745 commit 649c6b6
Show file tree
Hide file tree
Showing 16 changed files with 223 additions and 93 deletions.
10 changes: 6 additions & 4 deletions FirebaseToDo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -573,12 +573,13 @@
DEVELOPMENT_TEAM = 842TDBHB38;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = FirebaseToDo/Info.plist;
INFOPLIST_KEY_LSApplicationCategoryType = "";
INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "Для определения вашей геопозиции, необходимо ваше разрешение.";
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
INFOPLIST_KEY_UIMainStoryboardFile = Main;
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = UIInterfaceOrientationPortrait;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -603,12 +604,13 @@
DEVELOPMENT_TEAM = 842TDBHB38;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = FirebaseToDo/Info.plist;
INFOPLIST_KEY_LSApplicationCategoryType = "";
INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "Для определения вашей геопозиции, необходимо ваше разрешение.";
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
INFOPLIST_KEY_UIMainStoryboardFile = Main;
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = UIInterfaceOrientationPortrait;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>FirebaseToDo.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
<integer>24</integer>
</dict>
</dict>
</dict>
Expand Down
6 changes: 3 additions & 3 deletions FirebaseToDo/Controllers/DetailWeatherVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ class DetailWeatherVC: UIViewController {

private func setTableView() {
tableView.isScrollEnabled = false
self.view.backgroundColor = .systemGray5
tableView.backgroundColor = .white
self.view.backgroundColor = .myGray()
tableView.backgroundColor = .darkWhite()
let nameCity = detail.removeFirst().uppercased()
navigationItem.title = "\(nameCity)"
tableView.delegate = self
tableView.dataSource = self
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "myCell")
tableView.frame = CGRect(x: 10, y: 100, width: self.view.bounds.size.width - 20, height: self.view.bounds.size.height / 3.1)
tableView.frame = CGRect(x: 10, y: 100, width: self.view.bounds.size.width - 20, height: self.view.bounds.size.height / 2.7)
tableView.layer.cornerRadius = 20
view.addSubview(tableView)
}
Expand Down
4 changes: 2 additions & 2 deletions FirebaseToDo/Controllers/LoginViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ class LoginViewController: UIViewController {
loginButton.isEnabled = true
navigationController?.navigationBar.barStyle = UIBarStyle.black
tabBarController?.tabBar.isHidden = true
//passwordTF.text = "qwerty"
//emailTF.text = "[email protected]"
passwordTF.text = "qwerty"
emailTF.text = "[email protected]"
}
}

Expand Down
2 changes: 1 addition & 1 deletion FirebaseToDo/Controllers/ValuteViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class ValuteViewController: UIViewController {
private func setView() {
let backgroundColor = UIColor(red: 25/255, green: 75/255, blue: 109/255, alpha: 1)
let myView = UIView()
myView.backgroundColor = .systemGray4
myView.backgroundColor = .myGray()
myView.frame = CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height)
view.addSubview(myView)
self.view.backgroundColor = backgroundColor
Expand Down
24 changes: 12 additions & 12 deletions FirebaseToDo/Controllers/WeatherViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class WeatherViewController: UIViewController {
let imageView = UIImageView()
imageView.translatesAutoresizingMaskIntoConstraints = false
imageView.image = UIImage(systemName: "nil")
imageView.tintColor = UIColor(named: "DarkWhite")
imageView.tintColor = .darkWhite()
imageView.contentMode = .scaleAspectFill
return imageView
}()
Expand Down Expand Up @@ -56,16 +56,16 @@ class WeatherViewController: UIViewController {
label.font = UIFont.systemFont(ofSize: 22)
label.text = ""
label.textAlignment = .center
label.textColor = UIColor(named: "DarkWhite")
label.textColor = .darkWhite()
return label
}()
let cityLabel: UILabel = {
let label = UILabel()
label.translatesAutoresizingMaskIntoConstraints = false
label.textAlignment = .right
label.text = ""
label.font = UIFont.boldSystemFont(ofSize: 34)
label.textColor = UIColor(named: "DarkWhite")
label.font = UIFont.boldSystemFont(ofSize: 24)
label.textColor = .darkWhite()
return label
}()
let searchCityButton: UIButton = {
Expand All @@ -74,7 +74,7 @@ class WeatherViewController: UIViewController {
button.translatesAutoresizingMaskIntoConstraints = false
let searchImage = UIImage(systemName: "magnifyingglass.circle.fill")
button.setBackgroundImage(searchImage, for: .normal)
button.tintColor = UIColor(named: "DarkWhite")
button.tintColor = .darkWhite()
return button
}()
let detailButton: UIButton = {
Expand All @@ -83,7 +83,7 @@ class WeatherViewController: UIViewController {
button.translatesAutoresizingMaskIntoConstraints = false
let weatherWeekImage = UIImage(systemName: "line.3.horizontal.circle.fill")
button.setBackgroundImage(weatherWeekImage, for: .normal)
button.tintColor = UIColor(named: "DarkWhite")
button.tintColor = .darkWhite()
return button
}()
let locationButton: UIButton = {
Expand All @@ -92,14 +92,14 @@ class WeatherViewController: UIViewController {
button.translatesAutoresizingMaskIntoConstraints = false
let locationImage = UIImage(systemName: "location.circle.fill")
button.setBackgroundImage(locationImage, for: .normal)
button.tintColor = UIColor(named: "DarkWhite")
button.tintColor = .darkWhite()
return button
}()
let spiner: UIActivityIndicatorView = {
let activity = UIActivityIndicatorView()
activity.translatesAutoresizingMaskIntoConstraints = false
activity.style = .large
activity.color = UIColor(named: "DarkWhite")
activity.color = .darkWhite()
activity.hidesWhenStopped = true
return activity
}()
Expand Down Expand Up @@ -148,13 +148,13 @@ extension WeatherViewController {

private func makeTemperatureText(temperature: String) -> NSAttributedString {
let boldAttributes: [NSAttributedString.Key : Any] = [
.strokeColor: UIColor(named: "DarkWhite") ?? UIColor(),
.foregroundColor : UIColor(named: "DarkWhite") ?? UIColor(),
.strokeColor: .darkWhite() ?? UIColor(),
.foregroundColor : .darkWhite() ?? UIColor(),
.font : UIFont.boldSystemFont(ofSize: 80)
]
let celciusAttributes: [NSAttributedString.Key : Any] = [
.font : UIFont.systemFont(ofSize: 60),
.foregroundColor : UIColor(named: "DarkWhite") ?? UIColor()
.foregroundColor : .darkWhite() ?? UIColor()
]
let attributedString = NSMutableAttributedString(string: temperature, attributes: boldAttributes)
attributedString.append(NSAttributedString(string: "", attributes: celciusAttributes))
Expand Down Expand Up @@ -259,7 +259,7 @@ extension WeatherViewController {
backgroundImageView.rightAnchor.constraint(equalTo: view.rightAnchor),
backgroundImageView.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: +65),

cityLabel.bottomAnchor.constraint(equalTo: searchCityButton.bottomAnchor),
cityLabel.centerYAnchor.constraint(equalTo: searchCityButton.centerYAnchor),
cityLabel.leadingAnchor.constraint(greaterThanOrEqualToSystemSpacingAfter: view.leadingAnchor, multiplier: 2),
cityLabel.trailingAnchor.constraint(equalTo: searchCityButton.leadingAnchor, constant: -20),

Expand Down
3 changes: 3 additions & 0 deletions FirebaseToDo/Helpers/Extension UIColor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ extension UIColor {
static func darkWhite() -> UIColor {
return UIColor(named: "DarkWhite")!
}
static func myGray() -> UIColor {
return UIColor(named: "myGray")!
}

static func colorArray() -> [UIColor] {
let colors: [UIColor] = [.systemRed, .systemBlue, .systemGreen, .systemBrown, .systemIndigo, .systemTeal, .systemYellow, .systemCyan, .systemMint, .systemRed, .systemBlue, .systemPink, .systemBrown, .systemIndigo, .systemPurple, .systemTeal, .systemPurple, .systemYellow, .systemCyan, .systemMint, .systemGreen, .systemRed, .systemBlue, .systemGreen, .systemBrown, .systemIndigo, .systemTeal, .systemYellow, .systemCyan, .systemMint, .systemRed, .systemBlue, .systemPink, .systemBrown, .systemIndigo, .systemPurple, .systemTeal, .systemPurple, .systemYellow, .systemCyan, .systemMint, .systemGreen]
Expand Down
14 changes: 7 additions & 7 deletions FirebaseToDo/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Для определения вашей геопозиции, необходимо ваше разрешение.</string>
<key>User Interface Style</key>
<string>Light</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
Expand All @@ -25,10 +30,5 @@
</dict>
<key>UIStatusBarStyle</key>
<string>UIStatusBarStyleDefault</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
</dict>
</plist>
11 changes: 4 additions & 7 deletions FirebaseToDo/Supporting Files/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,15 @@ import UIKit
class SceneDelegate: UIResponder, UIWindowSceneDelegate {

var window: UIWindow?

var tabBar: UITabBarController!
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {

guard let windowScene = (scene as? UIWindowScene) else { return }
let window = UIWindow(windowScene: windowScene)

//TabBarController

let tabBar = createTabBarController()

tabBar = createTabBarController()
window.rootViewController = tabBar
//
self.window = window
window.makeKeyAndVisible()

Expand All @@ -42,11 +39,11 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
}

func sceneWillEnterForeground(_ scene: UIScene) {
// Called as the scene transitions from the background to the foreground.
// Use this method to undo the changes made on entering the background.
}

func sceneDidEnterBackground(_ scene: UIScene) {
tabBar = createTabBarController()
window?.rootViewController = tabBar
// Called as the scene transitions from the foreground to the background.
// Use this method to save data, release shared resources, and store enough scene-specific state information
// to restore the scene back to its current state.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,6 @@
"value" : "dark"
}
],
"color" : {
"color-space" : "display-p3",
"components" : {
"alpha" : "1.000",
"blue" : "0.000",
"green" : "0.000",
"red" : "0.000"
}
},
"idiom" : "universal"
}
],
Expand Down
29 changes: 29 additions & 0 deletions FirebaseToDo/View/Assets.xcassets/myGray.colorset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"colors" : [
{
"color" : {
"color-space" : "display-p3",
"components" : {
"alpha" : "1.000",
"blue" : "0.850",
"green" : "0.850",
"red" : "0.850"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
2 changes: 1 addition & 1 deletion FirebaseToDo/View/TasksListsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ extension TasksListsViewController {
func showTabBar(_ originX: Double, originY: Double) {
UIView.animate(withDuration: 1, delay: 0.7, usingSpringWithDamping: 0.8, initialSpringVelocity: 0.7, options: .curveEaseInOut) {

self.tabBarController?.tabBar.frame.origin = CGPoint(x: originX, y: self.view.frame.size.height - originY)
self.tabBarController?.tabBar.frame.origin = CGPoint(x: 20, y: self.view.frame.size.height - originY)
}
}

Expand Down
2 changes: 1 addition & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -560,4 +560,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 57c45133d8ec96308cdb4f30614d2918cab68f32

COCOAPODS: 1.11.2
COCOAPODS: 1.11.3
2 changes: 1 addition & 1 deletion Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 649c6b6

Please sign in to comment.