Im new with xcode I'm using XCode 4.2. I followed this tutorial
https://codejunkster.wordpress.com/2011/11/23/core-plot-2-bar-plot/
and when I run the app it only shows the graph that is in the tutorial and not my initial view... is there any way to set this graph(tutorial) as a UIView and resize it, so that it would be in a corner of the first View? (a small view inside a view)... To be more specific Im doing a single view application and in my first view I have labels, textfields and buttons, and when pressing a button the "small graph" will show the difference between the two variables
and also, how can I link the variables from this view controller to the graph... like if the users types a 5, the first bar will be at 5
Is there any tutorial online that show how to solve this?
Thank you
The Core Plot hosting view (CPTGraphHostingView) is a subclass of UIView—you position it like any other view. Don't add any subviews to the hosting view.
The view controller responsible for the graph can change any properties of the graph that it needs to. For example, it could change one or both plot ranges when it receives a message that the user took a certain action.
Related
So I was trying to create a sample ios application. As I am designing the app UI with the storyboard (and not coding), I find Xcode really hard to understand.
what I want to do is I added a scrollView to the view controller. now what I want to do in the scrollView is simple.
I want my scrollView to have buttons (vertically stacked) and it does some action on the basis of the data it is getting from the database. let's suppose it is getting links from the database and on a click of those buttons those links open. now the data may contain 10 links, or 20 links .. basically, we want it to be according to the database.
now if I was designing the UI programmatically it would look something like
ScrollView{
for loop...{
button("for example name coming from the database"
}
}
or atleast this is what I know of.
so how to do the same with storyboard ?
like we first take it's refernce to the uiViewController class.. and then ?
You need to add buttons programmatically if they are created dynamically depending on external non static data. Create new UIViewContoroller class and implement it with connecting storyboard file, the easiest would be to add buttons inside some kind of UIStackView which is inside scrollview imo, or by using UITableView if there are significant number of links to display.
I would like to implement something like below:
But, I would like to have my first version app without the map, later on, I will add the map. So, the eventual goal is to show both map and the other things showing on above screen.
My question is, how to make it happen? It sounds like I should have the map and the rest UI in two files (xib or storyboard) respectively, then later on, combine them together. But I am not sure what is the right way to implement these things in iOS?
Can I implement a view component which only contains map, then, another view component only contains the rest, then later on, combine them & one UIViewController associate with the combined view? If so, how to do it? If not, what is the correct way to achieve this?
I think you can achieve that by using container views; add 2 container views to your view controller in your Storyboard, the upper container view will contain the map and its stuff, and the bottom one will contain anything else.
To hide the first container view in your first version of the app you'll only need to set the height constraint of the upper container view to 0 after setting the other constraints properly.
If you wanted to use a view controller from another Storyboard file, you can check my answer here.
I've currently got a single working UISearchController implemented inside the header view of a UITableViewController. I wish for my other views to also follow suit but some are UICollectionViewControllers. Is there a way to create one UISearchController and just call them across all the views within the headers? All of the results must show in a table.
I had attempted to create one for each view but the UICollectionViewController was giving me some problems. I couldn't figure out how to set and update a table for the search controller. It wouldn't allow me to override the tableView methods as i guess the controller is a CollectionView.
Any help is appreciated.
EDIT:
Should also add that the search method/data will be the same across all of the views. See how the stock iOS Music app uses search bars as an example.
EDIT 2:
I've nearly cracked it (I think). I've setup a singleton "SharingManager", within this i have 3 arrays. Now I have 2 views, one named ArtistsView and one SearchTableViewController. The Search view contains all of the table methods and the ArtistsView communicates with that using:
self.searchResultsController = UISearchController(searchResultsController: SearchTableViewController())
I also copy the variables within the singleton to variables that are within the SearchTableViewController.
The issue i'm having now is that the cellForRowAtIndexItem method is not being called. All the other ones are, i can even see the section headings are being displayed. I have set up various println() statements to see where i could've gone wrong, the numberOfRowsInSection is also returning the correct numbers. Any ideas?
What I have done in the past to solve this kind of issue, and what seems to be the most flexible is to have it so that when you tap on the searchbar, your app actually transitions to another view controller that handles the search and search results.
Fake search bar button on each screen you wish to use it.
When tapping the search bar, screen cap your current view controller.
Set the screen cap to the background of your search results controller, blurred or darkened a bit if you like, so it doesn't interfere with the search results.
Transition between your previous view controller and the new search results controller with a fade.
You'll be able to give the user the impression that they never left the original screen they were on.
I'm trying to create a Table View Cell array and have the name displayed in each table. The tables will look like what you see on the home screen of the Evernote app (shortcut, tags, places, notebooks etc.) and each one will access the next screen when tapped. How do I go about doing this? Novice app developer.
This is an image of the result I'm trying to get.
That is a basic cell with transparent background and other views (and images, layers, etc.) added as subviews.
For the other things I suggest to study how UITableView works and how to push a UIViewController using a UINavigationController.
In general you should study iOS and Objective-C from zero.
i'm working on my first app and now i'm trying to implement air print in a customised version of the "Autoscroll" Apple sample code. basically i present the user with the print controller from a custom button and then they should have the choice of printing the image they have selected. autoscroll works in this way: you have 2 scroll views in a view controller a big one that allows zooming and a small one that slides in/out by tapping once on the big one. the small scroll view contains a number of thumbnails that are loaded in the big scroll view on selection by tapping. so far by studying the print photo sample code i manage to print one image; the first one loaded when the view controller is presented. i'm aware that multiple ready to print images have to in an array, but the example in the printing and drawing guide has 1 line of code and talks about an array of image views. the images i need to print go inside a scroll view.
thanks in advance for any help.
Xcode as a sample source code that u can use to archive what u want, since it as already some of the features that you want to implement.
The name of the project is ScrollViewSuite and you can download it from here: here