Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 9 years ago.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Improve this question
I want to create a QR-Reader App that is a two page Application. Both are accessible with a tab bar. The first page should be the QR reader part. The second should store the read QR codes in images.
I have a QR-Reader already coded, but i don´t know how to test the iPhone app on my Mac. Is that even possible?
And my second question:
How can i save the result of my scanned codes in the other page?
iOS 7 now has the ability to detect QR codes and other barcodes directly. There is a sample app built right into the Xcode help system that shows how to use it. I'm on a different machine right now so I can't seem to find the app. I'll take a look on my other Mac and post an edit if I can find the sample code.
EDIT: I was mistaken. The sample App is not from Apple, its an open source GitHub project.
The link is:
Sample project to recognize QR codes
Be sure to look at the other postings from this company. They all look very good.
(A link to other projects in the iOS 7 series:
iOS 7 Day By Day
You might want to use that rather than custom QR reader code.)
As to how to test QR code scanning from your Mac, that's going to be a problem. QR scanning involves using the built-in camera, and the simulator does not let you use a Mac camera as an iOS camera. I think you will probably have to do your testing on an actual iOS device.
As to how to "...save the result of my scanned codes in the other page" that depends. Do you want to save a picture of the QR code, or the text information that comes from decoding it?
If you want to save a picture then you would need to code your QR scanner to capture the image as a UIImage, and then pass that to your second view controller. You could do that in the prepareForSegue method that links to your second view controller, assuming you're using storyboards.
The same basic technique would apply if you want to pass the text info from the QR code.
You need to provide a better description of how your app is structured and what you want to do if you want specific help with that, but that sounds like a more generic "how do I pass info from one view controller to another" type question, of which there are hundreds here on SO.
You could make your QR code reader detect if it's the simulator. If it is, it could just give you an image picker, or even just choose a hardcoded test image, and have the QR reader examine that image. However you can't fully test the functionality in the simulator, so you would basically have to test on a real device to make sure it truly works correctly. You would never want to release an app that's only been tested in the simulator anyway.
As for saving the result of the scanned codes, you just need to implement a data model (could be NSMutableArray, for example) that you have access to from both view controllers. When you switch to the second tab, it could check this array each time it is about to appear to update its state. You could probably add this array to both views in your app delegate in the - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions method. Just get your root view controller from the window, which should be your tab bar controller, and get the view controllers from the tab bar.
Related
I am trying to get a wiki page to display on IOS. This is the first assignment in my 8-week course and I am completely lost. I have only worked with Java, Swift is a completely new language and I cant seem to find a starting point. My professor has only showed us how to bring objects into the view controller such as segmented control bars and buttons, but has not showed us how to implement code into program to interact with the objects.
I know this is a long shot, and I have exhausted all other options (even bought an IOS 9 book) but if anyone can provide a starting amount of code for me to see and work with I would be extremely grateful. I am not asking for the whole project, I just need to be able to see an example of some starting code that I can hopefully follow and progress with.
Project Details /
Project Example Images
From reading the instructions, it seems like you'll need to have a multi-component UIPickerView (this is a basic tutorial, you can use it to get the delegate methods used to interact with the pickerView, here's a more in depth tutorial) and definitely will need to use multiple UIViewControllers in order to achieve the desired result. Add BarButton Items to the bottom of the view, and control+drag on those to connect them to additional ViewControllers which can be used to select Plant/Animal Name, and to change the textColor.
On the initial viewContoller, you'll need a WKWebView above your imageView, learn more about their implementation here (note that this shows a programmatic approach, your wkWebView will likely be connected to your code from Interface Builder using an IBOutlet).
Continue to ask questions as they arise.
What is the pop-up object used in the Apple's "Clock" app for iPad called?
The popup looks similar to a MapKit callout, but often comes out of the side of a clicked button. Apple uses the pop-up often to display pickerViews on iPad. I am wanting to use it also for iPad applications in Swift, but I cannot find the name anywhere in documentation or on StackOverflow--because I don't know what it is called and it is thus hard to find.
I already know that some may not like the simplicity of this question, but I have seriously tried and have looked through books and other documentation trying to identify what the name of it, but it is so hard to find it without knowing the name! (I've included an image of the object just to be clear, but, unfortunately, I don't have the 'reputation' for the image to show up automatically in StackOverflow)
Image: The Object/PopUp item used in the "Clock" App.
The object is a Popover, as identified by Dan.
Thank you those who contributed.
You must be talking about UIDatePicker.
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.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I am writing my first native iPad app and I have a general UI question. I am horrible at user interface design and I'm looking for general guidance on what to use for my layout. Specifically I have a pretty simple master detail app that fits nicely into the generic app template that XCode provides. The app keeps track of inspection dates for equipment. I have a master view where the people enter info about a specific device (make, model, serial number, name, location, point of contact, email, phone, etc). The master view presents just location and name. When they click the master, all the data is displayed in the detail view.
There is an annual inspection required for each device and there is a standard form that is to be filled out. There are 20 items to inspect and I need to collect/display a label (the inspection step), status (pass/fail/whatever) and a comment field for generic text.
So I need to execute an inspection. I could just hand layout 20 uilabels, 20 ON/OFF switches (or 3 position), and 20 UITextViews but that sounds really kludgy. I could put the three items in a custom UITableViewCell but I'm not really comfortable that is the right UI approach either.
How would you map an existing paper process (this starts as a pdf that is printed) to an iPad app? Would you make it look as much like the old paper as possible?
One thing I have learned is that when people have an expectation as to how the information will be presented, then you should conform to that expectation. This is why Apple has interface guidelines for general application development. However, in your case, your guideline should be what your user is already expecting. If that differs from the Apple guidelines, I recommend you lean heavily toward your users' expectations. In this case they may be expecting something along the lines of how the paper form is set up.
Without seeing the original paper form, it's hard to advise you how it can be converted into a Master/Detail format while conforming to their expectations that were set by the paper form.
However, you may find it helpful to augment that by adding views that allow them to focus on individual devices, showing the three fields that you mentioned, with the Master/Detail arrangement. At the same time, they should be able to revert to a view they are familiar with, even if it is only to view the status (rather than to update status).
This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
How can I prevent users from taking screenshots of my application window?
So far I have be able to stop the Prt Sc key press and able to clear the clipboard so that my application cannot be screen grab.
However as a test I tried used Corel PaintShop pro and an option it has is to import screen capture which is very different from screen grabbing using the clipboard and as I suspected my application did not stop this.
So I have found the following code at this site : http://www.bitwisemag.com/copy/delphi/delphi1.html
This uses a different way of grabbing what is on screen and I presume that Corels method is similar to this. Is there anyway of this method of screen grabbing from being used on my application.
Greg Hewgill - Cheers for this - I will read this post
to get a screenshot on Windows is trivial, eg GetWindowDC(NULL). The only way I can think of is similar to this answer: stackoverflow.com/questions/455623/… – Nick
Nick looks like the same post that Greg has mentioned - however cheers for your response
Why go to this trouble? People nowadays can simply take a photo with their phone and send that around? – Marjan Venema
That may be true Marjan but I am trying to stop spyware programs from click logging if that makes the matter clearer.
The only way I can think of is to use DirectX. When certain apps such as DVD players write to the screen using DirectX, Windows sees a black (not quite black, but close) rectangle where the video shows. Attemps to use PrintScr or GetWindowDC() return that black rectangle. High-end screen capture apps like Snag-It can use DirectX to render the image properly, but this would be a 99% solution for you, and as others have said, users can always take a photo anyway.