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
a: AM/PM | |
A: 0~86399999 (Millisecond of Day) | |
c/cc: 1~7 (Day of Week) | |
ccc: Sun/Mon/Tue/Wed/Thu/Fri/Sat | |
cccc: Sunday/Monday/Tuesday/Wednesday/Thursday/Friday/Saturday | |
d: 1~31 (0 padded Day of Month) | |
D: 1~366 (0 padded Day of Year) | |
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
// setup your collectionView | |
private let collectionView: UICollectionView = { | |
let layout = UICollectionViewFlowLayout() | |
layout.scrollDirection = .horizontal | |
layout.minimumInteritemSpacing = 20.0 | |
layout.minimumLineSpacing = 20.0 | |
// important! | |
layout.itemSize = UICollectionViewFlowLayout.automaticSize | |
// change estimatedItemSize for a vertical example | |
layout.estimatedItemSize = CGSize(width: UIScreen.main.bounds.width, height: 40.0) |
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 | |
# Delete Archived Applications | |
rm -r ~/Library/Developer/Xcode/Archives/*/ | |
# Delete Devired Data | |
rm -r ~/Library/Developer/Xcode/DerivedData/*/ | |
# Delete Apple cached files | |
rm -r ~/Library/Developer/CoreSimulator/Caches/dyld/*/*/ |
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
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${PROJECT_DIR}/${INFOPLIST_FILE}") | |
buildNumber=$(($buildNumber + 1)) | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/${INFOPLIST_FILE}" |
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
run in terminal | |
defaults write com.apple.dt.Xcode IDEAdditionalCounterpartSuffixes -array-add "ViewModel" "ViewController" "Coordinator" "Repository" | |
close Xcode and open it again. | |
jump by using Ctrl+Cmd+Up and Ctrl+Cmd+Down | |
if you want to revert the change | |
defaults delete com.apple.dt.Xcode IDEAdditionalCounterpartSuffixes | |
ref: https://gist.github.com/danielmartin/8411c303e5c8702c19c65950b49635b8 |
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
// camera roll folder simulator | |
~/Library/Developer/CoreSimulator/Devices/<device UDID>/data/Media/DCIM/100APPLE | |
// | |
~/Library/Developer/CoreSimulator/Devices/991FCB82-FA99-4C9E-AA2A-B8A6A33034B3/data/Media/DCIM/100APPLE | |
// Document Directory | |
~/Library/Developer/CoreSimulator/Devices/991FCB82-FA99-4C9E-AA2A-B8A6A33034B3/data/Containers/Data/Application/0A893DFE-05BC-44E7-9C65-314871273441/Documents | |
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
let obs1 = Observable.just(FakeObject(blood: [0,1], producers: [100,101])) | |
let obs2 = Observable.just(FakeObject(blood: [3,4], producers: [300,401])) | |
let objs = [Observable.just(obs1), Observable.just(obs2)] | |
// [Observable<Observable[FakeObject]>] to [FakeObject] | |
Observable.combineLatest(vitals) | |
.flatMap { Observable.combineLatest($0) } |
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
// convert audio on mac for iOS | |
// afconvert -d [out data format] -f [out file format] [in file] [out file] | |
afconvert -d aac -f 'caff' -b 128000 background-music-lei.caf test_128.caf | |
afconvert -d aac -f 'caff' -b 32000 background-music-lei.caf test_32.caf | |
afconvert -d aac -f 'caff' background-music-lei.caf test_32.caf | |
// best formats | |
If space is not an issue, just encode everything with linear PCM. Not only is this the fastest way for your audio to play, but you can play multiple sounds simultaneously without running into any CPU resource issues. |
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
plutil -convert json Data.plist -o Data.json | |
plutil -convert xml1 Data.json -o Data.plist |
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
xcrun simctl delete unavailable |
NewerOlder