I want to make an view that looks like a wall in swift 3.
Here is an example:
Every entry should look like a square with some information.
Is there any framework which I can use or do someone know a solution for that?
I can't comment because of reputation issue. You can use UICollectionView if every entry has same width and height.Here is a tutorial https://www.raywenderlich.com/136159/uicollectionview-tutorial-getting-started.
If not, you can create subviews using UIView with your desired UI components.
Related
After following the instructions from AdMob on how to implement their code, I faced the following problem.
I had to link the UIBannerView that was set up in the storyboard with my GameScene, this, as you might know, is not possible. So I decided to link it with my GameViewController. The problem here is that I can't decide when to show the BannerView since the value's and functions that decide this are implemented in the GameScene file. Is there any way I can fix this?
Thanks for your help,
Max Savelkoul
Move the methods from game scene into the view controller and call them by using NSNotificationCenter or delegation.
You could also add the banner code manually instead of using storyboard.
var adMobBannerAdView: GADBannerView!
and than set it up
adMobBannerAdView = GADBannerView(adSize: kGADAdSizeSmartBannerPortrait)
adMobBannerAdView.center = CGPoint...
Alternatively I have a helper on GitHub you could check out. Also helps to keep your code clean.
https://github.com/crashoverride777/Swift2-iAds-AdMob-CustomAds-Helper
I'm trying to build a UI which look like this:
I'm using a storyboard with Xcode but I don't know how to start. I think a need different view in the window to manage button, text and tree but I don't know I to do it. I have try to use a split view but it gave me only 2 views instead of 3.
Any help in Cocoa and storyboard is welcome.
Thanks
Can't see where you'd want to use an NSSplitView but the UI you're attemting to create is trivial -
A plain NSWindow with the toolbar items configured as per your screenshot.
An NSOutlineView for the tree view with the three columns,
the content border of the window sized accordingly to make room for the label you intend to put at the bottom of the window.
As mentioned in the comments one way to populate the outline view would be to use an NSTreeController and Cocoa bindings. That's probably the only slightly more complicated bit about this UI..
what I want to do is,
I am using UICollectionView to show my stuff.
What I want is, the stuff that I want to show is coming from server,
It may be in single line or some may be multiple.
I wanted to show the cell frame of UICollectionView differently.
Means If data is big then bigger frame of UICollectionViewcell
and if data is less then smaller frame of UICollectionViewcell.
I tried a lot,
but I am succeed only in having fixed size of frame for UICollectionViewcell
How to achieve different frame for each cell according to need.
Is it possible....?
#note :- I am not using any xib.
All is done programatically.
It seem like you are getting UICollectionView wrongly.
Let me say in short You are not suppose to set frame but you need to implement your own UICollectionViewLayout.
By default UICollectionView use UICollectionViewFlowLayout. Which add cell one by one.
But UICollectionView is very power full UI component than that. To open its true power you have to understand UICollectionViewLayout.
Here are some good example of that :
RFQUILTLAYOUT
CHTCollectionViewWaterfallLayout
CCHexagonFlowLayout
MSCollectionViewCalendarLayout
If you want to learn how to create your ow than have a look at following link:
Creating Custom Layouts
Custom Layouts: A Worked Example
Implementing UICollectionViewLayout
UICollectionView custom layout tutorial
A Springboard-Like Layout With the UICollectionView Class
If you need to know overview of how UICollectionView work than read : NSHipster:UICollectionView
One in depth look in Custom Collection View Layouts : objc : Custom Collection View Layouts
I hope I get u correctly. And this will lead you to right direction.
First off this is Xcode 4 iOS 5.0. Here is what I want to do. I have one view, we will call it view1, which has a button and when that button is pressed a different view with a table appears called tableView. I have multiple images I want to be in this table and when the image is selected, it would appear in view1. I have already researched all of this and just can not find the right material. The button and table are already working together and I can add the objects to the table, but getting those objects that I select to appear on view1 is what I am not understanding. I can not get the two nib files to work together, or Im going at it wrong.
Second question, guess this is similar, view1 displays an image that is selected from the photo library BUT is there a way to open the photo library, select the photo, and have it appear in a DIFFERENT nib view? Again this is getting the NIBs to work together. I would appreciate all the help I can get. (photo library and selection of photo already works so that code is not needed). Thank you for the help!
I have used this example to get what you have described in the above question. But with some tweak in the delegate methods and hop you will get some direction for your problems, too.
Good Luck!
Happy Codding! :)
And need any help just ask for it, don't hesitate.
It is possible from delegates in other class.
I looked for this on the web, but I could not find any clear tutorial on how to successfully implement an NSCollectionView. How should I proceed?
In Interface Builder, I can drag an NSCollectionView to the main view, and I see that there are two other new views in the documents window: I suppose one is the actual NSView inside the collectionView, and the other one is the NSView prototype for each of the elements that will be displayed inside the collection.
But from now on I don't have any idea about what to do.
Any help would be very appreciated, but thank you anyway in advance.
—Albé
Xcode > Help > Developer Documentation...
The Collection View Programming Guide contains a step-by-step tutorial. (In fact, that's all it contains at present.). The sample app IconCollection is all set up with reasonable bindings and code to show how the collection view works.