Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/iOS/dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
chopmozzi committed Nov 30, 2023
2 parents 4c34394 + f270691 commit 65d5d02
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
4 changes: 4 additions & 0 deletions iOS/Layover/Layover.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
836C339C2B1843BE00ECAFB0 /* SettingSceneModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = 836C33962B1843BE00ECAFB0 /* SettingSceneModels.swift */; };
836C339D2B1843BE00ECAFB0 /* SettingSceneViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 836C33972B1843BE00ECAFB0 /* SettingSceneViewController.swift */; };
836C339E2B1843BE00ECAFB0 /* SettingSceneInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 836C33982B1843BE00ECAFB0 /* SettingSceneInteractor.swift */; };
836C33872B15A29600ECAFB0 /* Toast.swift in Sources */ = {isa = PBXBuildFile; fileRef = 836C33862B15A29600ECAFB0 /* Toast.swift */; };
83C35E1B2B108C3500D8DD5C /* PlaybackView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C35E1A2B108C3500D8DD5C /* PlaybackView.swift */; };
83C35E1E2B10923C00D8DD5C /* PlaybackCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C35E1D2B10923C00D8DD5C /* PlaybackCell.swift */; };
FC2511A02B045C0A004717BC /* SignUpInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC25119F2B045C0A004717BC /* SignUpInteractor.swift */; };
Expand Down Expand Up @@ -197,6 +198,7 @@
836C33962B1843BE00ECAFB0 /* SettingSceneModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingSceneModels.swift; sourceTree = "<group>"; };
836C33972B1843BE00ECAFB0 /* SettingSceneViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingSceneViewController.swift; sourceTree = "<group>"; };
836C33982B1843BE00ECAFB0 /* SettingSceneInteractor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingSceneInteractor.swift; sourceTree = "<group>"; };
836C33862B15A29600ECAFB0 /* Toast.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Toast.swift; sourceTree = "<group>"; };
83C35E1A2B108C3500D8DD5C /* PlaybackView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlaybackView.swift; sourceTree = "<group>"; };
83C35E1D2B10923C00D8DD5C /* PlaybackCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlaybackCell.swift; sourceTree = "<group>"; };
FC25119F2B045C0A004717BC /* SignUpInteractor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignUpInteractor.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -366,6 +368,7 @@
children = (
19743C042B06940D001E405A /* PlayerView.swift */,
19E79ABF2B0A85D0009EA9ED /* LoopingPlayerView.swift */,
836C33862B15A29600ECAFB0 /* Toast.swift */,
);
path = UIComponents;
sourceTree = "<group>";
Expand Down Expand Up @@ -812,6 +815,7 @@
1972CCDF2B14C9B000C3C762 /* Notification.Name+.swift in Sources */,
FC2511AF2B04EAD9004717BC /* MapPresenter.swift in Sources */,
19AACFCA2B0F7C3B0088143E /* Response.swift in Sources */,
836C33872B15A29600ECAFB0 /* Toast.swift in Sources */,
FC767F972B1224B80088CF9B /* IntroduceDTO.swift in Sources */,
1972CCD42B138E6B00C3C762 /* SignUpRouter.swift in Sources */,
FC5BE11C2B148D160036366D /* EditProfilePresenter.swift in Sources */,
Expand Down
39 changes: 39 additions & 0 deletions iOS/Layover/Layover/Scenes/UIComponents/Toast.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//
// Toast.swift
// Layover
//
// Created by 황지웅 on 11/28/23.
// Copyright © 2023 CodeBomber. All rights reserved.
//

import UIKit

final class Toast {
static let shared = Toast()

private init() {}

func showToast(message: String) {
let scenes: Set<UIScene> = UIApplication.shared.connectedScenes
let windowScene: UIWindowScene? = scenes.first as? UIWindowScene
guard let window: UIWindow = windowScene?.windows.first else { return }
let toastLabel: UILabel = UILabel()
toastLabel.backgroundColor = .background
toastLabel.textColor = .layoverWhite
toastLabel.textAlignment = .center
toastLabel.font = .loFont(type: .body2)
toastLabel.text = message
toastLabel.layer.cornerRadius = 8
toastLabel.clipsToBounds = true
toastLabel.numberOfLines = 1
toastLabel.layer.opacity = 0.8
toastLabel.frame.size = toastLabel.intrinsicContentSize
window.addSubview(toastLabel)
toastLabel.center = window.center
UIView.animate(withDuration: 2.0, delay: 0.1, options: .curveEaseOut, animations: {
toastLabel.alpha = 0.0
}, completion: { _ in
toastLabel.removeFromSuperview()
})
}
}

0 comments on commit 65d5d02

Please sign in to comment.