The sessions talks about a new subtitle ability for UIMenus (“These buttons also benefit from improvements in menus like the ability for menu items to have subtitles for greater clarity.”) but I cannot find documentation on how to enable said subtitle.
Even using the example code with the new .singleSelection option does not display any subtitle..
Anyone did succeed in doing so?
Post not yet marked as solved
My company has a product that is a kind of Endpoint Security Application.
We haven't had its entitlement. So we submit a request to register Endpoint Security Extension entitlement on the Apple website.
After submitting the request, we received an automatic email from Apple, they said that they will review our request and they will send us an email when they evaluate our information.
But after a few weeks, I haven't received any email from Apple and I don't know whether my request is accepted or not?
In the case my request is rejected, will I get an answer email from Apple? And how long to get their answer? Currently, our product is finished with development but we don't have the entitlement to publicize it.
Thanks,
Phu Luu
Post not yet marked as solved
We found that it can't obtain the content of input box in iOS15. When will fix this bug?
Hello everyone, I created button in my custom cell, when the user click the that button, I have to segue another class and also I have to pass some data but problem is I could not segue in custom cell, so how can I detect when user tap that button ? or how can I solve this problem
I was wondering how i could have 2 functions work from 1 button. One would happen on the first time you click and second will happen the second time you click.
in java something like this:
if button pressed{
// Code
if button pressed{
// Code
}
}
or at least that's how I was taught in java.
so I'm wondering how I could do that in swift. Thanks!
Post not yet marked as solved
When I create a UIButton by new iOS15 api:
UIButton(configuration: .plain(), primaryAction: nil)
I lose the title fade transition that is provided by UIButton which created by old api:
UIButton(type: .system)
This is a feature or bug?
I think it is bad that system control lost the subtle animation. I hope Apple can fix it in the future version.
May I used it wrong? If I'm wrong, please help me fix it, thanks🙏
Post not yet marked as solved
Up until iOS 15 it was possible to set maximum number of lines of the UIButton titleLabel property, but when UIButton.Configuration is used to configure button's properties setting the titleLabel?.numberOfLines to any value is always ignored and reset after assigning text to configuration.
See the short piece of code below:
import UIKit
let button = UIButton(configuration: .plain())
button.titleLabel?.numberOfLines = 1
print("Lines: \(button.titleLabel?.numberOfLines ?? 999)") // <- prints "Lines: 1"
var buttonConfiguration = button.configuration
buttonConfiguration?.title = "Any text"
button.configuration = buttonConfiguration
print("Lines: \(button.titleLabel?.numberOfLines ?? 999)") // <- prints "Lines: 0"
Even if you set the numberOfLines to 1 it is ignored and the button renders one, or more lines of text.
I think it's a bug, there is no compiler warning about accessing the titleLabel property, as there is with imageEdgeInsets for example. If you access that one Xcode gives you a warning
'imageEdgeInsets' was deprecated in iOS 15.0: This property is ignored when using UIButtonConfiguration
If modifying titleLabel directly there should be a warning as well, but if that's the case, the UIButton.Configuration is seriously lacking some features, like setting maximum number of lines, or even a font (this can be done via AttributedString but setting font is so common that constructing AttrbitutedString every time the title is changed feels so wrong and unnecessary)
For the time being I'm forced to use the legacy button customisation
Post not yet marked as solved
I'd like to have the title and subtitle of a UIKit UIButton both on the horizontal axis. I didn't see a configuration option for such. Is there a way to do so?
Thanks
Post not yet marked as solved
Good day, I would like to generate a text field when I tap on the green button that creates a new text field and I can still enter for example a 2nd phone number. I have already tried it with this example:
Button(action: { print("Telefonnummer")}) {
Image(systemName: "plus.circle.fill")
.foregroundColor(Color(.systemGreen))
}
Post not yet marked as solved
Hi everyone ,
just started to have a look about XCode and SWIFT unite and after creating my struct ContentView: view i wanted to put a BTN that start he AR experience (with the function to scan an element from a voucher)
Btw i didn't manage to start the camera opening with the press of the Btn.
Knowing that this is a very basic question i ll ty in advice who is gonna spend some time for an ansewr.
Post not yet marked as solved
Hi, guys. I'm testing the new pop-up and pull-down buttons in iOS 15, but they do not show the pop-up menu when pressed (all the options in the Attributes Inspector panel are checked). They only work when I define the entire menu in code. My questions are:
Is this because the feature was not implemented yet?
If this is implemented later and we can define the menu in Interface Builder, how do you respond to a selection? In code, I can specify the action in the closure, but how do I do it if the menu is defined in Interface Builder?
This is how I define the menu from code, just in case someone needs to know:
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var myButton: UIButton!
override func viewDidLoad() {
super.viewDidLoad()
let optionsClosure = { (action: UIAction) in
print(action.title)
}
myButton.menu = UIMenu(children: [
UIAction(title: "Option 1", state: .on, handler: optionsClosure),
UIAction(title: "Option 2", handler: optionsClosure),
UIAction(title: "Option 3", handler: optionsClosure)
])
}
}
Thanks
JD
Post not yet marked as solved
when i press on button that shows another vc that contains search bar the button freeze for 2 sec then redirect me to the view controller and this happens for the first time only I tired to hash my logic and keeps only the search bar but nothing worked just when I delete the search bar everything goes right
Post not yet marked as solved
Being new at this, I created a new swift project. The default code build and the 'hello world' shows in the simulator. I added a text and a button object by dragging them onto the storybook. Now running the project the text briefly shows, the button does not, and then the text disappears and the 'hello world' shows. I cannot find a simple sample project to start with that might have such objects and all the queries online have not been explicit as to how to make this work.