iOS Resizable GUIs with JUCE - ios

I'm using the JUCE framework to make my first few iOS apps, mostly just proofs of concepts for my Github account for job recruiters.
I've got my first app compiled and working on iOS, but I'm having tons of issues with the GUI.
I can't seem to find the right resolutions to fill the screen. I'm testing with an iPhone 7 Plus, and I figured I could just type in the resolution of that screen to the Projucer, but it doesn't work correctly.
Then I realize I'd probably just want one that fills the screen automatically, but dont know which function calls to use or where its located in the Projucer (haven't found it yet).
Also, I'm entirely new to GUI developing as of December, so I'm still learning all of this. I would greatly appreciate keeping it simple. Thank you to anyone who is able to help.

Try this in MainComponent.cpp
Rectangle<int> area = Desktop::getInstance().getDisplays().getMainDisplay().totalArea;
centreWithSize (area.getWidth(), area.getHeight());

Related

How to get iOS app to work on all iPhones? (Constraints)

I am fairly new to developing for iOS. I have a fully functioning program written in Swift and the UI was created in the scene builder on Xcode. I created an app for my work to simplify closing out the registers and other financial aspects. The app is complete and works perfectly, but was designed on the iPhoneX. The problem is that only a few of the employees have an iPhoneX, but they all have some kind of iPhone. I have tried setting up constraints but it never works. Ive tried scaling restraints and position restraints but I can't get the layout to look right on any other phone, and when I add the constraints it affects the view on the iPhoneX as well and doesn't look good on any iPhone. I need help getting this to work on all iPhones. I would like it to look and act the exact same regardless of the size of the phone, basically just scaled down. There are a lot of things on the screen and I can't figure out how to do this. Please help!!!
I have been working on this for a long time and I really need help. Please let me know if I need to clarify anything. I have posted links to some pictures of my UI so you have an idea of whats going on.
Constraints I tried adding, although I have played around with some other options.
Here's what it looks like on the iPhoneX, this is how I want it to look.
What it looks like on iPhoneSE (with constraints).
One thing I noticed in your Xcode project that none of your features are in UIView. Without it, it will be quite challenging and somewhat always different results. In theory, if you use AutoLayout features correctly it should work without UIView, but they make life so much easier. This is something I learned the hard way at the beginning of my iOS development. First set up your UIViews without any content inside it, give them some background colour to differentiate, once they are working on all devices. You can pin your features to superviews with no difficulty.
Since you have a repetitive features, you could also consider using Stack Views. You don't have complicated features, so as long as AutoLayout is set up correctly you should have no problems seeing it ok on all devices

Can we use sketch UI elements directly into Xcode?

I am new to sketch 3. I have a hand on experience with Xcode and iOS development.
My question is wether we can directly use sketch elements in xcode or sketch is only used for prototyping the UI?
For example, If I design Label with a text field in sketch then can I used it as UI Label and UITextField in Xcode?
In my experience as a designer that also develops in Xcode any solutions that claim to go directly from Sketch into Xcode either become vapourware after some time or don't provide a very good solution. I assume it's because Auto Layout is quite complicated and fragile.
It's best to just learn iOS development using Storyboards or possibly SwiftUI for layout. There are some elements that you can get from Sketch into Xcode such as colors, typography and iconography.
Here's a list of apps that can help you with that:
Zeplin: Handoff designs and styleguides with accurate specs, assets, code snippets automatically. https://zeplin.io
InVision: Prepare designs for development. https://www.invisionapp.com/feature/inspect
Avocado: Open designs without design tools. Export images without preparing layers. Click on layers to get code.
https://avocode.com/hand-off-and-inspect
Flawless: A tool to compare the expected design and the real app right inside iOS Simulator (useful for designers who use Xcode or
mobile developers). https://flawlessapp.io
Sketch to Xcode: The fastest way to get colors from Sketch to Xcode. https://sketchtoxcode.com
Disclaimer: I'm the maker of this app.
There is not a way to integrate the sketch elements in xcode, you can use a sketch plug-in you can buy:
https://www.paintcodeapp.com/sketch
I had the same problem, the design was already prepared in the Sketch and wanted to get the code from it easily. My friends and I've working on a solution for converting design into UI codes, last 2 years.
We've developed Monday Hero platform to improve the development phase and actually save time for repetitive code. https://www.mondayhero.io
In Monday Hero, you can upload design and get responsive code with Storyboard, Xib or only code options. You can also select the elements on the design, group them as you wish for your code library and download it easily in like 15 minutes :) It was a dream of me to get the UI code that easily, I hope it can be also useful to you.

iOS left slide navigation mernu

I want to have in my app some nice slide navigationmanu just like in SWRevealViewController. My problem is that SWRevealViewController needs iOS 7.0 and ARC and in my project I have iOS 6.0 without ARC. Is there any way to use SWRevealViewController in my app or maybe there is any alternative to it?
You might want to take a look at ViewDeck https://github.com/Inferis/ViewDeck
It is compatible with iOS 6 and non-ARC.
I cannot tell about SWRevealViewController without ARC or iOS7 (thus I cannot directly answer your question), but I would put a lot of weight behind the following :
Over 80% of all iOS devices currently run iOS7 or greater. ARC has been available since iOS5, which is several years ago.
The mobile market is a quickly evolving one. Not upgrading will quickly lead you to a dark path where you'll end up fighting a losing battle. I understand that your project probably has limitations, but converting right now and keeping up with new technologies will save you a lot of trouble (for instance, trying to make a newer component work with your specific setup).
I would add, the same goes for AutoLayout. If you aren't using it already, you should start, NOW. Rumor has it the next iPhones will vary in size, and the legacy way of handling visuals cannot scale correctly (perhaps the whole reason AutoLayout was created is to prepare this change).
So in short, I wouldn't recommend adapting a new component to your old project, but rather updating your old project to make it modern. You'll end up saving a lot of time.

IOS Orientation fix doesn't work all the time

I am developping a swipe gallery for mobile devices. Users can change images by sliding the screen, as any normal images gallery in most iPhone app.
Here is a demo:
http://daviddarx.com/stuffs/work/custom/swip/
To debug the iOS orientation bug (which let the content zoomed when you change the orientation), I used the only library that correct that:
http://scottjehl.github.com/iOS-Orientationchange-Fix/
Unfortunately, this library is working perfectly most of the time, but it happens to fail and not work correctly. This happen around 1 time on 10 times, and the result is then the same as if the library wasn't here.
This is not a huge problem on most of the mobile and responsive website, as the user can manually dezoom and then get back to the normal display.
But the problem here is that I had to disable the zoom function, to make my system work correctly. So, when the bug happen, once on 10 times, the gallery is then just bugged and stay like that....
So, here are my questions:
-do you know any other library that manage that bug fix, and is 100% completely reliable?
-if not, do you know a way to correct the used library to get a 100% support rate?
-if not, do you have any idea or solution for me?
Thank you in advance for your help!
David
There's an outstanding pull request on Scott Jehl's repo that uses slope detection instead of absolute values which seems to not suffer from the intermittent-ness of the original solution.
https://github.com/PeterWooster/iOS-Orientationchange-Fix/

Create custom, iOS 6 like, App Store TabBar (image included)

I'm working on an app originally developed by another programmer. My job is to make the interface more appealing. One really effective way I've found is to customize the tab bar. I've become very fond of iOS 6's App Store for iPad. I was wondering what would be the best way to recreate this (for iPad)? Any help would be greatly appreciated guys!
The app relies heavily on the UITabBar, so I'm trying my best not to change this model. I've checked out TBTabBar, but currently it only supports the iPhone.
I have found some customisation here and here. I don't know if it is working on iPad too, but I hope it helps to get a direction.

Resources