Adding Images to an Array in Swift (The easy way) - xcode

A couple weeks ago I remember seeing a very cool and easy trick to add images to an array. The trick was after you create an array a view pops up next to it and you select the images and they appear in your array. However now I can't find how to do it.

Found what I was looking for.
var imageArray: [UIImage] = [Image Lateral]
After you write "Image Lateral" in the brackets the photos menu pops up.

Related

What's wrong with my PyQt animation?

So I've got a pair of buttons, one with a label, the other with a "delete" icon. The delete button will eventually delete some files, but right now I'm playing with the UI. The buttons are in a GridLayout with a spacer between them. I figure if I shrink the size of the button with the label, it'll "compress" as the spacer enlarges to fill the space. At least that's how it works in Qt Designer.
My button size definition is very simple:
ui.labelbutton.setMaximumSize(QSize(315, 50))
So I figure the animation should be relatively simple as well. I followed the format of another answer I found here, and I've got this:
def anim(self):
animation = QPropertyAnimation(self, b'maximumSize')
animation.setDuration(3000)
animation.startValue(QSize(315, 50))
animation.endValue(QSize(10, 50))
animation.start()
self.animation = animation
I pass it one of the label buttons (after extracting it from the layout - it's dynamically built). And I get an error:
animation.startValue(QSize(315, 50))
TypeError: startValue(self): too many arguments
According to all the examples and documentation I can find, that should be correct - a QSize is really just one argument, isn't it?
Anyone have a guess at how I can add some pointless eye candy to my application? Thanks.

wp7 list Peel animation

I am using List Peel animation as described here. Its working as expected but now I want to add the similar effect on onItemSelectionChanged event of the list box. The only difference is that this time, I want the selected item to leave the page at the very last. How can that be achieved?
Regards
I think that Clarity's turnstile with feather transition might be what you are looking for:
http://blogs.claritycon.com/blog/2010/10/13/wp7-page-transitions-sample/
I can't quite remember how it works... but I remember it did act on individual elements - it tried to work like the start menu.

NSCollectionView with sections - like in iPhoto

I'd like to build a NSCollectionView similar to the one in iPhoto '11. I want to group several pictures in section, and create a section header as well. The section header of a specific section is always visible until the last element of that section is visible. You can take a look at the picture to see what I mean.
EDIT: I should add that the contents are not images.
Thanks in advance
You're probably going to have to look at using CALayers directly. NSCollectionView gets most of its magic from CoreAnimation IIRC, and it looks like you might have to duplicate some of that. Alternatively you could try using nested collection views— one containing groups, then each group contains another collection view of individual items.
Either way, your view/layer hierarchy is going to be the same. You'll have a top-level container which has only one column (since groups stretch across the entire width), then each item within that will have any number of columns, based on the item width. i.e. your 'group' collection view items will stretch to fill width, but your individual items within those groups won't.
If you choose to use the raw CALayer approach, then you'll want to look at CAConstraintLayoutManager. This is what provides the magic inside NSCollectionView. A good place to start looking for information on this is Bill Dudney's CoreAnimation book from Pragmatic Programmers. Bill's now the official platform evangelist for Apple, so I think it's safe to say he knows what he's talking about in there.
Overall, I'd suggest using a nested NSCollectionView approach to start with, and look at dropping down to raw CoreAnimation only if performance seems to be lacking, or if you have issues getting some stuff to work. Using NSCollectionView lets you keep all your current NSView-ness in place, so it will be less work. If it turns out ok, then you're home & dry. If not, you've got something else to try which you can tweak to your heart's content.
Here is a similar sample:
Check this: https://developer.apple.com/library/mac/samplecode/TableViewPlayground/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010727

Edit onClipEvent Actionscript

I am a beginner so please take it easy. First some history, I am trying to modify a flash movie (not created by me) that has 4 images in it.
I have to now add 2 more images (pic5.png and pic6.jpg) to the "slideshow" as shown in the attachment, I have added the 2 images to the library. The problem I am having (as I understand, I may be incorrect) is that _root.count = 4 causes the movie to jump back to the first image after it displays the 4th one which does not display the 5th & 6th image.
My question, how do I edit the value of _root.count to 6, so that it will show all the 6 images. Additionally how do I create a hyperlink on each image.
Please can someone guide me.
Many thanks.
Looking at your screen shot, Layer 2 (which contains the slideshow movieclip) is locked. If you unlock the layer by clicking on the padlock icon you should then be able to edit the script.
To edit the script double-click on the script in the Movie Explorer panel and the Actions panel should open. You can edit the script here.
The second part of your question - how to create a hyperlink - is very broad and there are many different ways to approach it. The most elegant approach would depend on how your project was structured.
The simplest way might be to define a variable to hold the path to the current image and add another onClipEvent handler.
So in the existing onLoad you would add…
this.path_to_image = http://your-domain.com/images/your-first-big-image.jpg;
Then add the new event handler
onClipEvent(mouseUp){
getURL (this.path_to_image);
}
You would then have to update the path_to_image variable whenever the image changed.
slideshow.path_to_image = http://your-domain.com/images/your-next-big-image.jpg;

Which function does Leopard's Finder get the preview icons with the watermark on them?

I already took a look at GetIconRefFromFileInfo() and QLThumbnailImageCreate() but they just doesn't seem to be similar with what I see from the finder, which is a square icon with watermarks on it, e.g. if the file is RTF, it has this greyish watermark below that says RTF or RTFD or PDF...
Please help me out on this. Thanks. If the question is still unclear, please feel free to comment.
From MacScripter:
This is a category on NSImage which
lets you get an image containing a
Quick Look preview of the content of a
given file. If no Quick Look preview
is available, it will instead return
the file's Finder icon (this is what
the Quick Look panel does). It
consists of only one method:
+ (NSImage *) imageWithPreviewOfFileAtPath: (NSString*) path ofSize: (NSSize) size asIcon: (BOOL) icon

Resources