-rw-r--r-- 1.2K Mar 27, 2012 · 6966626 · ~2 min

This Day for iPad 1.1

ios этот день

Этот день

Version 1.1 of This Day for iPad has been released. At first I wanted to add swipe navigation for events and fix a few small things, but somehow it dragged on. When I finally coded it, I had to reject the app from the App Store 2 or 3 times because I kept finding nasty bugs that made it crash or display incorrectly. By the time I had fixed everything critical, the new iPad had come out, so I added graphics for it right after that. And at the very end I discovered that sharing to VK requires a captcha, so I had to google it and implement its handling.

So in the end, what started as small changes turned into a pretty substantial changelog for such an app:

  • support for iPad with Retina display;
  • events can now be swiped with a finger;
  • when publishing an event to Facebook or VKontakte, the app now shows a notification that the publication succeeded;
  • when publishing events to Facebook or VKontakte, they are now posted in a more understandable form with the full date;
  • captcha handling for posting to VKontakte added;
  • fixed a bug that prevented long events from being published;
  • minor improvements and bug fixes.
[↵] open page etot-den-dlya-ipad-1-1.md
-rw-r--r-- 733B Mar 22, 2012 · 52877BF · ~1 min

AllCafe for iPhone 2.0

ios allcafe приложения

AllCafe для iPhone

AllCafe for iPhone 2.0 has been released.

What is new in version 2.0

  • New restaurant info layout;
  • viewing restaurant photos;
  • new restaurant news layout;
  • viewing photos attached to news items;
  • new restaurant review layout;
  • viewing photos in a review and all photos from all visitor reviews;
  • restaurant magazines added;
  • various fixes and additions.
[↵] open page allcafe-dlya-iphone-2-0.md
-rw-r--r-- 2.2K Mar 20, 2012 · E6D74F1 · ~2 min

How to detect a Retina Display on iPad/iPhone

ios objective-c ipad retina шпаргалки

Note! If you just need to figure out what kind of screen your iPad, iPhone, or iPod has, simply follow this link: https://arm1.ru/retina/

While trying to figure out how to detect the presence of a Retina display on a device in Objective-C, I had to do some googling. I found this solution and am writing it down here as a cheat sheet.

Get the screen bounds:

CGRect screenBounds = [[UIScreen mainScreen] bounds];

It returns the screen size, usually 320x480; even on iPhone 4, iPhone 4S, and iPod Touch it will still return 320x480 (apparently because old apps would otherwise crash). For iPad it returns 768x1024 — both on iPad/iPad 2 and on the new iPad with Retina Display.

Get the screen scale:

CGFloat screenScale = [[UIScreen mainScreen] scale];

It returns 1.0f for all non-Retina screens. It returns 2.0f for Retina screens. This applies to all iOS devices.

So, having screen dimensions characteristic of the form factor (phone/iPod or tablet) and knowing the scale, we can calculate the device’s actual screen size:

CGSize screenSize = CGSizeMake(screenBounds.size.width * screenScale, screenBounds.size.height * screenScale);

If you run code like this:

CGRect screenBounds = [[UIScreen mainScreen] bounds];
NSLog(@"%f x %f", screenBounds.size.width, screenBounds.size.height);
    
CGFloat screenScale = [[UIScreen mainScreen] scale];
NSLog(@"%f", screenScale);
    
CGSize screenSize = CGSizeMake(screenBounds.size.width * screenScale, screenBounds.size.height * screenScale);
NSLog(@"%f x %f", screenSize.width, screenSize.height);

then you will see all dimensions in the console. In this case, I ran it on the iPad Retina simulator:

Как определить Retina Display на iPad/iPhone

And then, by checking the dimensions/device type, you can substitute the required graphics at the required sizes. Profit.

P.S. As for images, you only need to create 2 files: for example, "image.png" and the same image at double size named "image@2x.png", and then use only the first one. For example:

[UIImage imageNamed:@"image.png"];

If the device has Retina, the app will automatically pick up the higher-resolution file (image@2x.png).

[↵] open page kak-opredelit-retina-display-na-ipad-iphone.md
-rw-r--r-- 409B Mar 17, 2012 · 9851978 · ~1 min

Video from Glenn Hughes's Concert at Aurora, March 4, 2012

концерты видео zoom h4n canon 60d glenn hughes

Rock and roll from Deep Purple's vocalist (more precisely, he was the singing bassist). The last song has audio from the built-in Canon 60D microphone with the recording level limited. It does sound rough, though, because I was filming at stage level from the side — there you get hammered by the drums from the kit itself rather than from the speakers, and everything else comes from the monitors and amps.

[↵] open page video-s-kontserta-glenn-hughes-v-avrore-4-marta-2012.md
-rw-r--r-- 2.0K Feb 29, 2012 · 2EF7F9E · ~2 min

Twitter Reminder Bot with Notifications

twitter бот оповещения напоминаю

Твиттер-напоминалка

Twitter has firmly embedded itself in modern life, and by now even every housewife has at least heard of it, if not created an account there. Judging by my experience and the experience of people I know, you check Twitter very often during the day. Every day.

The idea came up to write a simple Twitter bot for notifications...

[↵] open page twitter-napominalka-s-opoveshcheniyami.md
makoni@arm1:~/blog$ cd ../page-31/ // ← previous cd ./page-33/ // more posts →