This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct PopoutAlertView: View { | |
let lightTapticGenerator = UIImpactFeedbackGenerator(style:.light) | |
@State private var isHidden = true | |
var title = "Alert" | |
var content = "Content here" | |
var tintColor = UIColor.red |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################################################## | |
# iTunes API Sources Script for Mp3Tag # | |
# # | |
#version 1.1 # | |
#created by Megabits in 2019 # | |
######################################################## | |
######################################################## | |
# SEARCH BY DIALOG # | |
######################################################## |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
import SwiftUI | |
fileprivate var currentOverCurrentContextUIHost: UIHostingController<AnyView>? = nil | |
extension View { | |
public func overCurrentContext( | |
isPresented: Binding<Bool>, | |
showWithAnimation: Bool = false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
class Calculator { | |
enum Operator: String, CaseIterable { | |
case add = "+" | |
case subtract = "-" | |
case multiply = "*" | |
case divide = "/" | |
case power = "^" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ContentView.swift | |
// StatusBarTest | |
// | |
// Created by hiroki on 2021/02/11. | |
// | |
import SwiftUI | |
struct ContentView: View { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Usage | |
@SavedInDefaults(defaultValue: "foo", group: "group.foo", namespace: "bar") | |
var fooBar: String | |
// Expanded --- | |
{ | |
get { | |
if let savedValue = UserDefaults(suiteName: "group.foo")!.object(forKey: "bar.fooBar") as? String { | |
return savedValue | |
} else { | |
return "foo" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SwiftUI alert has so many problems. Use UIKit instead. | |
import UIKit | |
struct UIAlertControllerWrapper { | |
static func present(alert: UIAlertController) { | |
if let scene = UIApplication.shared.connectedScenes.first as? UIWindowScene, let root = scene.windows.first?.rootViewController { | |
var nextViewController = root | |
while nextViewController.presentedViewController != nil { | |
nextViewController = nextViewController.presentedViewController! |