Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 38 additions & 37 deletions Classes/BaseViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,42 @@
import UIKit

class BaseViewController: UIViewController {

override func viewDidLoad() {
super.viewDidLoad()

self.setupUI()
self.setupBindings()
}

@objc func setupUI() {
DispatchQueue.main.async {
self.setupNavigationBar()
}
}

func setupBindings() {
NotificationCenter.default.addObserver(self, selector: #selector(self.setupUI), name: Config.Notifications.themeUpdated, object: nil)
}

func setupNavigationBar() {
self.navigationController?.navigationBar.barStyle = .black;
// self.navigationController?.navigationBar.barTintColor = Utils().getCurrentThemeColor()
// self.navigationController?.view.backgroundColor = Utils().getCurrentThemeColor()

let appearance = UINavigationBarAppearance()
appearance.configureWithOpaqueBackground()
appearance.backgroundColor = Utils().getCurrentThemeColor()
self.navigationController?.navigationBar.standardAppearance = appearance;
self.navigationController?.navigationBar.scrollEdgeAppearance = self.navigationController?.navigationBar.standardAppearance


self.navigationController?.navigationBar.tintColor = UIColor.white
self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.white]
self.navigationController?.navigationBar.isTranslucent = false
self.navigationController?.navigationBar.setValue(true, forKey: "hidesShadow")

UISearchBar.appearance().backgroundColor = Utils().getCurrentThemeColor()
}

override func viewDidLoad() {
super.viewDidLoad()

self.setupUI()
self.setupBindings()
}

@objc func setupUI() {
DispatchQueue.main.async {
self.setupNavigationBar()
}
}

func setupBindings() {
NotificationCenter.default.addObserver(self, selector: #selector(self.setupUI), name: Config.Notifications.themeUpdated, object: nil)
}

func setupNavigationBar() {
self.navigationController?.navigationBar.barStyle = .black;
// self.navigationController?.navigationBar.barTintColor = Utils().getCurrentThemeColor()
// self.navigationController?.view.backgroundColor = Utils().getCurrentThemeColor()
if #available(iOS 13.0, *) {
let appearance = UINavigationBarAppearance()
appearance.configureWithOpaqueBackground()
appearance.backgroundColor = Utils().getCurrentThemeColor()
self.navigationController?.navigationBar.standardAppearance = appearance;
self.navigationController?.navigationBar.scrollEdgeAppearance = self.navigationController?.navigationBar.standardAppearance


self.navigationController?.navigationBar.tintColor = UIColor.white
self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.white]
self.navigationController?.navigationBar.isTranslucent = false
self.navigationController?.navigationBar.setValue(true, forKey: "hidesShadow")

UISearchBar.appearance().backgroundColor = Utils().getCurrentThemeColor()
}
}
}
4 changes: 2 additions & 2 deletions Classes/Tasks/TasksViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class TasksViewController: BaseViewController {
self.searchController.searchBar.tintColor = UIColor.white
// self.searchController.searchBar.barTintColor = Utils().getCurrentThemeColor()
// self.navigationController?.view.backgroundColor = Utils().getCurrentThemeColor()
if #available(iOS 13.0, *) {
let appearance = UINavigationBarAppearance()
appearance.configureWithOpaqueBackground()
appearance.backgroundColor = Utils().getCurrentThemeColor()
Expand All @@ -84,7 +84,7 @@ class TasksViewController: BaseViewController {

self.tableView.tableFooterView = UIView(frame: CGRect(x: 0, y: 0, width: self.tableView.frame.size.width, height: 1))
}
}
override func setupBindings() {
super.setupBindings()

Expand Down
161 changes: 160 additions & 1 deletion ToDoList.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
objects = {

/* Begin PBXBuildFile section */
016C77EA2896D8B400FD4F5B /* ToDoListUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 016C77E92896D8B400FD4F5B /* ToDoListUITests.swift */; };
016C77F72896D91F00FD4F5B /* ScreensElements.swift in Sources */ = {isa = PBXBuildFile; fileRef = 016C77F62896D91F00FD4F5B /* ScreensElements.swift */; };
016C77F92896D94000FD4F5B /* ToDoListSteps.swift in Sources */ = {isa = PBXBuildFile; fileRef = 016C77F82896D94000FD4F5B /* ToDoListSteps.swift */; };
016C77FB2896D96500FD4F5B /* ToDoListTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 016C77FA2896D96500FD4F5B /* ToDoListTests.swift */; };
170DEDFE2672916600024B70 /* IceCream in Frameworks */ = {isa = PBXBuildFile; productRef = 170DEDFD2672916600024B70 /* IceCream */; };
1710DD2923CF5C46000E64F4 /* Main-iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1710DD2823CF5C46000E64F4 /* Main-iPad.storyboard */; };
1718BE4523CCBB19009D591A /* NotificationCenter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1718BE4423CCBB19009D591A /* NotificationCenter.framework */; };
Expand Down Expand Up @@ -123,6 +127,13 @@
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
016C77ED2896D8B400FD4F5B /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 17D18D33221D56C4005C647B /* Project object */;
proxyType = 1;
remoteGlobalIDString = 17D18D3A221D56C4005C647B;
remoteInfo = ToDoList;
};
1718BE4D23CCBB19009D591A /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 17D18D33221D56C4005C647B /* Project object */;
Expand Down Expand Up @@ -183,6 +194,11 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
016C77E72896D8B400FD4F5B /* ToDoListUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ToDoListUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
016C77E92896D8B400FD4F5B /* ToDoListUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToDoListUITests.swift; sourceTree = "<group>"; };
016C77F62896D91F00FD4F5B /* ScreensElements.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScreensElements.swift; sourceTree = "<group>"; };
016C77F82896D94000FD4F5B /* ToDoListSteps.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToDoListSteps.swift; sourceTree = "<group>"; };
016C77FA2896D96500FD4F5B /* ToDoListTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToDoListTests.swift; sourceTree = "<group>"; };
170DEDFC267290D000024B70 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
1710DD2823CF5C46000E64F4 /* Main-iPad.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = "Main-iPad.storyboard"; sourceTree = "<group>"; };
1718BE4323CCBB19009D591A /* ToDoListWidget.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = ToDoListWidget.appex; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -277,6 +293,13 @@
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
016C77E42896D8B400FD4F5B /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
1718BE4023CCBB19009D591A /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -333,6 +356,49 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
016C77E82896D8B400FD4F5B /* ToDoListUITests */ = {
isa = PBXGroup;
children = (
016C77F52896D8E600FD4F5B /* Tests */,
016C77F42896D8E000FD4F5B /* Steps */,
016C77F32896D8D400FD4F5B /* Elements */,
016C77F22896D8C800FD4F5B /* Base */,
);
path = ToDoListUITests;
sourceTree = "<group>";
};
016C77F22896D8C800FD4F5B /* Base */ = {
isa = PBXGroup;
children = (
016C77E92896D8B400FD4F5B /* ToDoListUITests.swift */,
);
path = Base;
sourceTree = "<group>";
};
016C77F32896D8D400FD4F5B /* Elements */ = {
isa = PBXGroup;
children = (
016C77F62896D91F00FD4F5B /* ScreensElements.swift */,
);
path = Elements;
sourceTree = "<group>";
};
016C77F42896D8E000FD4F5B /* Steps */ = {
isa = PBXGroup;
children = (
016C77F82896D94000FD4F5B /* ToDoListSteps.swift */,
);
path = Steps;
sourceTree = "<group>";
};
016C77F52896D8E600FD4F5B /* Tests */ = {
isa = PBXGroup;
children = (
016C77FA2896D96500FD4F5B /* ToDoListTests.swift */,
);
path = Tests;
sourceTree = "<group>";
};
1718BE4623CCBB19009D591A /* Widget */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -427,6 +493,7 @@
1718BE4623CCBB19009D591A /* Widget */,
17278CC523CE05880014B8B2 /* WatchApp */,
17278CD423CE05890014B8B2 /* WatchApp Extension */,
016C77E82896D8B400FD4F5B /* ToDoListUITests */,
17D18D3C221D56C4005C647B /* Products */,
174F9ED1221D8E7F00D9C139 /* Frameworks */,
);
Expand All @@ -439,6 +506,7 @@
1718BE4323CCBB19009D591A /* ToDoListWidget.appex */,
17278CC423CE05880014B8B2 /* WatchApp.app */,
17278CD023CE05890014B8B2 /* WatchApp Extension.appex */,
016C77E72896D8B400FD4F5B /* ToDoListUITests.xctest */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -526,6 +594,24 @@
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
016C77E62896D8B400FD4F5B /* ToDoListUITests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 016C77F12896D8B400FD4F5B /* Build configuration list for PBXNativeTarget "ToDoListUITests" */;
buildPhases = (
016C77E32896D8B400FD4F5B /* Sources */,
016C77E42896D8B400FD4F5B /* Frameworks */,
016C77E52896D8B400FD4F5B /* Resources */,
);
buildRules = (
);
dependencies = (
016C77EE2896D8B400FD4F5B /* PBXTargetDependency */,
);
name = ToDoListUITests;
productName = ToDoListUITests;
productReference = 016C77E72896D8B400FD4F5B /* ToDoListUITests.xctest */;
productType = "com.apple.product-type.bundle.ui-testing";
};
1718BE4223CCBB19009D591A /* ToDoListWidget */ = {
isa = PBXNativeTarget;
buildConfigurationList = 1718BE5323CCBB19009D591A /* Build configuration list for PBXNativeTarget "ToDoListWidget" */;
Expand Down Expand Up @@ -638,10 +724,14 @@
17D18D33221D56C4005C647B /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 1130;
LastSwiftUpdateCheck = 1330;
LastUpgradeCheck = 1200;
ORGANIZATIONNAME = "Radu Ursache - RanduSoft";
TargetAttributes = {
016C77E62896D8B400FD4F5B = {
CreatedOnToolsVersion = 13.3.1;
TestTargetID = 17D18D3A221D56C4005C647B;
};
1718BE4223CCBB19009D591A = {
CreatedOnToolsVersion = 11.3;
};
Expand Down Expand Up @@ -701,11 +791,19 @@
1718BE4223CCBB19009D591A /* ToDoListWidget */,
17278CC323CE05880014B8B2 /* WatchApp */,
17278CCF23CE05890014B8B2 /* WatchApp Extension */,
016C77E62896D8B400FD4F5B /* ToDoListUITests */,
);
};
/* End PBXProject section */

/* Begin PBXResourcesBuildPhase section */
016C77E52896D8B400FD4F5B /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
1718BE4123CCBB19009D591A /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -769,6 +867,17 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
016C77E32896D8B400FD4F5B /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
016C77F72896D91F00FD4F5B /* ScreensElements.swift in Sources */,
016C77EA2896D8B400FD4F5B /* ToDoListUITests.swift in Sources */,
016C77F92896D94000FD4F5B /* ToDoListSteps.swift in Sources */,
016C77FB2896D96500FD4F5B /* ToDoListTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
1718BE3F23CCBB19009D591A /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -846,6 +955,11 @@
/* End PBXSourcesBuildPhase section */

/* Begin PBXTargetDependency section */
016C77EE2896D8B400FD4F5B /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 17D18D3A221D56C4005C647B /* ToDoList */;
targetProxy = 016C77ED2896D8B400FD4F5B /* PBXContainerItemProxy */;
};
1718BE4E23CCBB19009D591A /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
platformFilter = ios;
Expand Down Expand Up @@ -936,6 +1050,42 @@
/* End PBXVariantGroup section */

/* Begin XCBuildConfiguration section */
016C77EF2896D8B400FD4F5B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 15.4;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.vale.ToDoListUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_TARGET_NAME = ToDoList;
};
name = Debug;
};
016C77F02896D8B400FD4F5B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 15.4;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.vale.ToDoListUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_TARGET_NAME = ToDoList;
};
name = Release;
};
1718BE5123CCBB19009D591A /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
Expand Down Expand Up @@ -1264,6 +1414,15 @@
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
016C77F12896D8B400FD4F5B /* Build configuration list for PBXNativeTarget "ToDoListUITests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
016C77EF2896D8B400FD4F5B /* Debug */,
016C77F02896D8B400FD4F5B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
1718BE5323CCBB19009D591A /* Build configuration list for PBXNativeTarget "ToDoListWidget" */ = {
isa = XCConfigurationList;
buildConfigurations = (
Expand Down
10 changes: 10 additions & 0 deletions ToDoList.xcodeproj/xcshareddata/xcschemes/ToDoList.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "016C77E62896D8B400FD4F5B"
BuildableName = "ToDoListUITests.xctest"
BlueprintName = "ToDoListUITests"
ReferencedContainer = "container:ToDoList.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
Expand Down
Loading