Skip to content

Instantly share code, notes, and snippets.

View DargonLee's full-sized avatar
🎯
Focusing

Harlans DargonLee

🎯
Focusing
View GitHub Profile
@DargonLee
DargonLee / macOS的UI层级关系.swift
Last active July 6, 2022 02:10
通过storyboard创建WindowController
let mainWindow = NSApplication.shared.mainWindow
mainWindow?.isReleasedWhenClosed = true
mainWindow?.close()
let storyboard = NSStoryboard(name: NSStoryboard.Name("Main"), bundle: nil)
let windowVC = storyboard.instantiateController(withIdentifier: NSStoryboard.SceneIdentifier("RootWindowViewController")) as! NSWindowController
windowVC.window?.makeKeyAndOrderFront(nil)
NSRect rect = CGRectMake(315, 344, 760, 548);
NSWindowStyleMask style = NSWindowStyleMaskBorderless | NSWindowStyleMaskNonactivatingPanel;
NSPanel *panel = [[NSPanel alloc] initWithContentRect:rect styleMask:style backing:NSBackingStoreBuffered defer:YES screen:[NSScreen mainScreen]];
panel.level = NSFloatingWindowLevel;
// panel.level = NSScreenSaverWindowLevel;
panel.collectionBehavior = NSWindowCollectionBehaviorCanJoinAllSpaces | NSWindowCollectionBehaviorFullScreenAuxiliary;
[panel orderFrontRegardless];
!block ?: block()
!completionHandler ? nil : completionHandler(error);
pod 'JLRoutes' //每次都获取最新版本
pod 'JLRoutes', '~>0' //高于0的版本
pod 'JLRoutes', '~> 0.1.2' //使用大于等于0.1.2但小于0.2的版本
pod 'JLRoutes', '~>0.1' //使用大于等于0.1但小于1.0的版本一个效果,都表示使用最新版本
pod 'JLRoutes', '2.0' //只使用2.0版本
pod 'JLRoutes', '= 2.0' //只使用2.0版本
pod 'JLRoutes', '> 2.0' //使用高于2.0的版本
if [ "${ACTION}" = "build" ]
then
INSTALL_DIR=${SRCROOT}/Products/${PROJECT_NAME}.framework
DEVICE_DIR=${BUILD_ROOT}/${CONFIGURATION}-iphoneos/${PROJECT_NAME}.framework
SIMULATOR_DIR=${BUILD_ROOT}/${CONFIGURATION}-iphonesimulator/${PROJECT_NAME}.framework
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import json
g_build_sdp = "YES"
with open("config.json", "r+") as jsonFile:
data = json.load(jsonFile)
if g_build_sdp == "YES":
data["file-plugin"][1]["force"] = "true"
jsonFile.seek(0) # rewind
if [ "${ACTION}" = "build" ]
then
INSTALL_DIR=${SRCROOT}/Products/${PROJECT_NAME}.framework
DEVICE_DIR=${BUILD_ROOT}/${CONFIGURATION}-iphoneos/${PROJECT_NAME}.framework
SIMULATOR_DIR=${BUILD_ROOT}/${CONFIGURATION}-iphonesimulator/${PROJECT_NAME}.framework
- (void)addVolumeObserver
{
AVAudioSession *audioSession = [AVAudioSession sharedInstance];
NSError *error = nil;
[audioSession setActive:YES error:&error];
if (error) {
NSLog(@"%@", error);
}
[audioSession addObserver:self forKeyPath:@"outputVolume" options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld context:NULL];
func rtfDataToHtmlData(data: Data) -> Data? {
let attributedString = NSAttributedString(rtf: data, documentAttributes: nil)!
do {
let htmlData = try attributedString.data(from: NSRange(location: 0, length: attributedString.length), documentAttributes: [NSAttributedString.DocumentAttributeKey.documentType:NSAttributedString.DocumentType.html])
return htmlData
} catch {
}
return nil
}
name: Flutter_iOS
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build_ios: