Search results for

SwiftUI List performance

50,609 results found

Post

Replies

Boosts

Views

Activity

Failing to use a generic function with a protocol type argument
Why does this not work, my misunderstanding or a bug?protocol Foo {} extension Int : Foo {} func bar<T:Foo>( objects : [ T ] )->T? { return objects.first } let x1 : [ Foo ] = [ 123, 456] let x2 : [ Int ] = [ 345, 678 ] bar( x1 ) // <- fails : expected an argument list of type [T] bar( x2 ) // OKI have an empty protocol Foo, a function which is generic on any Type which is a Foo. I've made Int conform to Foo here and can pass an Int array to the function and it works. However if I try to pass a Foo array, the compiler doesn't allow it. It took me a while to figure out it only works if I pass a concrete type which conforms to Foo and doesn't work if I pass something which is a Foo or another Protocol which extends Foo. A protocol is a 'type' and Foo is a type conforming to Foo, so it should satisfy the generic function and be callable.
2
0
270
Jun ’15
Reply to Apple's canOpenURL 'solution'
That's now how the whitelist will work, if you have say 20 GPS apps listed in your whitelist but the user only has 1 installed then your canOpenURL call would only return True for the 1 that they have installed.Apple wants to lock this down completely, they say this is to stop things like being able to log how many and what apps users have installed but the real recipients of this crackdown are services that use the canOpenURL for targeting ads based on what apps a user has installed.
Topic: App & System Services SubTopic: Core OS Tags:
Jun ’15
Reply to OSX Captain crashed
I think you should check the KeyChain Access app again. The entry you're looking for won't be LaCie, but will likely contain the name that you gave to the drive - which may be the name that appears in Finder when it's plugged in. Either way, you can select All Items in the sidebar for each of the Keychains listed in the top left and then, each time you select a new keychain, scroll down the list looking for something that might be it.
Topic: App & System Services SubTopic: Core OS Tags:
Jun ’15
Reply to Can't log into iCloud: Verification Failed - Your username or password is incorrect.
Well, after I called SetupAssistantSpringboard a second time it allowed me to login into keychain. Nice. So there is only Messages and the App Store Login missing in my login journey. I realized that Messages in't even listed in Internet Accounts under iCloud. iCloud now is listed in Messages itsself, but deactivated. I can't activate because it wants me to log in (which won't work).
Topic: App & System Services SubTopic: Core OS Tags:
Jun ’15
Reply to Your account already has a valid iOS distribution certification in the member centre,but it is not installed locally,if your signing identity is installed an another mac.
But actually it is, it displays in Keychain access caertificates list. Xcode doesn't allow me to import any profile files and something like this. I' ve tried all standart solutions: revoked certificates, provisioning files reinstalled it and all this. How to fix it?
Jun ’15
Reply to Your account already has a valid iOS distribution certification in the member centre,but it is not installed locally,if your signing identity is installed an another mac.
But actually it is, it displays in Keychain access caertificates list. Xcode doesn't allow me to import any profile files and something like this. I' ve tried all standart solutions: revoked certificates, provisioning files reinstalled it and all this. How to fix it?
Jun ’15
Questions/Possible issues with Advanced Operations sample code
The Advanced NSOperations (https://developer.apple.com/videos/wwdc/2015/?id=226) talk from this year was a real eye opener. I've used NSOperations in my app before but not to the extent as shown in Advanced NSOperations.I've spent a little time to translate some of the sample code from the Advanced NSOperations for my app and have started using the custom operations and queues to implement CloudKit syncing.I also took some time to read the Concurrency Programming Guide as well as the docs for NSOperation and NSOperationQueue. As I did I made some notes about things in the docs that didn't seem to match up with the sample code implementation. I'm listing them here just in case they come to anyone else:In Operation.swift, the isReady method is overwritten to support custom conditions. If the Operation is .Pending, and the super's isReady returns true, then the conditions are evaluated. If the state of the Operation is .Ready, then the operation isReady returns true if the super's isReady returns true.
18
0
5.9k
Jun ’15
Reply to Writing / Reading Data Files in OS X
In addition to the information above, you might want to check out NSJSONSerialization in case you need interoperability with JSON-friendly components or services. A few pieces of documentation you might be interested in:Reading and Writing Property-List Data in the Property List Programming GuideCollections Programming TopicsArchives and Serializations Programming Guide
Topic: UI Frameworks SubTopic: AppKit Tags:
Jun ’15
Upload from another country
Hello everybody,I'm currently working on my first app and it's almost ready for submission. Now my problem is, I'll leave the country, I'm registered in (Germany) and just want to know, if it's possible to submit my app from another country (in this case Kosovo).I couldn't find any information, just the fact that Kosovo is not listed as a valid territory.Thanks in advance for any help and advice.
0
0
221
Jun ’15
Reply to Getting NSBrowser+NSTreeController to recognize its delegate
First time I needed to use NSBrowser. Pretty confusing API. The documentation in the NSBrowserDelegate protocol lists a bunch of methods that are incompatiable with eachother.Would probably be nicer if they just deprecated NSBrowser and replaced it with something new. I don't really like chicken dancing with delegate methods like this.I get Must implement browser:willDisplayCell:atRow:column: and either browser:numberOfRowsInColumn: or browser:createRowsForColumn:inMatrix:But there is the item API too, which draws double arrow indicators for branches, for some reason.
Topic: UI Frameworks SubTopic: AppKit Tags:
Jun ’15
Reply to Why can't I make Array<T: Equatable> conform to Equatable?
It seems like it would push the whole conformance-checking system further into runtime/dynamic territory. Protocol conformance is now dynamically checkable, but it can be relatively efficient because all objects of type X either will or will not be Y-compliant.Consider:Code region A: protocol Tweakable {} let a = [Int]() ... if a is Tweakable { ... } Code region B: extension Aray where T: Hashable: Tweakable {}The existence of region B makes [Int] tweakable and so should change A's behavior, even if they are in separate modules. To preserve correctness, the compiled code for A would have to run through some kind of runtime list of possible conformances and their type constraints in order to answer the is question.As it is now, you can in fact doextension Array: Tweakable {}But that information probably only has to be recorded in one place and is true for all Arrays, so the dynamic check is relatively efficient.I suppose the compiler or linker could generate some kind of cartesian product of all types
Topic: Programming Languages SubTopic: Swift Tags:
Jun ’15
Mail still running the CPU
I stopped using it for a while when its performance with GMail accounts went bananas. It kept thinking there were millions of messages to download.When I installed 10.11, I figured I would try it again. For the most part, it is improved. It for sure looks like that problem was fixed.That said, I still hear the fan on my laptop a lot and look to see Mail chewing on the CPU for no good reason.I have mails going back to 2004. I wish this app was smart enough to not download everything. Maybe that's not the reason it's performance is abysmal. Before ditching it again, I thought I would ask for some opinions. I could move all the mail to a box and archive it, but then I would have to go delete it from Google which seems insane. This does not seem like a problem that should have a company of Apple's size tied up in knots over the span of many releases.Maybe they let the Adobe guy who did Flash takeover mail when he joined and burning up millions of dollars of energy doing nothing is just habitual
1
0
239
Jun ’15
Reply to NSToolbar: Center item
You could try using NSView in your toolbar and Auto Layout to center the control. That will give you much finer control than those flexible space items. If you open your main nib or storyboard and double-click on the toolbar to access the list of toolbar items, you can drop a view in there and use NSToolbarItem to host it in the toolbar. I've had trouble with the view failing to appear when placed directly in IB, so I'd recommend that you just place a container view in your toolbar item, create an outlet to it, place your segmented control in a separate top-level view in your nib or scene with another outlet, and insert the real view programmatically into the container you put in the toolbar. (Don't forget to set up your constraints and translatesAutoresizingMaskIntoConstraints property!)
Topic: UI Frameworks SubTopic: AppKit Tags:
Jun ’15