I am working in a multiple developer native iOS app project.
Both developers need to access and modify UI elements so which one do you think is better to use; Storyboards or Xibs? I read some documents and some of them put Xibs over Storyboards as Storyboards can have lots of conflicts on merging the UI components but xibs have more independent structure.
Do you know any tools or appropriate ways to do that?
Our approach for now is to use 'multiple storyboards' and cut them clean so that the developers wouldn't need to modify each others storyboards. What do you think about this approach?
Thanks,
E.
I won't go too deep into it, but both are fine. Especially if you do it in Xcode 5 and above, the format of xib/Storyboard file is much more version control friendly.
Use Storyboard if the interaction in your applications are quite simple and linear. Use xib files if many elements are reusable. Check out this answer for more in depth explanation.
Related
I have created a webapp using Wix, which relies heavily on the repeater element to display content from a database inside a repeating element. Repeaters do pretty much exactly what I want, but I realize they are built on a pretty sophisticated API, and there's a lot of stuff making this happen in the background.
Ultimately for this project, a native iOS app is the end goal. However, I have no experience in xcode - but willing to learn. Before I get in too deep, is there any kind of functionality I could find to achieve something like this?
Thanks in advance
You can't convert Wix Repeater element to Xcode. But, you can make deep customization to your Wix elements by using Wix Corvid.
If you not familiar with it, it's is a developing platform integrated into the Wix ecosystem that allows users to build advanced sites. Among other things, it’s able to create and manage databases, build dynamic pages, host user-generated content and more.
I'm trying to uses swift playground on iPad.
It supports all of iOS classes.
But I can't find this features
How can I import GitHub library?
How can I create multiple Swift files?
Anyone know about this?
You can do this one of two ways.
Do it on GitHub and then download Working Copy. It's a free iOS app that allows you to download projects from GitHub as .playground files and run them in Swift Playgrounds.
Do it on a Mac. I understand this might not be possible, but it is by far the best method of doing this. It is much easier and, as a whole, better. For the best experience, I recommend this option.
This might be hard to diagnose without seeing the project, but Xcode keeps adding tons of warnings to my storyboard. It is a source controlled project, and if a team member cleans up all the warnings, pushes, and I pull, the warnings go away but as soon as I open storyboard, they reappear and they do not go away when I do the standard Update Frames option.
A lot of them seem to have to do with Stackviews, but I'm just confused why my coworkers can get the warnings to disappear and I cannot.
Has anyone experienced anything like this, or have any tips on how to approach solving this?
I was using Xcode 7.3 but after updating to 7.3.1 the problem still persists. Running OS X 10.11.6
Edit: Just to add some specifics, when I look at the source code versus my local code, it basically adds a ton of "Misplaced" tags, and a lot of values are changed by 0.5 or 1 pixel.
I do have the exact same issue when working with others on the same storyboard. It will happen every time you open (or another colleague) the storyboard. Here are some advises to avoid this :
When I open the storyboard, I know it will provoke this warnings. So if I don't add anything, before pushing a new commit, I reset any changes on the storyboard
I've come up with another good solution : using storyboard references as much as I can. So what I do is basically creating a storyboard for every flows (sometimes you can even have one storyboard for one controller). That way, when I work on a part of a project, it won't generate warnings on the totality of the storyboard. It avoids epic merge with many conflicts, it is easier to maintain, and it's faster to work on a small storyboard than on a huge one (Xcode is powerful, but when you have big storyboard, at a certain point it will lag).
But to answer to your question, I think everyone have that same issue when working on big projects, hopefuly apple will solve that one day, but for the moment you have to set good practices with your team. This is the only way to avoid wasting time at every pull ;) (at least for me, maybe someone has a better solution).
Assume you have to develop an app, which needs a completely customized user interface so that you can not use any standard UI objects in Xcode.
How would you proceed to create such an user interface? Would you use the interface builder? Would you create something like a master parent UIView? What are the best practices to achieve this?
What would be the most elegant solution with less code duplication?
If by "complete customization" you mean the look and feel of the app,
then I suggest to design the IB objects you require using some design IDE's such as photoshop and then use those slices for your project.
This is the best option I find so far to get a complete customized look with minimal code, and by minimal, I mean you don't actually require any coding. You can do this complete customization within your Interface builder.
However, I don't think you can completely ignore standard UI objects as you require them to add basic functionality.
If customized controls are what you are looking for, then I suggest you to create separate custom control classes so that they can be reused anywhere in your project, or in other projects too.
Here are two wonderful tutorials on custom controls:
http://www.raywenderlich.com/36288/how-to-make-a-custom-control
http://www.raywenderlich.com/56885/custom-control-for-ios-tutorial-a-reusable-knob
Hope this helps!
I'm trying to understand how the things in Cocoa works but I'm struggling with one thing. I saw http://cocoawithlove.com/2010/09/minimalist-cocoa-programming.html and http://casperbhansen.wordpress.com/2010/08/15/dev-tip-nibless-development/ and I think I somewhat understood.
Now, I would like to do the same but for a "Document-based application". Please, does anyone know of a tutorial or example akin to the ones above? Alternatively, what do I need to do to make it work? I think I need to create NSDocumentController - but how does it relate to NSApplication? And I create NSDocument from there? Frankly, I'm bit lost...
That was me six months ago! I did not find a decent tutorial either but started with a new project using the default Xcode project template:
I started out with the setup Xcode generates for you when you start a new project and implemented piece by piece as I went along. There's some good reading here on Stackoverflow about the use of the various controller classes but here's what I did:
The document class, generated by Xcode, is my top level controller. I do not use NSDocumentController.
Each use case of my app has a number of NSViewControllers which manage the various views of the use case. These controllers are dynamically swapped in and out. The top level controllers are managed by the NSDocument class (NSPersistentDocument in my case as I use Core Data).
I am by no means an expert, so I stand corrected for better approaches but so far this setup has been easy to work with, easy to maintain and easy to extend.
Note: Using Core Data is optional but over time I've come to love it and think it's very powerful and a huge time saver. When you decide not to use Core Data, the above setup will still work but you will have to manage your own data.
EDIT: This post explains the relevance of NSDocumentController.
EDIT2: This one from Apple is an interesting read as well.
EDIT3: You do need NIBs (or XIBs as they're now called) as they contain the UI of your app. You pull them in via a view controller (subclass NSViewController):
NSString *aControllerName = [anIdentifier stringByAppendingString: #"ViewController"];
NSString *aNibName = [anIdentifier stringByAppendingString: #"View"];
Class aControllerClass = NSClassFromString(aControllerName);
[self setCurrentController: [[aControllerClass alloc] initWithNibName: aNibName bundle: [NSBundle mainBundle]]];
In the above anIdentifier could be Department, which would instantiate the DepartmentViewController and load the XIB name DeparmentView.
You can use plists to store your data but that's not a requirement. There are many ways to store your apps data. You'll have to read about the various architectures Apple has in place and make your own choices.