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
1. Application does not run in background | |
(键名:UIApplicationExistsOnSuspend) | |
自从iOS4.0之后,当你在应用程序执行的时候按下Home键,应用程序并不会中断目前的应用,而是放到后台去了。 | |
因此希望使用者在按下Home键之后就要退出当前应用的请勾选这个选项。 | |
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
给数字加上千位分隔符,对于金钱的余额,甚至还需要加上¥或者$的符号: | |
- (NSString *)formattedNumber: (double)number { | |
NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc]init]; | |
[numberFormatter setFormatterBehavior:NSNumberFormatterBehavior10_4]; | |
[numberFormatter setNumberStyle:NSNumberFormatterDecimalStyle]; | |
NSString *numberString = [numberFormatter stringFromNumber:[NSNumber numberWithDouble:number]]; | |
NSLog(@"%@",numberString); | |
return numberString; | |
} |
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
``` | |
var videos = document.querySelectorAll("video"); | |
for (var video of videos) { | |
video.playbackRate = 1.5; | |
} | |
``` |
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
#!/bin/bash | |
# 定义用到的变量 | |
project_path="" | |
# 定义读取输入字符的函数 | |
function getProjectPath() { | |
# 输出换行,方便查看 | |
echo "================================================" | |
# 监听输入并且赋值给变量 |
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
#!/bin/bash | |
# 定义用到的变量 | |
project_path="" | |
# 定义读取输入字符的函数 | |
function getProjectPath() { | |
# 输出换行,方便查看 | |
echo "================================================" | |
# 监听输入并且赋值给变量 |
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
[ | |
"facebook.com", | |
"twitter.com", | |
"youtube.com", | |
"google.com", | |
"instagram.com", | |
"linkedin.com", | |
"plus.google.com", | |
"gmpg.org", | |
"pinterest.com", |
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
extension UIApplication { | |
public var currentKeyWindow: UIWindow? { | |
if #available(iOS 13.0, *) { | |
if let window = connectedScenes | |
.filter({ $0.activationState == .foregroundActive }) | |
.map({ $0 as? UIWindowScene }) | |
.compactMap({ $0 }) | |
.first?.windows | |
.filter({ $0.isKeyWindow }).first { | |
return window |
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
#!/usr/bin/env python3 | |
import sqlite3 | |
def write_file(data, filename): | |
'''Convert binary data and write it on Hard Disk''' | |
with open(filename, 'wb') as file: | |
file.write(data) | |
print(f"Stored blob data into:{filename}\n") | |
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
OC | |
``` | |
if ([[NSBundle mainBundle] pathForResource:@"embedded" ofType:@"mobileprovision"]) { | |
// TestFlight | |
} else { | |
// App Store (and Apple reviewers too) | |
} | |
BOOL isRunningTestFlightBeta = [[[[NSBundle mainBundle] appStoreReceiptURL] lastPathComponent] isEqualToString:@"sandboxReceipt"]; | |
``` |
OlderNewer