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

Feat: add extension #13

Merged
merged 1 commit into from
Nov 8, 2023
Merged
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: 24 additions & 0 deletions ReadLog/ReadLog.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,20 @@
objects = {

/* Begin PBXBuildFile section */
E622526B2AFB7AE600D33EC3 /* omyu pretty.ttf in Resources */ = {isa = PBXBuildFile; fileRef = E622526A2AFB7AE600D33EC3 /* omyu pretty.ttf */; };
E622526E2AFB7CB300D33EC3 /* Color+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = E622526D2AFB7CB300D33EC3 /* Color+Extension.swift */; };
E62252702AFB7E7000D33EC3 /* TextStyle+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = E622526F2AFB7E7000D33EC3 /* TextStyle+Extension.swift */; };
E6E68EDB2AF1DD7B00172557 /* ReadLogApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6E68EDA2AF1DD7B00172557 /* ReadLogApp.swift */; };
E6E68EDD2AF1DD7B00172557 /* RootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6E68EDC2AF1DD7B00172557 /* RootView.swift */; };
E6E68EDF2AF1DD7C00172557 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E6E68EDE2AF1DD7C00172557 /* Assets.xcassets */; };
E6E68EE22AF1DD7C00172557 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E6E68EE12AF1DD7C00172557 /* Preview Assets.xcassets */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
E622526A2AFB7AE600D33EC3 /* omyu pretty.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "omyu pretty.ttf"; sourceTree = "<group>"; };
E622526C2AFB7B0400D33EC3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
E622526D2AFB7CB300D33EC3 /* Color+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Color+Extension.swift"; sourceTree = "<group>"; };
E622526F2AFB7E7000D33EC3 /* TextStyle+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "TextStyle+Extension.swift"; sourceTree = "<group>"; };
E6E68ED72AF1DD7B00172557 /* ReadLog.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ReadLog.app; sourceTree = BUILT_PRODUCTS_DIR; };
E6E68EDA2AF1DD7B00172557 /* ReadLogApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReadLogApp.swift; sourceTree = "<group>"; };
E6E68EDC2AF1DD7B00172557 /* RootView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RootView.swift; sourceTree = "<group>"; };
Expand All @@ -32,6 +39,14 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
E62252692AFB7ACF00D33EC3 /* Fonts */ = {
isa = PBXGroup;
children = (
E622526A2AFB7AE600D33EC3 /* omyu pretty.ttf */,
);
path = Fonts;
sourceTree = "<group>";
};
E6E68ECE2AF1DD7B00172557 = {
isa = PBXGroup;
children = (
Expand All @@ -51,6 +66,8 @@
E6E68ED92AF1DD7B00172557 /* ReadLog */ = {
isa = PBXGroup;
children = (
E622526C2AFB7B0400D33EC3 /* Info.plist */,
E62252692AFB7ACF00D33EC3 /* Fonts */,
E6E68EF02AF1DEDB00172557 /* Extension */,
E6E68EEF2AF1DED200172557 /* Domain */,
E6E68EEE2AF1DEC300172557 /* Data */,
Expand Down Expand Up @@ -127,6 +144,8 @@
E6E68EF02AF1DEDB00172557 /* Extension */ = {
isa = PBXGroup;
children = (
E622526D2AFB7CB300D33EC3 /* Color+Extension.swift */,
E622526F2AFB7E7000D33EC3 /* TextStyle+Extension.swift */,
);
path = Extension;
sourceTree = "<group>";
Expand Down Expand Up @@ -189,6 +208,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
E622526B2AFB7AE600D33EC3 /* omyu pretty.ttf in Resources */,
E6E68EE22AF1DD7C00172557 /* Preview Assets.xcassets in Resources */,
E6E68EDF2AF1DD7C00172557 /* Assets.xcassets in Resources */,
);
Expand All @@ -202,6 +222,8 @@
buildActionMask = 2147483647;
files = (
E6E68EDD2AF1DD7B00172557 /* RootView.swift in Sources */,
E622526E2AFB7CB300D33EC3 /* Color+Extension.swift in Sources */,
E62252702AFB7E7000D33EC3 /* TextStyle+Extension.swift in Sources */,
E6E68EDB2AF1DD7B00172557 /* ReadLogApp.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -334,6 +356,7 @@
DEVELOPMENT_TEAM = 953VJTV7TA;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = ReadLog/Info.plist;
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
Expand Down Expand Up @@ -364,6 +387,7 @@
DEVELOPMENT_TEAM = 953VJTV7TA;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = ReadLog/Info.plist;
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
Expand Down
20 changes: 20 additions & 0 deletions ReadLog/ReadLog/Assets.xcassets/background.colorset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xF1",
"green" : "0xF7",
"red" : "0xFA"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
20 changes: 20 additions & 0 deletions ReadLog/ReadLog/Assets.xcassets/customPink.colorset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xD6",
"green" : "0xDE",
"red" : "0xFF"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
20 changes: 20 additions & 0 deletions ReadLog/ReadLog/Assets.xcassets/darkBrown.colorset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x28",
"green" : "0x4F",
"red" : "0x6F"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
20 changes: 20 additions & 0 deletions ReadLog/ReadLog/Assets.xcassets/darkGray.colorset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x8F",
"green" : "0x8F",
"red" : "0x8F"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
20 changes: 20 additions & 0 deletions ReadLog/ReadLog/Assets.xcassets/gray.colorset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xC3",
"green" : "0xC3",
"red" : "0xC3"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
20 changes: 20 additions & 0 deletions ReadLog/ReadLog/Assets.xcassets/lightBlue.colorset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xEF",
"green" : "0xE8",
"red" : "0xCF"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
20 changes: 20 additions & 0 deletions ReadLog/ReadLog/Assets.xcassets/skyBlue.colorset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xE6",
"green" : "0xD1",
"red" : "0xAE"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
18 changes: 18 additions & 0 deletions ReadLog/ReadLog/Extension/Color+Extension.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// Color+Extension.swift
// ReadLog
//
// Created by sanghyo on 11/8/23.
//

import SwiftUI

extension Color {
static let background = Color("background")
static let lightBlue = Color("lightBlue")
static let skyBlue = Color("skyBlue")
static let customPink = Color("customPink")
static let darkBrown = Color("darkBrown")
static let gray = Color("gray")
static let darkGray = Color("darkGray")
}
117 changes: 117 additions & 0 deletions ReadLog/ReadLog/Extension/TextStyle+Extension.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
//
// TextStyle+Extension.swift
// ReadLog
//
// Created by sanghyo on 11/8/23.
//

import SwiftUI

struct Display: ViewModifier {
var color: Color

func body(content: Content) -> some View {
content
.foregroundStyle(color)
.font(.custom("omyu pretty", size: 27))
}
}

struct Title: ViewModifier {
var color: Color

func body(content: Content) -> some View {
content
.foregroundStyle(color)
.font(.custom("omyu pretty", size: 22))
}
}


struct BodyDefault: ViewModifier {
var color: Color

func body(content: Content) -> some View {
content
.font(.custom("omyu pretty", size: 20))
.foregroundStyle(color)
.lineSpacing(15)
.padding(.vertical, 7.5)
}
}


struct Body1: ViewModifier {
var color: Color

func body(content: Content) -> some View {
content
.foregroundStyle(color)
.font(.custom("omyu pretty", size: 18))
}
}


struct Body2: ViewModifier {
var color: Color

func body(content: Content) -> some View {
content
.foregroundStyle(color)
.font(.custom("omyu pretty", size: 18))
}
}


struct Body3: ViewModifier {
var color: Color

func body(content: Content) -> some View {
content
.foregroundStyle(color)
.font(.custom("omyu pretty", size: 16))
}
}


struct Mini: ViewModifier {
var color: Color

func body(content: Content) -> some View {
content
.foregroundStyle(color)
.font(.custom("omyu pretty", size: 14))
}
}



extension View {
func display(_ color: Color) -> some View {
self.modifier(Display(color: color))
}

func title(_ color: Color) -> some View {
self.modifier(Title(color: color))
}

func bodyDefault(_ color: Color) -> some View {
self.modifier(BodyDefault(color: color))
}

func body1(_ color: Color) -> some View {
self.modifier(Body1(color: color))
}

func body2(_ color: Color) -> some View {
self.modifier(Body2(color: color))
}

func body3(_ color: Color) -> some View {
self.modifier(Body3(color: color))
}

func mini(_ color: Color) -> some View {
self.modifier(Mini(color: color))
}
}
Binary file added ReadLog/ReadLog/Fonts/omyu pretty.ttf
Binary file not shown.
10 changes: 10 additions & 0 deletions ReadLog/ReadLog/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UIAppFonts</key>
<array>
<string>omyu pretty.ttf</string>
</array>
</dict>
</plist>