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
@propertyWrapper | |
public final class ThreadSafe<T> { | |
// MARK: Lifecycle | |
public init(wrappedValue: T) { | |
self.value = wrappedValue | |
} | |
// MARK: Public |
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
// | |
// UIViewController+Popover.swift | |
// HomeMate | |
// | |
// Created by zhangwen on 2023/6/29. | |
// Copyright © 2023 Legrand Intelligent Electrical (Huizhou) Co., Ltd. All rights reserved. | |
// | |
import UIKit |
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 | |
// 事件 | |
@objcMembers | |
class EPEvent: NSObject { | |
/// 事件 id,唯一 | |
private(set) var id: String = "" | |
/// 对象参数 | |
private(set) var object: Any? |
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
// | |
// DependencyContainer.swift | |
// DependencyContainer | |
// | |
// Created by zhangwen on 2023/11/1. | |
// | |
import Foundation | |
@objc | |
class DependencyContainer: NSObject { |
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
" Don't try to be vi compatible | |
set nocompatible | |
" Helps force plugins to load correctly when it is turned back on below | |
filetype off | |
" TODO: Load plugins here (pathogen or vundle) | |
" Turn on syntax highlighting | |
syntax on |
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
// | |
// RxPermission.swift | |
// | |
// Copyright (c) 2016 Sunshinejr <[email protected]> | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is |
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
// iOS 11 之后的方法,来自: https: // www.appcoda.com/rounded-corners-uiview/ | |
// layerMaxXMaxYCorner – lower right corner | |
// layerMaxXMinYCorner – top right corner | |
// layerMinXMaxYCorner – lower left corner | |
// layerMinXMinYCorner – top left corner | |
func roundCorners(cornerRadius: Double) { | |
self.layer.cornerRadius = CGFloat(cornerRadius) | |
self.clipsToBounds = true |
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
APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}" | |
if [ "${CONFIGURATION}" == "Release" ]; then | |
# This script loops through the frameworks embedded in the application and | |
# removes unused architectures. | |
find "$APP_PATH" -name '*.framework' -type d | while read -r FRAMEWORK | |
do | |
FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable) | |
FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME" | |
echo "Executable is $FRAMEWORK_EXECUTABLE_PATH" |
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
# /usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# 同级目录下面包含 Localizable.strings 或者 InfoPlist.strings,把strings文件的注释都去掉 | |
# cnFile 参数修改需要翻译Localizable还是InfoPlist | |
# 到Google翻译API页面申请Key(https://cloud.google.com/translate/v2/quickstart),送300美刀,免费2个月 | |
# 安装google-api-python-client (https://developers.google.com/api-client-library/python/apis/translate/v2) | |
# pip install --upgrade google-api-python-client | |
# 会自动生成对应的.lproj目录 | |
# 注意: 葡萄牙语、繁体中文的语言缩写分别是pt和zh-TW,这个和Xcode的目录有点区别,其他语言都一样 |
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
# /usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# 同级目录下面包含 Localizable.strings 或者 InfoPlist.strings,把strings文件的注释都去掉 | |
# cnFile 参数修改需要翻译Localizable还是InfoPlist | |
# 到百度翻译API页面申请免费的appid和secretKey(http://api.fanyi.baidu.com/api/trans/product/index) | |
# 百度翻译每月翻译字符数低于200万,享免费服务 | |
# 会自动生成对应的.lproj目录 | |
import httplib |