iOS data driven programmatically setting up views and actions ? Looking for advices - ios

New to iOS, I have to make an app that will show photos and videos.
Could be simple, but there's a little bonus.
The app will have to download configuration based on user. ( xml or json )
After downloading this configuration, it will have to download the elements to be shown.
The app will have to show , based on configuration file, views with buttons.
Each button can be used to show another view with buttons or a photo album, or a video, or a pdf.
I don't know where to start.
I tried to search on google but english not being my mother tongue, I think I don't have the right words to search on.
So any advice on how to structure that and how to make it possible ( nothing is impossible ).
I'm not asking for code, but for guidelines.
Regards

English isn't my mother tongue, but most valuable information in English. I would suggest to find informations in books, they are usually with downloadable examples. This can be useful for you.
Also you can try "ios recipes" in google.
Finally, my version of guideline:
Download configuration in applicationDidFinishLoad:withOptions:
Develop classes with view controllers + xib files, for each term(video, photoAlbum, etc.)
NavigationController or TabBarController to navigate between viewControllers. (There are too much examples with it. I like TabBarController, and "Each button can be used to show another view with buttons or a photo album, or a video, or a pdf." - this is too easy with tabBarController, tabs instead of buttons).
Something like that.

Related

Tabbed iOS WebKit Browser with Swift

In short I am trying to build some typical browser functionalities in a Swift iOS app with WKWebViews (WebKit). I already have a functioning browser based on a WKWebView, which already has a menu bar with a URL input, navigation buttons, a share button, page title etc.
What I am struggling with is creating tabs for the browser. At first this seemed trivial as surely WKWebViews would support this in some way. Well, as far as I can tell they do not (looked at and tried multiple tutorials incl. hackingwithswift, Ray Wenderlich etc. + I checked Apple's documentation + stackoverflow)
This is what I have come up with so far:
1) Creating a new tab/opening a new URL should create a new UIView + WKWebView programmatically (I'll have to make a subclass out of my current browser view)
=> this should create a separate thread for each WKWebView/tab according to Apple's documentation
2) I need something like a Collection View (or Stack Views etc.) to store screenshot images of the already open tabs as a preview page of all tabs. The cells should be linked via a delegate to the corresponding WkWebView and they should have a close button to close (= delete) the tabs.
Am I overthinking this? If I go down this path I have to find a way to wire up (and subsequently delete) multiple delegates and views to the Collection View dynamically and I have to store & delete screenshots every time the user interacts with the tabs. It seems VERY messy. But given that Chrome on iOS is based on WebKit as of late, it's obviously doable.
How would you tackle this problem?
PS I didn't include a mockup because you all know how the tabs in Chrome, Safari etc. on iOS look like.
EDIT:
I am just looking for a clean and sensible way to add/remove and show the multiple WKWebViews, which are created by opening new tabs - just like in Chrome for iOS or Safari etc.
Ok, I have solved this today :) I will have a main UIView and then multiple WKWebViews, which can be "zoomed in" in order to enter full screen mode. No need for screenshots etc.

Master detail view using a UITableView in the detail section (iPad)

I'm all new to iOS coding, and wanted a small project to learn the language.
My wife asked me to make an app she could use for her work.
I have been looking into the Master/Detail template on iOS and this is something I want to continue with.
Searched the web and looked at a lot of tutorials and comments in this forum, but I have not been able to find anything on how to use this template the way I would like it.
When I click the master section it should then in the detail section load a UITableView with all the properties for selected Item. (A bit like the Settings app on the iPad). If I then select and item in the detail section is should load a new view where I can change the selected property.
If anyone would could give a hint on this, it would be really appreciated.
Try starting with the default master/detail template built into xcode. You can set it for iphone, ipad or universal (both). I am working my way through a similar question.
Good luck and keep asking good questions here ... the developers here are really great.
Dan

Questions about the "share" popover in Photos app (and other apps)

So, if you share a photo in the Photos app, it pops open this widget:
This looks like a standard UIPopoverController with some UIButtons. My question is: Is this a system resource as one unit? I have searched using words I thought might fit if it is, but have come up with nothing.
Okay, suppose it does not exist as a system resource. Is there a resource where I can get various sizes of these icons? Specifically the three in the top row. My app already provides functionality for each of these functions which I have coded up. These actions are just tied to ugly text only buttons.
This gets asked a lot. It's a UIActivityViewController. It was added in IOS 6.0.

Using UIImagePicker in a tabbed UIPopover

I am developing an iPad app that needs to have multiple image sources, on the device/Photo Albums, remote and some included with the app. Now the ideal situation would be to have a UIPopover controller with 3 tabs for each source. The only problem is I can't seem to figure out how to have a UIImagePicker be in its own tab. What I am trying to do is very similar to Apple's Keynote for iPad. The photo icon's popover has tabs and the far left tab called media for sure has a UIImagePicker in there. I have no idea how they did that, is it possible for me to do something like that? I think the main issue is that the Image Picker is it's own navigation controller and it cannot be pushed on to another navigation controller. Any help would be greatly appreciated!
check out this - https://github.com/key1jp/ELCImagePickerController
you can implement it with custom asset library
The built-in image picker is no good.
Create your own image picker and add it to your navigation controller as a normal view. Start from either the Matt Tuzzolo or the MyImagePicker from the WWDC 2010 sample code. Note that you probably want to add image and video preview - I copied the image viewer from MyImagePicker and added a 'add' or 'remove' button to it, and the same for video.
Your image picking is in two steps, one for selecting the group, and one for selecting the assets within the group. I recommend dividing the first step into a two - if there is only one, then go directly to that group, i.e. when you have found the first group, check whether that group was the last (block stop argument). Then push the right view controller.
Obiously modify the size of the thumbnails also, they are iPhone size now. Adding a line of metadata (icon and duration) looks much nicer and is more informative for video.
I also recommend adding a 'click-and-hold' function for extended information after like 2 seconds.
Handle different sources by creating a protocol which gives you what you want, i.e.
-(BOOL)isImageAtIndex:(NSInteger)index;
-(UIImage*)thumbnailForUndex:(NSInteger)index;
-(void)setSelectedAtIndex:(NSInteger)index;
Creating a source which handles local files, included resources and assets is perfectly possible - I use NSURLs and check on the url scheme.
Are you not using UITabBarController for your tabs? You should be able to add a UIImagePickerController directly to viewControllers. I'm not sure whether that is a supported use of the image picker, though; the documentation only mentions displaying it modally or displaying it in a UIPopoverController.
It's not usually useful to look at an Apple app to find out what you can do with various built-in controls, as Apple allows themselves to use private APIs.

use multiple views in an application

I am new to Iphone programming. So please don't mind if I ask some basic questions. :mad:
I want to develop an application where the landing screen will be a login screen and after login application should display a new screen with the list of available categories. And on selecting any category a new screen should appear with the information related to the selected category.
Basically I want to display different screens in the applications and my confusion is how can I make different screens with one .xib file? or should I use different .xib files for each screen. If I use different .xib files for each screen then how should I navigate to different screens.
Please help in solving this confusion.
Thanks in advance
Gaurav
You should definitely use different .xib's for each view. You will end up having a standard view, a table view (probably programatically wrapped in a navigation controller) and a standard view, respectively. Each will also have their own class.
You navigate to different screens by programmatically initializing them. The condition on which they are created varies from screen to screen. For example, your login screen will only create and load a table view for the categories after a successful login. The category screen will only create a detail screen when the user touches a category in the table.
I think your best bet is to pick up an iPhone programming book and do the first few chapters until you feel comfortable with the basics of XCode. The Apple documentation usually contains more than you really need to know and by the sounds of it, you just want to jump in and make a few simple apps.
After that, you can look at the Apple sample code here: http://developer.apple.com/iphone/library/navigation/index.html#section=Resource%20Types&topic=Sample%20Code

Resources