Posts

Post not yet marked as solved
11 Replies
14k Views
I am presenting a sheet using the view modifier .sheet(item: ...) if the view you are presenting is wrap inside another view which only add a navigation view let's say I have a view called ViewB with a dismiss button which called the presentation mode dismiss, that works let' say I have another view called ViewBWithNavigationView where it's calling ViewB inside the NavigationView and it also calling dismiss on the cancel button the result of this is that the presentation mode dismiss will only works for the first view B the cancel button, it will no close the view if you click the button inside the view struct ViewBInsideNavigationView: View {       @Environment(\.presentationMode) var presentationMode   var body: some View {     NavigationView {       ViewB()         .navigationBarTitle("View B", displayMode: .inline)         .navigationBarItems(leading: Button("Cancel") {           self.presentationMode.wrappedValue.dismiss()         })     }   } } the call to self.presentationMode.wrappedValue.dismiss() inside ViewB is not trigger and the view is not dismiss thanks
Posted
by giguerea.
Last updated
.
Post not yet marked as solved
6 Replies
872 Views
Please help me with this, I need to put a protocol requirement constraint somewhere in my code but I don’t know where Business case: A generic filter manager class that can manage a list of filters A filter is defined by a protocol, the filter specification should have the field type (string, int, date …) and the array type, the filter class implementing the protocol will be responsible to extract the distinct value from that array protocol SimpleFilter {     associatedtype ArrayType: Collection     associatedtype ValueType: Comparable     var values: [ValueType] { get set }     func extractValues(from array: ArrayType) } let’s define an object type for the array we would like to filter as an example struct City {     let code: String     let country: String     let region: String } An array of cities could be filtered by country & region, we will define 2 filter fields class CountryFilter: SimpleFilter {     var values = [String]()     func extractValues(from array: [City]) {         // remove duplicates     } } class RegionFilter: SimpleFilter {     var values = [String]()     func extractValues(from array: [City]) {         // remove duplicates     } } with Swift 5.7 we can now use Any to store these filters in the same array let filters: [any SimpleFilter] = [CountryFilter(), RegionFilter()] Now we need to build a filter manager, this filter manager will accept a generic array to be filtered and the filter fields, a protocol requirement is required on the Array Type I guess, this is where I need help ... in the initializer, I would like to unbox SimpleFilter and pass it the generic array but it does not work class FiltersManager<T: Collection> {     private var originalArray: T     private var filteredArray: T     private(set) var filters: [any SimpleFilter]     public init(array: T, filters: [any SimpleFilter]) {         self.originalArray = array         self.filteredArray = array         self.filters = filters         for filter in filters {             //filter.extractValues(from: array) <— Missing a constraint here         }     } } I tried something like this but it does not work either class TestFiltersManager<T: Collection, F: SimpleFilter> where F.ArrayType == T { thanks for help alex
Posted
by giguerea.
Last updated
.
Post not yet marked as solved
0 Replies
615 Views
I have to regenerate a Distribution Certificate for a client (for the enterprise program). These certificates are valid 3 years. When I click create certificate, there is no option anymore to chose the Apple Distribution, I only have the option Apple Development under Software, what happens to Distribution certificate for enterprise accounts? alex thanks
Posted
by giguerea.
Last updated
.
Post marked as solved
3 Replies
1.5k Views
With the recent macOS update 11.2.2 Apple Music on my mac mini (M1) search function does not work if I type any artist in the search bar (select the scope button Apple Music) hit enter I got the message No Results for "the artist searched" however while typing the artist name, if you click on the suggestion in the auto-complete, it works I tested the same functionalities with my MacBook Pro 2016 and it works, looks like something related to the M1 version, it was also working in previous version like (macOS 11.2) thanks
Posted
by giguerea.
Last updated
.
Post not yet marked as solved
0 Replies
621 Views
The API is still not there in SwiftUI 3, is there any plan to port this UIKit API to SwiftUI or is there any recommandation how to achieve it in SwiftUI ? it should be an access modifier on NavigationLink thanks
Posted
by giguerea.
Last updated
.
Post not yet marked as solved
1 Replies
1.2k Views
In SwiftUI List / ForEach, there are still no way to have custom swipe actions like we have in UITableViewDelegate leading &amp; trailingSwipeActionsConfigurationForRow I was expecting this feature to be delivered in the second version of SwiftUI
Posted
by giguerea.
Last updated
.
Post not yet marked as solved
0 Replies
356 Views
Working with more than 1 UINavigationController is pretty common in a UIKit app by example, you could have one navigation controller for an on boarding process to finally arrive to a main menu like a UITabBarController where each tab is embedded in it's own navigation controller however it's not possible in SwiftUI when you push a view where your destination view has it's own NavigationView, you will have 2 navigation bar embedded it's that a bug or the expected behaviour? thanks
Posted
by giguerea.
Last updated
.
Post not yet marked as solved
0 Replies
470 Views
I am trying to know the value that was changed in the history, however after getting the transaction,after getting the NSPersistentHistoryChangefrom the transaction.changes SETthe changes only give us a SET of updated properties, you don't know from which the old &amp; new value in that time ...you only have the changed object id and that will give you the current value ...if you have 2 transactions that change the same entity, same fieldit's impossible to know what was the value of the field in transaction 1please help, that looks like a big omission thanks
Posted
by giguerea.
Last updated
.
Post not yet marked as solved
1 Replies
1.8k Views
Not sure if something changed recently or today, but as of today, our App with Automatic Signing (where the profile is managed by Apple) can't be archived, it used to works, same piece of code on the same git branchnow we got an error message saying IPA Processing Failed ...on the Signing &amp; Capabilities, when we click on the little i next to the provisioning profile, we can see the iOS Team Provisioning Profile is selected correctly ...but when archiving, it can't find it, it propose the wildcard profilethanks
Posted
by giguerea.
Last updated
.
Post not yet marked as solved
0 Replies
1.9k Views
I found this weird behaviour in my app.App View Layout:UITabBarController (RootViewController) Tab1 = Navigation Controller with TableViewController Tab2 = Navigation Controller with TableViewControllerIf Tab1 table view cell is click I push a detail view controller and hide tab bar items and display UIToolbarIf you click the home button, of switch to another app and come back to the app, the UIToolbar position has changed and is now sitting above the tabbar items which are invisible at this point.More Details:My initial view controller is a UITabBarController which content 2 tabs.Each tab content 1 view controller embedded into his own navigation controllerif you click on a tableviewcell, I want to push a detail view controller and hide the UITabBarController items,in the prepare for segue I passed hidesBottomBarWhenPushed = true, which works finein my detail view controller (a simple UITableViewController) I need to show now a UIToolbarwhich I can do like that in viewWillAppearsnavigationController?.setToolbarHidden(false, animated: true)UITabBarController (RootViewController) Tab1 = Navigation Controller with TableViewController Tab2 = Navigation Controller with TableViewControllerIf Tab1 table view cell is click push detail view controller but hide tab bar items and display UIToolbarNow the bugs, we are now in the detail view controller, the tab bar items have been hide and we can see a UIToolbar a the bottomLike I said previously, if you switch app and come back into the app, the UIToolbar will now be place above the TabBarItems which is invisible at this pointinitial tab barhttps://www.dropbox.com/s/9lsk908drvnsw07/TabBarItems.png?dl=0detail after pushing detail (tabbaritems are now hidden and I display toolbar)https://www.dropbox.com/s/5nuaad5pe3u68e5/DetailsVC.png?dl=0detail after resuming the app, just need to go back to home menu or change to another app and come backhttps://www.dropbox.com/s/odfcog8avazvp64/DetailsVC%20after%20app%20switching.png?dl=0thanksalex
Posted
by giguerea.
Last updated
.