This file contains hidden or 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 | |
import Charts | |
struct ChartData: Identifiable { | |
var day: String | |
var value: Double | |
var id: String { day } | |
static var mock = [ |
This file contains hidden or 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
// | |
// LicenseView.swift | |
// CompressX | |
// | |
// Created by Dinh Quang Hieu on 06/01/2024. | |
// | |
import SwiftUI | |
struct LicenseView: View { |
This file contains hidden or 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
// | |
// LicenseManager.swift | |
// CompressX | |
// | |
// Created by Dinh Quang Hieu on 06/01/2024. | |
// | |
import Foundation | |
import SwiftUI | |
import IOKit |
This file contains hidden or 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 FolderMonitor { | |
private var monitoredFolderURL: URL | |
private var folderMonitorQueue: DispatchQueue | |
private var folderMonitorSource: DispatchSourceFileSystemObject? | |
private var lastFileList: [String] = [] | |
init(folderURL: URL) { | |
self.monitoredFolderURL = folderURL |
This file contains hidden or 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
struct ContentView: View { | |
@State private var isActive = false | |
@State private var isPressing = false | |
@State var scale: CGFloat = 1 | |
@State var count = 0 | |
var body: some View { | |
ZStack { | |
Circle() |
This file contains hidden or 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
struct ContentView: View { | |
@State var scale: CGFloat = 0 | |
@State var showingBlankHeart = true | |
@State var heartScale: CGFloat = 0 | |
@State var textOpacity: Double = 1 | |
@State var offset1: CGFloat = 0 | |
@State var plus1Opacity: Double = 1 | |
@State var offset2: CGFloat = 0 | |
@State var plus2Opacity: Double = 1 |
This file contains hidden or 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
public func setTitle(_ title: String? = nil, subTitle: String? = nil, content: String? = nil) { | |
_titleLabel.text = title | |
_subTitleLabel.text = subTitle | |
_contentLabel.text = content | |
updateFrame() | |
} | |
private func updateFrame() { | |
let titleLabelSize = _titleLabel.sizeThatFits(CGSize(width: _titleLabel.frame.width, height: 9999)) |
This file contains hidden or 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
private func setupComponents() { | |
_titleLabel = UILabel(frame: .zero) | |
_titleLabel.textColor = UIColor.black | |
_titleLabel.numberOfLines = 0 | |
_titleLabel.backgroundColor = UIColor.red | |
addSubview(_titleLabel) | |
_subTitleLabel = UILabel(frame: .zero) | |
_subTitleLabel.textColor = UIColor.black | |
_subTitleLabel.numberOfLines = 0 |
This file contains hidden or 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
myView = MyView(title: "Lorem Ipsum is simply dummy text of the printing", subTitle: "Lorem Ipsum is simply dummy text of the printing", content: "Lorem Ipsum is simply dummy text of the printing") | |
self.view.addSubview(myView) | |
myView.snp.makeConstraints { (make) in | |
make.width.equalToSuperview().multipliedBy(0.5) | |
make.centerX.centerY.equalToSuperview() | |
} |
This file contains hidden or 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 SnapKit | |
class MyView: UIView { | |
private var _titleLabel: UILabel! | |
private var _subTitleLabel: UILabel! | |
private var _contentLabel: UILabel! | |
init(title: String? = nil, subTitle: String? = nil, content: String? = nil) { |
NewerOlder