Skip to content

Instantly share code, notes, and snippets.

Avatar

Tomáš Slíž tomassliz

  • Prague, Czech Republic
View GitHub Profile
@tomassliz
tomassliz / TestFlightHelper.swift
Created Feb 8, 2019
Check if the app is installed from TestFlight
View TestFlightHelper.swift
// Should be working for free apps too
func isTestFlight() -> Bool {
guard let appStoreReceiptURL = Bundle.main.appStoreReceiptURL else {
return false
}
return appStoreReceiptURL.lastPathComponent == "sandboxReceipt"
}
View keybase.md

Keybase proof

I hereby claim:

  • I am tomassliz on github.
  • I am tomassliz (https://keybase.io/tomassliz) on keybase.
  • I have a public key ASCT7g3K-mjV0jwLfN60NxsyktG8AjbO9T3eE8egoBf9rQo

To claim this, I am signing this object:

View gist:a4630898ccce52e97e2c
CompileSwift normal x86_64 /Users/deny/Desktop/ExampleApp/ExampleApp/ViewController.swift
cd /Users/deny/Desktop/ExampleApp
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file /Users/deny/Desktop/ExampleApp/ExampleApp/ViewController.swift /Users/deny/Desktop/ExampleApp/ExampleApp/AppDelegate.swift -target x86_64-apple-ios8.3 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.3.sdk -I /Users/deny/Library/Developer/Xcode/DerivedData/ExampleApp-goerkbjmunjsnkcerylpquuuwibk/Build/Products/Debug-iphonesimulator -F /Users/deny/Library/Developer/Xcode/DerivedData/ExampleApp-goerkbjmunjsnkcerylpquuuwibk/Build/Products/Debug-iphonesimulator -g -module-cache-path /Users/deny/Library/Developer/Xcode/DerivedData/ModuleCache -serialize-debugging-options -Xcc -I/Users/deny/Library/Developer/Xcode/DerivedData/ExampleApp-goerkbjmunjsnkcerylpquuuwibk/Build/Intermediat
@tomassliz
tomassliz / viewController.m
Last active Aug 29, 2015
BOOL value behaviour with high optimization level
View viewController.m
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
BOOL isMember = NO; // here must be variable set to no, otherwise is initialized to thrash
for (NSIndexPath *ip in self.expandedCells) {
if ([ip isEqualToIndexPath:indexPath]) {
isMember = YES;
break;
}
}
@tomassliz
tomassliz / number_of_lines.sh
Last active Jan 2, 2016
Terminal command for showing Objective-C implementation files sorted by number of lines.
View number_of_lines.sh
find . -name "*.m" -exec wc -l "{}" \; | sort -n
@tomassliz
tomassliz / Objective-C tricks
Last active Dec 24, 2015
Better singleton shared instance creation with use of GCD in Objective-C.
View Objective-C tricks
+ (instancetype)sharedInstance {
static TSClass *sharedInstance = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sharedInstance = [[self alloc] init];
});
return sharedInstance;
}
You can’t perform that action at this time.