Skip to content

Commit

Permalink
Release 1.0(beta)
Browse files Browse the repository at this point in the history
  • Loading branch information
enebin committed Oct 18, 2023
2 parents f40182f + 0d4156d commit 95dc63d
Show file tree
Hide file tree
Showing 324 changed files with 12,021 additions and 342 deletions.
23 changes: 0 additions & 23 deletions .github/workflows/code_review.yml

This file was deleted.

4 changes: 3 additions & 1 deletion .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ disabled_rules:
- nesting
- type_body_length
- no_fallthrough_only
- multiple_closures_with_trailing_closure
- identifier_name

analyzer_rules:
- explicit_self

included:
- Targets
- Projects

# If true, SwiftLint will not fail if no lintable files are found.
allow_zero_lintable_files: false
Expand Down
Binary file added Assets/KEYME.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/appicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/appstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/google_play.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Encrypted/XCConfig/App/DEV.xcconfig.encrypted
Binary file not shown.
Binary file modified Encrypted/XCConfig/App/PROD.xcconfig.encrypted
Binary file not shown.
4 changes: 4 additions & 0 deletions Keyme.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<dict>
<key>aps-environment</key>
<string>development</string>
<key>com.apple.developer.applesignin</key>
<array>
<string>Default</string>
</array>
<key>com.apple.developer.associated-domains</key>
<array/>
</dict>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ public extension TargetDependency {

static let Network = project(target: "Network", path: Path.network)

static let DSKit = project(target: "DSKit", path: Path.dskit)

static let Core = project(target: "Core", path: Path.core)

static let Util = project(target: "Util", path: Path.relativeToCore("Util"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,9 @@ public extension TargetDependency {
static let FirebaseMessaging = TargetDependency.external(name: "FirebaseMessaging")
static let Moya = TargetDependency.external(name: "Moya")
static let CombineMoya = TargetDependency.external(name: "CombineMoya")
static let ComposableArchitecture = TargetDependency.external(name: "ComposableArchitecture")
static let Kingfisher = TargetDependency.external(name: "Kingfisher")
static let KakaoSDK = TargetDependency.external(name: "KakaoSDK")
static let SwiftUIIntrospect = TargetDependency.external(name: "SwiftUIIntrospect")
static let Lottie = TargetDependency.external(name: "Lottie")
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ public extension ProjectDescription.Path {
return .relativeToRoot("Projects/Network")
}

static var dskit: Self {
return .relativeToRoot("Projects/DSKit")
}

static var core: Self {
return .relativeToRoot("Projects/Core")
}
Expand Down
28 changes: 27 additions & 1 deletion Plugins/EnvPlugin/ProjectDescriptionHelpers/InfoPlist.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,35 @@ public extension Project {
"CFBundleURLTypes": [
[
"CFBundleTypeRole": "Editor",
"CFBundleURLSchemes": ["keyme"]
"CFBundleURLSchemes": [
"keyme",
"kakao$(KAKAO_API_KEY)"
]
]
],
"API_BASE_URL": "$(API_BASE_URL)",
"KAKAO_API_KEY": "$(KAKAO_API_KEY)",
"BITLY_API_KEY": "$(BITLY_API_KEY)",
"UIUserInterfaceStyle": "Light",
"NSAppTransportSecurity": [
"NSExceptionDomains": [
"api.keyme.space": [
"NSIncludesSubdomains": true,
"NSExceptionMinimumTLSVersion": "TLSv1.2",
],
]
],
"LSApplicationQueriesSchemes": [
"kakaokompassauth",
"kakaolink",
"instagram",
"instagram-stories"
],
"NSPhotoLibraryUsageDescription": "์Šคํฌ๋ฆฐ์ƒท์„ ์ €์žฅํ•˜๊ธฐ ์œ„ํ•ด์„œ ์•จ๋ฒ” ์ ‘๊ทผ ๊ถŒํ•œ์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค",
"FirebaseAppDelegateProxyEnabled": false
]

static let baseUrlInfoPlist: [String: InfoPlist.Value] = [
"API_BASE_URL": "$(API_BASE_URL)",
]
}
7 changes: 5 additions & 2 deletions Plugins/EnvPlugin/ProjectDescriptionHelpers/Script.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@
import ProjectDescription

public extension Project {
static let script: [ProjectDescription.TargetScript] = [
static let lintScript: [ProjectDescription.TargetScript] = [
.pre(
path: .relativeToRoot("Scripts/lint.sh"),
name: "Lint codes",
basedOnDependencyAnalysis: false,
runForInstallBuildsOnly: true),
runForInstallBuildsOnly: false)
]

static let encryptionScript: [ProjectDescription.TargetScript] = [
.post(path: .relativeToRoot("Scripts/encrypt.sh"),
name: "Encrypt the secret files")
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import ProjectDescription
public extension SettingsDictionary {
static let baseSettings: Self = [
"OTHER_LDFLAGS" : [
"$(inherited)"
"$(inherited) -ObjC"
]
]
}
2 changes: 0 additions & 2 deletions Projects/Core/Sources/Example.swift

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//
// BidirectionalCasetIterable.swift
// Core
//
// Created by ์ด์˜๋นˆ on 2023/08/11.
// Copyright ยฉ 2023 team.humanwave. All rights reserved.
//

import Foundation

public extension CaseIterable where Self: Equatable, AllCases: BidirectionalCollection {
/// ์ด์ „ `case`๋ฅผ ๋ฐ˜ํ™˜ํ•ด์š”
func previous() -> Self {
let all = Self.allCases
let idx = all.firstIndex(of: self)!
let previous = all.index(before: idx)

if idx == all.startIndex {
return self
} else {
return all[previous]
}
}

/// ๋‹ค์Œ `case`๋ฅผ ๋ฐ˜ํ™˜ํ•ด์š”
func next() -> Self {
let all = Self.allCases
let idx = all.firstIndex(of: self)!
let next = all.index(after: idx)

if next == all.endIndex {
return self
} else {
return all[next]
}
}
}
16 changes: 16 additions & 0 deletions Projects/Core/Sources/Utility/Function/Comparable + Between.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// Between.swift
// Core
//
// Created by ์ด์˜๋นˆ on 2023/08/11.
// Copyright ยฉ 2023 team.humanwave. All rights reserved.
//

import Foundation

public extension Comparable {
/// `min` ๊ณผ `max` ์‚ฌ์ด์˜ ๊ฐ’๋งŒ ๋ฐ˜ํ™˜ํ•ด์ค˜์š”.
func between(min minValue: Self, max maxValue: Self) -> Self {
min(maxValue, max(minValue, self))
}
}
15 changes: 15 additions & 0 deletions Projects/Core/Sources/Utility/Function/Float + String.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// Float + String.swift
// Core
//
// Created by Young Bin on 2023/08/15.
// Copyright ยฉ 2023 team.humanwave. All rights reserved.
//

import Foundation

public extension Float {
func toString(floatingPoint: Int = 1) -> String {
String(format: "%.\(floatingPoint)f", self)
}
}
15 changes: 15 additions & 0 deletions Projects/Core/Sources/Utility/Function/Padding.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// Padding.swift
// Core
//
// Created by ๊น€์˜์ธ on 2023/08/17.
// Copyright ยฉ 2023 team.humanwave. All rights reserved.
//

import SwiftUI

public enum Padding {
public static func insets(top: CGFloat=0, leading: CGFloat=0, bottom: CGFloat=0, trailing: CGFloat=0) -> EdgeInsets {
return EdgeInsets(top: top, leading: leading, bottom: bottom, trailing: trailing)
}
}
46 changes: 46 additions & 0 deletions Projects/Core/Sources/Utility/Function/TCA+.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
//
// TCA+.swift
// Core
//
// Created by Young Bin on 2023/09/03.
// Copyright ยฉ 2023 team.humanwave. All rights reserved.
//

import ComposableArchitecture

private final class Ref<T: Equatable>: Equatable {
var val: T
init(_ v: T) {
self.val = v
}

static func == (lhs: Ref<T>, rhs: Ref<T>) -> Bool {
lhs.val == rhs.val
}
}

/// ์Šคํƒ ์˜ค๋ฒ„ํ”Œ๋กœ์šฐ ๋ฐฉ์ง€์šฉ ๋ž˜ํผ
/// ์ฐธ๊ณ : https://github.com/pointfreeco/swift-composable-architecture/discussions/488
@propertyWrapper
public struct Box<T: Equatable>: Equatable {
private var ref: Ref<T>

public init(_ x: T) {
self.ref = Ref(x)
}

public var wrappedValue: T {
get { ref.val }
set {
if !isKnownUniquelyReferenced(&ref) {
ref = Ref(newValue)
return
}
ref.val = newValue
}
}

public var projectedValue: Box<T> {
self
}
}
108 changes: 108 additions & 0 deletions Projects/Core/Sources/Utility/Interact/Haptic/HapticManager.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
//
// HapticManager.swift
// Keyme
//
// Created by ์ด์˜๋นˆ on 2023/08/11.
// Copyright ยฉ 2023 team.humanwave. All rights reserved.
//

import SwiftUI
import Foundation
import CoreHaptics

public class HapticManager {
public static let shared = HapticManager()

private var hapticEngine: CHHapticEngine?

init() {
self.hapticEngine = createEngine()
}

/// ๋ฒ„ํŠผ ๋ˆ„๋ฅด๋Š” ๋Š๋‚Œ์˜ ํ–…ํ‹ฑ
public func homeButtonTouchDown() {
let generator = UIImpactFeedbackGenerator(style: .heavy)
generator.prepare()
generator.impactOccurred()
}

/// ๋ฒ„ํŠผ ๋–ผ๋Š” ๋Š๋‚Œ์˜ ํ–…ํ‹ฑ
public func homeButtonTouchUp() {
let generator = UIImpactFeedbackGenerator(style: .medium)
generator.prepare()
generator.impactOccurred()
}

/// ๋˜๋ฅด๋ฅด...
public func unexpectedDelight() {
let generator = UINotificationFeedbackGenerator()
generator.prepare()
generator.notificationOccurred(.error)
}

/// ํ†ตํ†ต
public func tongtong() {
let generator = UINotificationFeedbackGenerator()
generator.prepare()
generator.notificationOccurred(.success)
}

/// ํ†ก
public func tok() {
let generator = UIImpactFeedbackGenerator(style: .rigid)
generator.prepare()
generator.impactOccurred()
}

/// ๋ถ•
public func boong() {
let generator = UIImpactFeedbackGenerator(style: .soft)
generator.prepare()
generator.impactOccurred()
}

/// ๋“œ๋ฅด๋ฅต
public func selectionChanged() {
let generator = UISelectionFeedbackGenerator()
generator.prepare()
generator.selectionChanged()
}

/// ํŒจํ„ด ์žฌ์ƒ(ํŒจํ„ด์€ ์ถ”ํ›„ ํ˜‘์˜ ํ›„ ๊ฐœ๋ฐœํ•ด์„œ ์ถ”๊ฐ€)
public func playHapticPattern() {
do {
try hapticEngine?.start()

let pattern = try createHapticPattern()
let player = try hapticEngine?.makePlayer(with: pattern)

try player?.start(atTime: 0)
} catch let error {
print("Error playing haptic pattern: \(error)")
}
}
}

private extension HapticManager {
func createEngine() -> CHHapticEngine? {
guard CHHapticEngine.capabilitiesForHardware().supportsHaptics else {
return nil
}

do {
return try CHHapticEngine()
} catch let error {
print("Error creating haptic engine: \(error)")
return nil
}
}

func createHapticPattern() throws -> CHHapticPattern {
let intensity = CHHapticEventParameter(parameterID: .hapticIntensity, value: 0.5)
let sharpness = CHHapticEventParameter(parameterID: .hapticSharpness, value: 1)

let events = [CHHapticEvent(eventType: .hapticTransient, parameters: [sharpness, intensity], relativeTime: 0)]

return try CHHapticPattern(events: events, parameters: [])
}
}
Loading

0 comments on commit 95dc63d

Please sign in to comment.