Skip to content

Instantly share code, notes, and snippets.

View OgreSwamp's full-sized avatar

Alexey Rashevskiy OgreSwamp

View GitHub Profile

Keybase proof

I hereby claim:

  • I am ogreswamp on github.
  • I am ogreswamp (https://keybase.io/ogreswamp) on keybase.
  • I have a public key ASDKZSZNFoLATQmHURI30vvQcKh_X8b9KXUxyXSRcu4z8Qo

To claim this, I am signing this object:

@OgreSwamp
OgreSwamp / UIAppearance.swift
Created October 28, 2015 13:01
Swift UIAppearance protocol definition
protocol UIAppearance : NSObjectProtocol {
/* To customize the appearance of all instances of a class, send the relevant appearance modification messages to the appearance proxy for the class. For example, to modify the bar tint color for all UINavigationBar instances:
[[UINavigationBar appearance] setBarTintColor:myColor];
Note for iOS7: On iOS7 the tintColor property has moved to UIView, and now has special inherited behavior described in UIView.h.
This inherited behavior can conflict with the appearance proxy, and therefore tintColor is now disallowed with the appearance proxy.
*/
static func appearance() -> Self
/* To customize the appearances for instances of a class contained within an instance of a container class, or instances in a hierarchy, use +appearanceWhenContainedIn: for the appropriate appearance proxy. For example:
@OgreSwamp
OgreSwamp / JapanTrip2015.md
Last active August 29, 2015 14:12
Japan Trip 2015

Feb 21

11am - 5pm Hakuba - Hikone transfer check in, dinner and bar in Hikone 1st night in Hikone

Feb 22

sightseeing - add your places here 2nd night in Hikone

Feb 23

11am - 12am Transfer to Kyoto 13am Check in

@OgreSwamp
OgreSwamp / gist:07b23da18ffa593c0786
Created May 28, 2014 00:10
Wrong Constraints update
- (void)updateConstraints
{
[super updateConstraints];
if (UIDeviceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation))
{
self.tableViewWidth.constant = CGRectGetWidth(self.frame) - 80;
self.toolbarViewWidth.constant = 80;
self.toolbarViewHeight.constant = CGRectGetHeight(self.frame);
self.tableViewHeight.constant = CGRectGetHeight(self.frame);
- (void)updateConstraints
{
[super updateConstraints];
if (UIDeviceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation))
{
self.tableViewWidth.constant = CGRectGetWidth(self.frame) - 80;
self.toolbarViewWidth.constant = 80;
self.toolbarViewHeight.constant = CGRectGetHeight(self.frame);
self.tableViewHeight.constant = CGRectGetHeight(self.frame);
#########################
# .gitignore file for Xcode4 / OS X Source projects
#
# Version 2.0
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
# 2013 updates:
# - fixed the broken "save personal Schemes"
#
# NB: if you are storing "built" products, this WILL NOT WORK,
@OgreSwamp
OgreSwamp / MainStoryboard.strings
Created March 12, 2013 17:43
XCakeLab4: Storyboard strings (translated)
/* Class = "IBUILabel"; text = "Copyright"; ObjectID = "0rh-Ht-geb"; */
"0rh-Ht-geb.text" = "Копирайт";
/* Class = "IBUILabel"; text = "Title"; ObjectID = "6ik-qM-3Vq"; */
"6ik-qM-3Vq.text" = "Название";
/* Class = "IBUILabel"; text = "Title"; ObjectID = "A6P-vz-oc8"; */
"A6P-vz-oc8.text" = "Название";
@OgreSwamp
OgreSwamp / DetailViewController.m
Last active December 14, 2015 20:38
XCakeLab4: Formatted currency
NSNumberFormatter * formatter = [[NSNumberFormatter alloc] init];
[formatter setNumberStyle:NSNumberFormatterCurrencyStyle];
formatter.currencyCode = @"EUR";
self.priceLabel.text = [formatter stringFromNumber:self.book.price];
@OgreSwamp
OgreSwamp / DetailViewController.m
Last active December 14, 2015 20:38
XCakeLab4: Dynamic Labels
-(UILabel *)createLabelWithFrame:(CGRect)frame alignement:(UITextAlignment)alignement text:(NSString *)text {
UILabel *label = [[UILabel alloc] initWithFrame:frame];
label.font = [UIFont fontWithName:@"Noteworthy" size:20];
label.text = text;
label.textColor = [UIColor whiteColor];
label.backgroundColor = [UIColor clearColor];
label.textAlignment = alignement;
label.lineBreakMode = NSLineBreakByWordWrapping;
label.numberOfLines = 0;
CGSize labelSize = [label.text sizeWithFont:label.font
@OgreSwamp
OgreSwamp / Localizable.strings
Last active December 14, 2015 20:38
XCakeLab4: Localized version of the ru.lproj/Localizable.strings for CoreDataBooks example
/* display name for author */
"author" = "автор";
/* display name for copyright */
"copyright" = "копирайт";
/* Info view title */
"Info" = "Информация";
/* display name for price */