Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jesper Rage Interview Project Feature complete: #8

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
24 changes: 22 additions & 2 deletions OpenTweet.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
009C4C811D9F0CD600F0BC6C /* OpenTweetTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 009C4C801D9F0CD600F0BC6C /* OpenTweetTests.swift */; };
009C4C8C1D9F0CD600F0BC6C /* OpenTweetUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 009C4C8B1D9F0CD600F0BC6C /* OpenTweetUITests.swift */; };
009C4C9B1D9F0D4100F0BC6C /* timeline.json in Resources */ = {isa = PBXBuildFile; fileRef = 009C4C9A1D9F0D4100F0BC6C /* timeline.json */; };
E64573452B7088E50099B820 /* DataStructures.swift in Sources */ = {isa = PBXBuildFile; fileRef = E64573442B7088E50099B820 /* DataStructures.swift */; };
E64573472B70890E0099B820 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = E64573462B70890E0099B820 /* Constants.swift */; };
E64573492B7089440099B820 /* AppTheme.swift in Sources */ = {isa = PBXBuildFile; fileRef = E64573482B7089440099B820 /* AppTheme.swift */; };
E645734F2B71BA530099B820 /* TimelineTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E645734E2B71BA530099B820 /* TimelineTableViewController.swift */; };
E64573512B71F4890099B820 /* convenienceExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E64573502B71F4880099B820 /* convenienceExtensions.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -50,6 +55,11 @@
009C4C8D1D9F0CD600F0BC6C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
009C4C9A1D9F0D4100F0BC6C /* timeline.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = timeline.json; sourceTree = "<group>"; };
009C4C9D1D9F104800F0BC6C /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
E64573442B7088E50099B820 /* DataStructures.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataStructures.swift; sourceTree = "<group>"; };
E64573462B70890E0099B820 /* Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = "<group>"; };
E64573482B7089440099B820 /* AppTheme.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppTheme.swift; sourceTree = "<group>"; };
E645734E2B71BA530099B820 /* TimelineTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimelineTableViewController.swift; sourceTree = "<group>"; };
E64573502B71F4880099B820 /* convenienceExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = convenienceExtensions.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -104,6 +114,11 @@
children = (
009C4C6B1D9F0CD600F0BC6C /* AppDelegate.swift */,
009C4C6D1D9F0CD600F0BC6C /* TimelineViewController.swift */,
E645734E2B71BA530099B820 /* TimelineTableViewController.swift */,
E64573442B7088E50099B820 /* DataStructures.swift */,
E64573462B70890E0099B820 /* Constants.swift */,
E64573482B7089440099B820 /* AppTheme.swift */,
E64573502B71F4880099B820 /* convenienceExtensions.swift */,
009C4C6F1D9F0CD600F0BC6C /* Main.storyboard */,
009C4C741D9F0CD600F0BC6C /* LaunchScreen.storyboard */,
009C4C721D9F0CD600F0BC6C /* Assets.xcassets */,
Expand Down Expand Up @@ -276,8 +291,13 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
E64573512B71F4890099B820 /* convenienceExtensions.swift in Sources */,
E64573452B7088E50099B820 /* DataStructures.swift in Sources */,
E64573492B7089440099B820 /* AppTheme.swift in Sources */,
009C4C6E1D9F0CD600F0BC6C /* TimelineViewController.swift in Sources */,
009C4C6C1D9F0CD600F0BC6C /* AppDelegate.swift in Sources */,
E645734F2B71BA530099B820 /* TimelineTableViewController.swift in Sources */,
E64573472B70890E0099B820 /* Constants.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -453,7 +473,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = QPU8QS3E62;
INFOPLIST_FILE = OpenTweet/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.opentable.OpenTweet;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -467,7 +487,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = QPU8QS3E62;
INFOPLIST_FILE = OpenTweet/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.opentable.OpenTweet;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
15 changes: 15 additions & 0 deletions OpenTweet/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,21 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.

// Deal with navigation bar colours changing
if #available(iOS 15, *) {
// MARK: Navigation bar appearance
let navigationBarAppearance = UINavigationBarAppearance()
navigationBarAppearance.configureWithOpaqueBackground()
navigationBarAppearance.titleTextAttributes = [
NSAttributedString.Key.foregroundColor : UIColor.white
]
navigationBarAppearance.backgroundColor = theme.background
UINavigationBar.appearance().standardAppearance = navigationBarAppearance
UINavigationBar.appearance().compactAppearance = navigationBarAppearance
UINavigationBar.appearance().scrollEdgeAppearance = navigationBarAppearance
}

return true
}

Expand Down
34 changes: 34 additions & 0 deletions OpenTweet/AppTheme.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//
// AppTheme.swift
// OpenTweet
//
// Created by Jesper Rage on 2024-02-04.
// Copyright © 2024 OpenTable, Inc. All rights reserved.
//

import UIKit

// Todo impilment options
enum ColourMode:String {
case light = "Light Mode"
case dark = "Dark Mode"
case os = "Match OS"
}


// Todo make struct with getters and setters that access user defaults
struct AppTheme {
let textTitle: UIColor
let textBody: UIColor
let textHighlight: UIColor
let background: UIColor
let forground: UIColor
let trim: UIColor

let titleFont: UIFont
let bodyFont: UIFont
let replyFont: UIFont
let dateFont: UIFont
let replyCountFont: UIFont
}

Loading