Skip to content

Instantly share code, notes, and snippets.

View bergusman's full-sized avatar
:octocat:
Hard working

Vitaly Berg bergusman

:octocat:
Hard working
View GitHub Profile

Generate the list yourself:

$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/
  Developer/SDKs/iPhoneOS*.sdk/System/Library/Frameworks/UIKit.framework/Headers
$ grep -H UI_APPEARANCE_SELECTOR ./* | sed 's/ __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_5_0) UI_APPEARANCE_SELECTOR;//'

UIActivityIndicatorView

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
SEL selector = @selector(makeWonderfulWithString:number:);
NSMethodSignature *methodSignature = [self methodSignatureForSelector:selector];
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:methodSignature];
[invocation setSelector:selector];
[invocation invokeWithTarget:self];
[invocation setTarget:self];
[invocation invoke];
---
language: objective-c
before_script:
- ./scripts/travis/add-key.sh
after_script:
- ./scripts/travis/remove-key.sh
after_success:
- ./scripts/travis/testflight.sh
env:
global:
#!/bin/sh
# Current as working as of 2012/4/17
# Xcode 4.3.2
PROJECT_ROOT="$HOME/SomeDirWhereYourProjectLives/XXXXXXXX"
WORKSPACE="$PROJECT_ROOT/XXXXXXXX.xcodeproj/project.xcworkspace"
CONFIG="AdHoc"
SCHEME="XXXXXXXX"
button.imageEdgeInsets = UIEdgeInsetsMake(0, button.titleLabel.frame.size.width, 0, -button.titleLabel.frame.size.width);
button.titleEdgeInsets = UIEdgeInsetsMake(0, -button.imageView.frame.size.width, 0, button.imageView.frame.size.width);
#import <Foundation/Foundation.h>
#if __IPHONE_OS_VERSION_MIN_REQUIRED < 80000
@interface NSString (PSPDFModernizer)
// Added in iOS 8, retrofitted for iOS 7
- (BOOL)containsString:(NSString *)aString;
@end
@bergusman
bergusman / rubles.m
Created September 22, 2015 20:14
Load Ruble Rates
- (void)loadRatesWithCompletion:(void (^)(NSNumber *usd, NSNumber *eur, NSError *error))completion {
NSURL *url = [NSURL URLWithString:@"https://query.yahooapis.com/v1/public/yql?q=select+*+from+yahoo.finance.xchange+where+pair+=+%22USDRUB,EURRUB%22&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback="];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url];
[[[NSURLSession sharedSession] dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
dispatch_async(dispatch_get_main_queue(), ^{
if (error) {
if (completion) {
completion(nil, nil, error);
}
@bergusman
bergusman / AddPassButton.swift
Created August 22, 2016 11:58
Add Pass Button
private func setupAddPassButton() {
let button = PKAddPassButton(style: .BlackOutline)
button.addTarget(self, action: #selector(passTouchUpInside), forControlEvents: .TouchUpInside)
button.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(button)
button.centerXAnchor.constraintEqualToAnchor(view.centerXAnchor).active = true
button.centerYAnchor.constraintEqualToAnchor(view.centerYAnchor).active = true
}
@bergusman
bergusman / TabBar.swift
Created February 28, 2020 17:24
UITabBar with custom height
class TabBar: UITabBar {
override func sizeThatFits(_ size: CGSize) -> CGSize {
guard let window = UIApplication.shared.keyWindow else {
return super.sizeThatFits(size)
}
var sizeThatFits = super.sizeThatFits(size)
sizeThatFits.height = 58 + window.safeAreaInsets.bottom
return sizeThatFits
}
}
@bergusman
bergusman / SetupTabBar.swift
Last active February 29, 2020 10:58
Fully transparent UITabBar
if #available(iOS 13.0, *) {
tabBar.standardAppearance.configureWithTransparentBackground()
} else {
tabBar.backgroundImage = UIImage()
tabBar.shadowImage = UIImage()
}