Search results for

“SwiftData inheritance relationship”

4,980 results found

Post

Replies

Boosts

Views

Activity

Reply to Facebook Platform Policy describes that you're not allowed to pre-fill using the iOS Share Sheet.
Great one EMC2732. So I think as Facebook and Apple have a relationship to include social accounts in the OS itself means they are able to have these adjustments and possibly when Facebook is installed the extension showing is switched to one bundled with the Facebook app. Although I could totally be wrong on that!I build an app that allows sharing to Facebook and we've recently had to adjust things on web and iOS to ensure we don't prefill any content to Facebook when sharing links etc.I think the suggestion to use the Facebook iOS SDK is simply just them wanting to provide the best experience and still won't allow you to prefill content, especially as they can quickly make adjustments to the SDK compared to that within iOS itself. The key thing they are after is having the user add their own copy to the message field with link/photo attachments. I haven't see the SDK provide anyway of prefilling a share sheet with text.Just some thoughts. I'm sure Apple have reviewed Facebook's app thoroughly.
Topic: App & System Services SubTopic: General Tags:
Sep ’15
Reply to What is the behavior when there are multiple apps implementing NETunnelProvider class of APIs
Q1. Which app gets the priority for filtering decisions?Q2. If one app allows website A but the other app disallows website A, how would OS decide?This is actually covered by the documentation, but you have to read between the lines a little. Specifically, the NEFilterManager Class Reference has this to say about the enabled property. Setting this property to true and saving the configuration will disable all other network content filters on the system …Thus, it’s not possible to have multiple filter providers active simultaneously, and thus the situations you described can’t crop up.Q3. If there are multiple apps implementing NETunnelProviderManager with default route, who will get the utun packets?This is also covered by the documentation, this time in the NETunnelProviderManager Class Reference.VPN configurations created using NETunnelProviderManager are classified as regular enterprise VPN configurations (as opposed to the Personal VPN configurations created by NEVPNManager). Only one enterprise VPN confi
Sep ’15
Make toolbar items and WebView "communicate", how to?
Hi everyone,I'm quite new to OS X development. In my first serious app, I need to make NSToolbar items change their state according to changes in other components of the UI. The application architecture is the same as the document-based cocoa application template provided by Xcode, with the following modifications:Window Controller scene: I've added the toolbar as part of the window and set it up to use a custom controller which inherits from NSWindowController.View Controller Scene: I've replaced the included components with a WebView and set it up to use a custom controller that inherits from NSViewController.What I want to get is that, for instance, when the webview loads a new page, the value in a text field included in the toolbar should reflect this change. At the same time, when the user enters a new value in that field, the webview should load the new page. Yes, I am working on a browser! 😉Anyways, I know the WebView delegate methods I should implement, but the problem is that:- Int
Topic: UI Frameworks SubTopic: AppKit Tags:
1
0
784
Sep ’15
How to call PacketTunnelProvider?
I have added the extension through Target > Packet Tunnel and got a PacketTunnelProvider generated.I tried to call PacketTunnelProvider in my code but it will return:Undefined symbols for architecture arm64: _OBJC_CLASS_$_PacketTunnelProvider, referenced from: objc-class-ref in VPNConnection.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)Should I call the classes in the extension directly? Or should I inherit from it and do my customization?If there will be more document on it, it will be perfect.Thank you!
7
0
2.6k
Sep ’15
Reply to iOS 9 over the air deployment - Unable t o Download App
we're experiencing the same thing. seems like it only affects devices that did not have the app installed prior to upgrade, or devices that were restored/upgraded.i'm guessing it is a trust issue...with devices that had previously trusted the developer, then upgraded, there was no problem launching the apps until i delete them and try to reinstall them. once the trust relationship is gone (via deleting the previously trusted apps) ...baam... problem replicated. Previously, the OS would normally would ask if you want to trust the developer when installing, but that step isn't happening anymore. this did not happen to me when i was testing our apps with iOS 9 beta.the plist bundle identifier is the same name as the app... so i doubt that is the issue. i'm not an ios developer, but i'm wondering if the apps need to be rebuilt specifically for fresh installs (outside the app store). i'm waiting for our developer to get back to me on that.
Sep ’15
Reply to ios 9 in house app unable to install
we're experiencing the same thing. seems like it only affects devices that did not have the app installed prior to upgrade, or devices that were restored/upgraded.i'm guessing it is a trust issue...with devices that had previously trusted the developer, then upgraded, there was no problem launching the apps until i delete them and try to reinstall them. once the trust relationship is gone (via deleting the previously trusted apps) ...baam... problem replicated. Previously, the OS would normally would ask if you want to trust the developer when installing, but that step isn't happening anymore. this did not happen to me when i was testing our apps with iOS 9 beta.the plist bundle identifier is the same name as the app... so i doubt that is the issue. i'm not an ios developer, but i'm wondering if the apps need to be rebuilt specifically for fresh installs (outside the app store). i'm waiting for our developer to get back to me on that. also submitted a ticket with apple...
Sep ’15
UIAlertViewController tint color inherited from main window
Hi Guys,I am having some trouble setting the UIApperance property for UIAlertController. I am trying to change the color for Cancel Button but the following code does not work.[[UICollectionViewCell appearanceWhenContainedIn:[UIAlertController class], nil] setTintColor:[UIColor colorWithRed:0 green:0 blue:0 alpha:1]];Has someone faced a similar issue ? its specific to iOS9ThanksAkhilesh
1
0
673
Sep ’15
App Slicing and Bitcode relationship
Hi,As far as I know, App Slicing has two major parts of functionality:1. slice the resource so that only the certain suitable resources are downloaded for a specific device, for example, iPhone 5 only downloads @2x images and will not download @3x images.2. slice the binary code, that is the app store will compile your submission packages, and your specific only download the suitable codes, for example, iPhone 5 will only download the binary with Armv7 codes and iPhone6 will download hte binary with Arm64 codes.My question is:1. we have to set the bitcode enable to YES to activate the 2nd app slicing functionality, that is slice the binary code.2. If not, is slicing the codes automatically done when we submit the archive to the App Store now without any further setting or operation? Or you have to set the deployment target to 9.0 or later?Can anyone confirm that please? Thanks.
2
0
2.7k
Sep ’15
Reply to Protocol inheritance that heats up my computer
Here's a similar but smaller example, this time I will show the code before the workaround is applied. This will make the compiler work at 100% cpu for a long time and eventually it will stop with an error msg saying that the expression is too complex to be solved in reasonable time:protocol StaticArrayType : CollectionType { typealias Item var startIndex: Int { get } var endIndex: Int { get } subscript (position: Int) -> Item { get } } extension StaticArrayType { var startIndex: Int { return 0 } } struct EmptyStaticArray<Item> : StaticArrayType { var endIndex: Int { return 0 } subscript (position: Int) -> Item { fatalError(Index out of bounds.) } } struct StaticArray<Tail: StaticArrayType> : StaticArrayType { var head: Tail.Item var tail: Tail var endIndex: Int { return tail.endIndex + 1 } subscript (position: Int) -> Tail.Item { return position == 0 ? head : tail[position - 1] } } infix operator ! { precedence 1 associativity right } func !<T>(lhs: T, rhs: T) -> StaticArray<
Topic: Programming Languages SubTopic: Swift Tags:
Sep ’15
Reply to GameController: How to detect Player Index?
Some conceptual things about your code:1.You are assuming that controllers[0] is always Remote controller, but it is possible that due power savings/battery/bt connection problems, the remote could be in a disconnected status, and in a future connection, it can take the 2nd position in the array. It is not guaranteed that it will be always the first element of controllers array. I'd suggest you to check the GCMicroGamepad profile of each controller before making any assignation.2. Think about this possible scenery: I'm a single player that have bought a gamepad to play my favorite title, because I don't like the Remote for playing. With that code, you are always tied in single player mode to play with the remote. You should revise your concept about the relationship between player and controller.3. IMHO, assigning callback blocks for each button should be done in a few, very specific cases (only with single player games), because you are losing the reference of the controller. You should setup some i
Topic: App & System Services SubTopic: Core OS Tags:
Sep ’15
Reply to Cannot call across extensions with generic constraints
Yes, the problem is that this is already part of a class hierarchy. I wanted to add some specialised behaviour in one of the base classes (based on the type of T) which would then be inherited by all subclasses.If I added a subclass instead (which only accepts T:B), I would basically be forking the class hierarchy, which isn't what I want.i.e. with specialised extensions:MyCollectionView<T>MyCollectionView<T:Sectionable> | VMyCollectionViewSubClass<T>MyCollectionViewSubClass<T:Sectionable>versus subclassing:MyCollectionView<T> -> MyCollectionViewSubClass<T> | VMySectionableCollectionView<T:Sectionable> -> MySectionableCollectionViewSubClass<T:Sectionable>
Topic: Programming Languages SubTopic: Swift Tags:
Sep ’15
Generic Equality
The Array struct type doesn't conform to Equatable. It can't, because its Element type doesn't have to conform to Equatable, so Array cannot enforce it. Nevertheless, if the Element type does conform to Equatable, you can compare Arrays with the same type of element for equality.You can also nest arrays and compare them, so long as the root type is Equatable. So, you can arrays of arrays of Equatable types. Or arrays of arrays of arrays.I should add at this point that this ability to compare isn't currently in the documentation for Array structures or any of the protocols it inherits from, but I'm assuming it exists in Swift 2 because of protocol extensions - Array<T> where T : Equatable, or something along those lines.I've created a generic struct type, let's call it Foo<T>, and like Array I can't make it conform to Equatable because T might not be Equatable. I've written an ==<T> operator which allows for an equality comparison if T is Equatable.The situation is this: I'd now like
3
0
549
Sep ’15
Reply to Facebook Platform Policy describes that you're not allowed to pre-fill using the iOS Share Sheet.
Great one EMC2732. So I think as Facebook and Apple have a relationship to include social accounts in the OS itself means they are able to have these adjustments and possibly when Facebook is installed the extension showing is switched to one bundled with the Facebook app. Although I could totally be wrong on that!I build an app that allows sharing to Facebook and we've recently had to adjust things on web and iOS to ensure we don't prefill any content to Facebook when sharing links etc.I think the suggestion to use the Facebook iOS SDK is simply just them wanting to provide the best experience and still won't allow you to prefill content, especially as they can quickly make adjustments to the SDK compared to that within iOS itself. The key thing they are after is having the user add their own copy to the message field with link/photo attachments. I haven't see the SDK provide anyway of prefilling a share sheet with text.Just some thoughts. I'm sure Apple have reviewed Facebook's app thoroughly.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Sep ’15
Reply to Disabled vibrancy of child-items in a NSVisualEffectView.
Does setting the NSAppearance of the view to NSAppearanceNameAqua not work?By setting the Appearance of the container to VibrantDark, I believe that is inheritted by all subviews. Perhaps try setting the ImageWell's appearance to Aqua?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Sep ’15
Reply to What is the behavior when there are multiple apps implementing NETunnelProvider class of APIs
Q1. Which app gets the priority for filtering decisions?Q2. If one app allows website A but the other app disallows website A, how would OS decide?This is actually covered by the documentation, but you have to read between the lines a little. Specifically, the NEFilterManager Class Reference has this to say about the enabled property. Setting this property to true and saving the configuration will disable all other network content filters on the system …Thus, it’s not possible to have multiple filter providers active simultaneously, and thus the situations you described can’t crop up.Q3. If there are multiple apps implementing NETunnelProviderManager with default route, who will get the utun packets?This is also covered by the documentation, this time in the NETunnelProviderManager Class Reference.VPN configurations created using NETunnelProviderManager are classified as regular enterprise VPN configurations (as opposed to the Personal VPN configurations created by NEVPNManager). Only one enterprise VPN confi
Replies
Boosts
Views
Activity
Sep ’15
Make toolbar items and WebView "communicate", how to?
Hi everyone,I'm quite new to OS X development. In my first serious app, I need to make NSToolbar items change their state according to changes in other components of the UI. The application architecture is the same as the document-based cocoa application template provided by Xcode, with the following modifications:Window Controller scene: I've added the toolbar as part of the window and set it up to use a custom controller which inherits from NSWindowController.View Controller Scene: I've replaced the included components with a WebView and set it up to use a custom controller that inherits from NSViewController.What I want to get is that, for instance, when the webview loads a new page, the value in a text field included in the toolbar should reflect this change. At the same time, when the user enters a new value in that field, the webview should load the new page. Yes, I am working on a browser! 😉Anyways, I know the WebView delegate methods I should implement, but the problem is that:- Int
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
1
Boosts
0
Views
784
Activity
Sep ’15
How to call PacketTunnelProvider?
I have added the extension through Target > Packet Tunnel and got a PacketTunnelProvider generated.I tried to call PacketTunnelProvider in my code but it will return:Undefined symbols for architecture arm64: _OBJC_CLASS_$_PacketTunnelProvider, referenced from: objc-class-ref in VPNConnection.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)Should I call the classes in the extension directly? Or should I inherit from it and do my customization?If there will be more document on it, it will be perfect.Thank you!
Replies
7
Boosts
0
Views
2.6k
Activity
Sep ’15
Reply to iOS 9 over the air deployment - Unable t o Download App
we're experiencing the same thing. seems like it only affects devices that did not have the app installed prior to upgrade, or devices that were restored/upgraded.i'm guessing it is a trust issue...with devices that had previously trusted the developer, then upgraded, there was no problem launching the apps until i delete them and try to reinstall them. once the trust relationship is gone (via deleting the previously trusted apps) ...baam... problem replicated. Previously, the OS would normally would ask if you want to trust the developer when installing, but that step isn't happening anymore. this did not happen to me when i was testing our apps with iOS 9 beta.the plist bundle identifier is the same name as the app... so i doubt that is the issue. i'm not an ios developer, but i'm wondering if the apps need to be rebuilt specifically for fresh installs (outside the app store). i'm waiting for our developer to get back to me on that.
Replies
Boosts
Views
Activity
Sep ’15
Reply to ios 9 in house app unable to install
we're experiencing the same thing. seems like it only affects devices that did not have the app installed prior to upgrade, or devices that were restored/upgraded.i'm guessing it is a trust issue...with devices that had previously trusted the developer, then upgraded, there was no problem launching the apps until i delete them and try to reinstall them. once the trust relationship is gone (via deleting the previously trusted apps) ...baam... problem replicated. Previously, the OS would normally would ask if you want to trust the developer when installing, but that step isn't happening anymore. this did not happen to me when i was testing our apps with iOS 9 beta.the plist bundle identifier is the same name as the app... so i doubt that is the issue. i'm not an ios developer, but i'm wondering if the apps need to be rebuilt specifically for fresh installs (outside the app store). i'm waiting for our developer to get back to me on that. also submitted a ticket with apple...
Replies
Boosts
Views
Activity
Sep ’15
UIAlertViewController tint color inherited from main window
Hi Guys,I am having some trouble setting the UIApperance property for UIAlertController. I am trying to change the color for Cancel Button but the following code does not work.[[UICollectionViewCell appearanceWhenContainedIn:[UIAlertController class], nil] setTintColor:[UIColor colorWithRed:0 green:0 blue:0 alpha:1]];Has someone faced a similar issue ? its specific to iOS9ThanksAkhilesh
Replies
1
Boosts
0
Views
673
Activity
Sep ’15
App Slicing and Bitcode relationship
Hi,As far as I know, App Slicing has two major parts of functionality:1. slice the resource so that only the certain suitable resources are downloaded for a specific device, for example, iPhone 5 only downloads @2x images and will not download @3x images.2. slice the binary code, that is the app store will compile your submission packages, and your specific only download the suitable codes, for example, iPhone 5 will only download the binary with Armv7 codes and iPhone6 will download hte binary with Arm64 codes.My question is:1. we have to set the bitcode enable to YES to activate the 2nd app slicing functionality, that is slice the binary code.2. If not, is slicing the codes automatically done when we submit the archive to the App Store now without any further setting or operation? Or you have to set the deployment target to 9.0 or later?Can anyone confirm that please? Thanks.
Replies
2
Boosts
0
Views
2.7k
Activity
Sep ’15
Reply to Protocol inheritance that heats up my computer
Here's a similar but smaller example, this time I will show the code before the workaround is applied. This will make the compiler work at 100% cpu for a long time and eventually it will stop with an error msg saying that the expression is too complex to be solved in reasonable time:protocol StaticArrayType : CollectionType { typealias Item var startIndex: Int { get } var endIndex: Int { get } subscript (position: Int) -> Item { get } } extension StaticArrayType { var startIndex: Int { return 0 } } struct EmptyStaticArray<Item> : StaticArrayType { var endIndex: Int { return 0 } subscript (position: Int) -> Item { fatalError(Index out of bounds.) } } struct StaticArray<Tail: StaticArrayType> : StaticArrayType { var head: Tail.Item var tail: Tail var endIndex: Int { return tail.endIndex + 1 } subscript (position: Int) -> Tail.Item { return position == 0 ? head : tail[position - 1] } } infix operator ! { precedence 1 associativity right } func !<T>(lhs: T, rhs: T) -> StaticArray<
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Sep ’15
Reply to using Siri Remote menu button as pause
So the use of GCEventViewController is required?I've derived my view controller from GLKViewController.Is this unsupported for AppleTV, and should I switch to GCEventViewController instead?Or can I somehow do multiple inheritance?I'm on ObjC, btw.Thanks, Bram
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Sep ’15
Reply to GameController: How to detect Player Index?
Some conceptual things about your code:1.You are assuming that controllers[0] is always Remote controller, but it is possible that due power savings/battery/bt connection problems, the remote could be in a disconnected status, and in a future connection, it can take the 2nd position in the array. It is not guaranteed that it will be always the first element of controllers array. I'd suggest you to check the GCMicroGamepad profile of each controller before making any assignation.2. Think about this possible scenery: I'm a single player that have bought a gamepad to play my favorite title, because I don't like the Remote for playing. With that code, you are always tied in single player mode to play with the remote. You should revise your concept about the relationship between player and controller.3. IMHO, assigning callback blocks for each button should be done in a few, very specific cases (only with single player games), because you are losing the reference of the controller. You should setup some i
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Sep ’15
Reply to Cannot call across extensions with generic constraints
Yes, the problem is that this is already part of a class hierarchy. I wanted to add some specialised behaviour in one of the base classes (based on the type of T) which would then be inherited by all subclasses.If I added a subclass instead (which only accepts T:B), I would basically be forking the class hierarchy, which isn't what I want.i.e. with specialised extensions:MyCollectionView<T>MyCollectionView<T:Sectionable> | VMyCollectionViewSubClass<T>MyCollectionViewSubClass<T:Sectionable>versus subclassing:MyCollectionView<T> -> MyCollectionViewSubClass<T> | VMySectionableCollectionView<T:Sectionable> -> MySectionableCollectionViewSubClass<T:Sectionable>
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Sep ’15
What is the difference between class-only protocol and protocol inherited from AnyObject?
For more information please look at this question http://stackoverflow.com/q/30176814/746347
Replies
0
Boosts
0
Views
155
Activity
Sep ’15
Generic Equality
The Array struct type doesn't conform to Equatable. It can't, because its Element type doesn't have to conform to Equatable, so Array cannot enforce it. Nevertheless, if the Element type does conform to Equatable, you can compare Arrays with the same type of element for equality.You can also nest arrays and compare them, so long as the root type is Equatable. So, you can arrays of arrays of Equatable types. Or arrays of arrays of arrays.I should add at this point that this ability to compare isn't currently in the documentation for Array structures or any of the protocols it inherits from, but I'm assuming it exists in Swift 2 because of protocol extensions - Array<T> where T : Equatable, or something along those lines.I've created a generic struct type, let's call it Foo<T>, and like Array I can't make it conform to Equatable because T might not be Equatable. I've written an ==<T> operator which allows for an equality comparison if T is Equatable.The situation is this: I'd now like
Replies
3
Boosts
0
Views
549
Activity
Sep ’15