Cocoa Touch how to design the interface like facebook iPhone application's home screen? - cocoa-touch

I am just curious how facebook for iPhone application can display a list of icons with the text, then all the icons shake to allow user to change the position of each item.
What kind of control is that, and is there some sample code that do the same thing?
I think it must be standard because it exists as well in home screen of iPhone and iPod app to choose the tab item.
Thank you.

It's not a standard control. It's generally implemented with Core Animation and a rotation transform.

Apple discourages App developers from imitating the spring board, claiming it is confusing for the user. So don't expect standard controls for this.
You can of course implement it yourself with animation. Basic (property based) animation should be sufficient.

Related

What's the name of camera tiles view in agora.io?

I'm just playing around with agora.io, WebRTC and I want to implement a "camera tile view". I hope you understand what I mean, so all the (small) cameras of the users should be displayed in a row/table one next to each other or in a list, if too many users. The active speaking user gets a border around his camera view or sth like that.
Can anybody tell me the name of this kind of view or point me to a location, where I can check some samples about this?
Best regards, Alex
The Agora SDK's provide all the API's for building your own Ui, so there is no method within the SDK for generating a tile view, you would have to do that yourself.
That being said, the Agora developer community has some open source UI Kits that serve as a good starter template for your UI that you can adjust. The Agora Web UIKit supports tile view as the default.
Vanilla JS: https://www.agora.io/en/blog/adding-video-chat-or-live-streaming-to-your-website-in-5-lines-of-code-using-the-agora-web-uikit/
React: https://agoraio-community.github.io/Web-React-UIKit/

Embedded camera in Xamarin Forms

I have a client that adamantly insists on a solution with embedded camera in terms of having a ContentPage with an camera stream and custom buttons and icons, similar to https://github.com/pierceboggan/Moments, or at very least as I understand it seeing as it is a Snapchat clone. And my client wants similar swipe capabilities as to how navigation works in Snapchat.
However, as far as I can tell most of what is utilized in that solution has been deprecated.
I have suggested using the Media Plugin https://github.com/jamesmontemagno/MediaPlugin but they're not satisfied with the camera being pushed on the stack.
I've looked into implementing it natively and using dependency injections but it appears to be an overwhelming amount of work just to implement the most basic functions, particularly for Android's Camera2.
I'm hoping someone can provide me with good news of an easier alternative or an alteration to either Moments or Media Plugin or anything similar that will facilitate the requirements or if my only option is time consuming and complex?
From the code of Moment, you can do what you want to achieve. I did this for iOS.
You will have to create a custom renderer to display the camera page. You will be able to add buttons on top of it.
You could try this example which use custom renderer to add a take photo button and switch camera button on the camera view. Which is able to use on iOS and Android platform.
Main Page:
Camera View with custom button page:

How do you hide the menu bar in a Cocoa app?

How do you programmatically hide the menu bar in a cocoa app? I would like to make full use of the screen area.
There are two good ways I know of to do this.
1
In Cocoa, you can call the NSMenu class method setMenuBarVisible: to show or hide the menu bar.
As of this writing, the documentation for the NSMenu class does not tell you the following additional information.
The menu bar will only be hidden for the app that calls this method.
The Dock will also be hidden at the same time.
(This is true at least in 10.9 and I have not tested any other versions.)
This is useful when you want to use an app in a full screen way where you have a cover window, a borderless window the size of the screen.
The nice feature of this (as opposed to playing with LSUIElement settings) is that your app can continue to be in the application switcher cycling, as well as visible in the Dock when other apps are active.
This allows users to still activate a full screen app through the Dock or application switcher.
That means you can still use your app's Dock menu to access a preferences window for your app or other features.
This is incredibly convenient if your app is indeed a full screen cover window that runs at a window level higher than other apps, but you still want to make preferences and the ability to quit your app available, and you want your app's visual functionality available when other apps are active.
2
Another option is via NSApplication's method setPresentationOptions: with the arguments from NSApplicationPresentationOptions enum, such as option NSApplicationPresentationHideMenuBar
With this approach be very wary of reading the documentation, although it gives you additional options, and is still app-specific only, you need to know that some of the options are mutually exclusive. There are rules you must follow, or you get nothing but exceptions spewed to the console.
3 There is a 3rd and crappy option. If you have a helper app that is a daemon, you can use it to change your app's LSUIElement state and basically relaunch your app. It's dumb and it takes you out of the app switcher completely, which is great if you really are writing something that should not be there, but that is rare.
There is also the NSView enterFullScreenMode:withOptions: method, although most apps for which that would be appropriate prior to 10.7 should probably use the modern full-screen-window API on 10.7 and later.

What technology should I use for custom iOS controls, layout etc.?

I'm new to iOS programming and one thing I don't get. I have an app idea, I paid for graphic designer to make me a UI design. He sent me a layered psd with custom designed controls, layout etc. Everything is custom designed, not using standard iOS looking controls as I wanted.
The question is how can be this custom design converted to iOS controls, layout and so?
If I consider a Facebook iPad application or Foursquare iPhone application, are that just "skinned" iOS standard controls, or is it written in HTML5 and just wrapped by Objective-C? If so, how?
Thank you
I recommend that you use Objective-C for native applications. Most controls provide support for "skinning" by allowing you to provide your own images. For example, UISlider has methods to set minimum and maximum image, the track image and tint color as well as the thumb image and tint color. Ray Wenderlich often provides great tutorials on his site that are worth checking out.

How to create a Controller to simulate the Springboard feature of the iPhone within your own application

I am trying to design a feature in my application for the iPhone that simulates the Springboard feature (Main menu of the iPhone that allows you to view more apps), or the way Weather application works that allows you to flip between views.
Does anyone have any samples of this how I would go about doing this. It's seems very trivial but I am wondering if I am missing something that is already available either as an Apple example or someone who did a tutorial on this.
The image below show how the user would use it.
alt text http://www.agilitesoftware.com/SpringboardExample.png
As they slide their finger to the right (or left) the other image would begin to show up. And it would animate smoothly. The faster you swiped your finger the faster it would move to the next view.
Update: The other feature is that it should mimic the same feel when you slide your hand across the display that is snaps to the current view into place. It should not keep sliding across if there is more than 1 view to the direction you swiping your finger.
I've seen other applications use this so that is why I am asking.
This is accomplished using the UIScrollView with the pagingEnabled property set to true. Just add each of your views, adjust the contentSize, and it will automatically "page" to the width of the screen across the content.
There is a sample app (with code) with exactly this functionality on the iPhone developer site on Apple.com (I believe it's called "PageControl".) - I'd suggest checking it out.
d.
I'm writing an app that uses a similar UI. As NilObject recommended, we're using a UIScrollView with pagingEnabled=YES.
You may also be interested in this example code involving just two child views. I'm trying it out now; it's an interesting technique but I've had to write some additional special-casing code for some odd situations that resulted.
There's also another question on this site that asks about creating a grid of icons like the home screen.
I would check out Joe Hewitt's code from the Three20 project for this. It provides a nice interface and further refinement of the UIScrollView implemented as TTScrollView and TTScrollViewDelegate, TTScrollViewDataSource.