0

Flash vs HTML vs iOS

I honestly don’t know where Flash as a technology is going to be in a few years. Yes, we’ve seen the technology roadmap provided by Adobe, but I don’t honestly get the feeling that Flash is long for this world, which is sad.

I started out with Director and moved to Flash a million years ago. Building interface elements and widgets, moving into entire sites and then serious applications. The tools got better with time, the language when graduated to AS3 made a whole lot more sense to everyone, and things were humming along. And then change blew in from the side fills and now it seems that Flash is choking on it’s own vomit in the back of the van.

The one thing remaining cool in my quick take on e landscape is notion of author once and run on iOS and Android. So you’ve got AIR for Android doing it’s thing and some magic compiler doing it’s thing for iOS. You’re not authoring to the languages yourself which always left me feeling a little weird as a developer. Always releases behind without direct access to powerful features that you might need to subclass, etc.

I haven’t touched Flash in well over a year. I’ve been straight Objective-C, iOS, with a smattering of HTML/PHP/JavaScript. If you spend a little time with iOS and Objective-C, I think you pick it up quickly and love it. Personally I love Xcode. I’ve struggled with signing things in the past, but as a tool it’s freaking amazing.

Anyway, sorry to witness the decline of Flash. Happy I was part of it’s pinnacle.

Popularity: 1%

0

iOS cross-fading images easily

If you find yourself in the need of providing an elegant slideshow with image crossfading, you have several paths that you can take.

I however found a very simple and elegant bit of code that provides this functionality. All you need is an NSTimer and a selector (example only here):

- (void)changeSlide
{
    slide++;
    if(slide > 6)//an array count perhaps
        slide = 1;
    //create the string as needed, example only
    NSString *theName = [NSString stringWithFormat:@"img_%d.png", slide];
    UIImage * toImage = [UIImage imageNamed:theName];
    [UIView transitionWithView:self.view
                      duration:1.75f
                       options:UIViewAnimationOptionTransitionCrossDissolve
                    animations:^{
                        self.photoViewer.image = toImage;
                    } completion:NULL];
}

With a single line of code you’re able to gracefully crossfade the current image with the new image. No need to create multiple UIImageViews, etc. Easy peasy and it works extremely well.

Popularity: 1%

0

iOS: Launch the Music application from your app

Music Icon

In an iOS application I am working on I found the need to be able to launch Apple’s Music player application. After googling a lot and posting to a developer email list, I found no solutions. I was however pointed to a wiki that lists iPhone URL schemes [link]. This shows various ways to call up other applications on iOS devices. However the Music application isn’t listed there.

I took a shot in the dark and tried “music:” – and it works :)

NSString *stringURL = @"music:";
NSURL *url = [NSURL URLWithString:stringURL];
[[UIApplication sharedApplication] openURL:url];

So now you know too.

Popularity: 1%

1

Objective-C: UIButtons and Event Propagation / for(;;){

UIBUttons that won’t stop event propagation

Today I needed to add a few UIButtons to an interface I had created as a Storyboard. However I am heavily using touchesBegan, touchesMoved, and touchesEnded. UIButtons swallow touch events like that and won’t allow them pass through into my touches<Condition> code. That was a problem for me. You could subclass a UIButton and use it, but I am rather fond of placing some elements myself into a Storyboard. I found a nice solution online. Before the implementation in your view controller, add this code (I think I found it on StackOverflow somewhere):

#pragma mark PassTouch

@interface UIButton (PassTouch)
@end

@implementation UIButton (PassTouch)
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    [super touchesBegan:touches withEvent:event];
    [self.nextResponder touchesBegan:touches withEvent:event];
}
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
    [super touchesMoved:touches withEvent:event];
    [self.nextResponder touchesMoved:touches withEvent:event];
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
    [super touchesEnded:touches withEvent:event];
    //[self.nextResponder touchesEnded:touches withEvent:event];
}
@end
...

This was a lot easier than subclassing a button, etc. The only thing is that all of your UIButtons are now going to pass events along. I commented that one line out in touchesEnded for the button since that bit was interfering with some of my code. Handy stuff that.

A for loop that won’t quit

I wanted to use a while loop for something (just a random number that wouldn’t be a repeat of the previous number). I stumbled upon some documentation that showed something I haven’t seen before. This is a style thing really as there are other ways to achieve the same and commonly needed results.

    int rndValue;
    for(;;){
        rndValue = 0 + arc4random() % ([songsArray count] - 0);
        if(rndValue != currentRandomTrack){
            currentRandomTrack = rndValue;
            break;
        }
    }

Check out that for loop. Until that condition is met to break, that for loop will run until someone kills the battery. Just another way to do it, but I hadn’t seen it before so I thought I’d pass it along. Pretty cool looking with the Snidley Whiplash eyes in there.

That’s all – have a great weekend.

Popularity: 1%

0

WWDC 12

Happy.
I’m really excited to be attending WWDC this year. The last time I was in San Francisco for anything was for FlashForward I think. I’ve been to a few MacWorld conferences and have enjoyed a SteveNote from just behind the press pool (close).

I feel lucky to have been able to get a ticket since they sold out so quickly. I’m lucky to be on the East coast and also lucky someone at work was talking with someone early in the morning who noticed tickets went on sale before I got my SMS message about it. I definitely would have missed out if not for that.

Pilgrimage.
Jeff LaMarche used to help run a bus pilgrimage to Apple on the Sunday before things kicked off, but it looks like this isn’t happening this year. If anyone has heard of something else please leave a comment. I was thinking of renting a car but it’s a pretty long drive (2 hours?) to arrive someplace where I’d know not where to go or where to park, etc. It would be tough to do during the week and miss out on a lot. Perhaps I’ll just have to pass on it.

Anyway, my Twitter account: @eric_dolecki

Popularity: 1%

1

Simple Analog 2 submitted to the App Store

Analog2

Today I submitted a new application to the App Store – it’s a replacement for the free app called Analog that I released a million years ago.

It’s still simple – even more so, but the engine has been improved and the UI is better. If you’re interested, check out the page in my apps-devoted site (which needs flushed out).

Popularity: 1%

1

Xcode Storyboard displaying as XML

There have been times when I have working on a project and suddenly my Storyboard starts displaying as XML and it won’t seem to switch back to it’s visual mode. Right-click on the Storyboard in your files view and Open As… choose Storyboard. Off you go :)

Popularity: 2%

0

Apple Store EasyPay

Last night we took our children to the Burlington Mall for our son’s birthday dinner. His choice, he loves that place. Anyway, I wanted to pick up an Apple Magic Mouse and I had the Apple Store application installed on my iPhone. We walked down to the store, I launched the app & watched it’s UI change once we stepped inside.

We walked to the back of the store, I scanned the bar code on the Mighty Mouse & <blip> it was ready for purchase. I selected to buy it (using my iTunes account obviously) and was prompted for the security code on the back of the card associated with my iTunes account. Clever thing that… so if someone snags your camera with that app on it, they can’t just start ringing stuff up. I’ve heard that it only happens the first time & then it’s set. I don’t know.

Immediately I received my email receipt. The whole process took all of about 10 seconds and I didn’t have to find an employee to ring me up. Awesome.

I asked an employee on my way out how they don’t have people just walking out with stuff. Obviously they studied a manual and they had a prepared line to tell me, “Apple trusts it’s visitors.” That’s nice, but it can’t possibly end there. I wonder if the email receipt is something that they might stop you to see if you’re on your way out with some Apple products and they suspect that you didn’t purchase them.

Or perhaps when a purchase is made, they get a push notification of who purchased and what was purchased. So they would know it’s okay without actually having to approach. If the store is jammed, I imagine it would be harder to keep tabs, so I’m not sure what they do at that point.

Perhaps they have security people and that’s it? I suppose they could afford the occasional shoplift. The benefit of having more impulse buys probably outweighs the problem of stolen merchandise. Those stores move a ton of product from what I’ve seen.

Popularity: 1%

0

Thank you for UITapGestureRecognizer!

Initially I didn’t think a whole lot about the UITapGestureRecognizer in iOS. I figured it might save someone some time wiring up some touch code, but outside of that I felt it was nothing more than a nice convenience. After today I am so thankful that some developers and managers at Apple included it into iOS for developers to use.  … Continue Reading

Popularity: 1%

0

Sandwich à la crème glacée

When I see someone get über excited about their phone lasting almost an entire business day with little use… gah.

Popularity: 1%

Pages ... 1 2 3 4