storyboard

Switching language in running app for view elements in storyboard

。_饼干妹妹 提交于 2019-12-12 23:36:40
问题 I have an app that that I am wanting to change languages inside the app and this works fine with the localize.strings, but this code is not triggering the main.strings files. The below is the code used in the settingsLanguageVC import UIKit let AppLanguageKey = "AppLanguage" let AppLanguageDefaultValue = "en" var appLanguage: String { get { if let language = NSUserDefaults.standardUserDefaults().stringForKey(AppLanguageKey) { return language } else { NSUserDefaults.standardUserDefaults()

Storyboard segue Show Transition vertical from bottom instead of horizontal

狂风中的少年 提交于 2019-12-12 22:14:11
问题 I've got a basic storyboard setup that segue transitions through some view controllers by clicking a button. I've also got a Navigation controller at the root of the storyboard, hoping this segue chain performs similarly to how a series of Pushes used to work. The functionality is all there, as is the navigation bar controlling, however the transitions all have the new views coming in from the bottom and sliding up, Cover Vertical. How do I configure this to slide in from the right side like

PopoverPresentationController coming as nil

℡╲_俬逩灬. 提交于 2019-12-12 21:25:44
问题 Created a SingleViewApplication in that I have placed a button. Now clicking on button I need to display a tableView as popover. The TableViewController is created in xib. The issue is tableViewController.popoverPresentationController always comes as nil see below code let filterVC = TableViewController(nibName: "TableViewController", bundle: nil) var filterDistanceViewController = UINavigationController(rootViewController: filterVC) filterDistanceViewController.preferredContentSize = CGSize

iOS - Changing frame of a subview of a subclassed UIView (using storyboard with auto layout enabled)

风流意气都作罢 提交于 2019-12-12 19:22:50
问题 I am building a custom progress bar (subclass of UIView). I add an UIImageView to the UIView that uses repeating images to display the progress. The view is added to the storyboard and I can get it to display just fine, however if I try to change the frame then it only displays whatever is shown in the storyboard file (i.e. if the storyboard view has a yellow background, but the code of the uiview subclass changes it to green, if I try to change the frame of the UIImageView in the code to

ios7 storyboard items won't move

别说谁变了你拦得住时间么 提交于 2019-12-12 19:14:18
问题 I'm trying to move storyboard items in my viewcontroller layout, but the when ran in the simulator, they won't budge. It seems that they are sticking to the orange dotted lines above where I placed them. What are those orange lines and why can't I move my items? Here's what it looks like in the simulator: 回答1: Those orange dotted lines show that the frames of the views don't match their constraints. In this example, I placed a label, pinned it's leading and top space, then moved the label.

Binding a Storyboard Animation inside a DataTrigger crashes the XamlParser

一曲冷凌霜 提交于 2019-12-12 18:22:34
问题 I want my application to animate an ellipse to a new position everytime a certain event happens. For testing purposes I made a button that changes a viewmodel property and this property is bound to a datatrigger that fires the animation, but later on I want the viewmodel to trigger it based on other events I haven't implemented yet - that's why I can't use the eventtrigger being bound to that button directly in the view, I need the viewmodel. Because the ellipse is supposed to be moved by the

Is it possible to create prototype cells in Interface Builder without story boards?

懵懂的女人 提交于 2019-12-12 18:09:42
问题 In the WWDC video "Session 309 - Introducing Interface Builder Storyboarding" the speaker adds a table view controller and creates a cell in IB that can be directly linked to outlets in the app (at about 13:30 in the video). Can this be done without story boards and if so, how to do it? 回答1: You can create a nib file with just a table cell in it, set the class to a custom UITableViewCell subclass, and link any cell subviews to outlets in the class. 来源: https://stackoverflow.com/questions

Back button to another storyboard

半腔热情 提交于 2019-12-12 17:30:32
问题 I am creating an iOS app which consists of 2 storyboards. This is the second one: I am targeting iOS 7 so I cant use storyboard references. Switch between storyboards is handled programmatically Using this code: let viewController:UIViewController = UIStoryboard(name: "Warnings", bundle: nil).instantiateViewControllerWithIdentifier("WarningsInitialView") as UIViewController self.presentViewController(viewController, animated: true, completion: nil) I can get to the second storyboard using

Swift set UIButton setBorderColor in Storyboard

守給你的承諾、 提交于 2019-12-12 16:31:45
问题 I'm trying to set UIButton Border color on Storyboard: But the button is still Black. When I try to use layer.borderColor, it doesn't show the border at all. How to se the color? Thank you // UPDATE I've changed the way to set up based on @dfd to: import Foundation import UIKit @IBDesignable public class OnboardingButton: UIButton { @IBInspectable public var borderColor:UIColor? { didSet { layer.borderColor = borderColor?.cgColor } } @IBInspectable public var borderWidth:CGFloat = 0 { didSet

Call Swift ViewController from Obj C didSelectionRow

强颜欢笑 提交于 2019-12-12 16:03:06
问题 I have an Obj C project that I have added a Swift viewController to. I'm trying to attach a storyboard to the viewController. I can programmatically add things to the view but I can not get the storyboard to show up. I have also tried to use a xib as a vie for the Swift viewController with no luck. Calling the Swift vie form Obj C from a didSelectRowAtInexPath: SwiftController *sc = [[SwiftController alloc] init]; [self.navigationController pushViewController:sc animated:YES]; SwiftController