subject

How to set a mail Subject in UIActivityViewController?

喜夏-厌秋 提交于 2019-11-28 20:00:31
I want to set subject for email sharing in UIActivityViewController and also want to share in Twitter. I know in Twitter if we want to share — we need compress text to 140 chars. I checked many SO solutions, but nothing is working. Is this issue fixed in latest iOS releases? Any other "working solutions"? It seems as though emreoktem's solution—sending setValue:forKey: to the UIActivityViewController —is undocumented. On iOS 7 and later, you can implement the activityViewController:subjectForActivityType: method in an object conforming to the UIActivityItemSource protocol to do this in a way

What are RxJS Subject's and the benifits of using them?

旧城冷巷雨未停 提交于 2019-11-28 09:15:13
I found the rxJS docs define them as What is a Subject? An RxJS Subject is a special type of Observable that allows values to be multicasted to many Observers. While plain Observables are unicast (each subscribed Observer owns an independent execution of the Observable), Subjects are multicast. and it goes on to give examples but I'm looking for a basic ELI5 explanation. From my understanding is it helps handle and define items in a sequence. Is that correct? I think it would be most helpful to me and others to see a simple function with and without defining an rxJS Subject to understand why

Angular2 Observable BehaviorSubject service not working

谁说胖子不能爱 提交于 2019-11-27 17:22:42
问题 I'm trying to create my own observable service but after i get the initial data from the service, any updates to the service aren't propagated to any subscribers. Service looks like this: import { Injectable } from '@angular/core'; import { Observable, BehaviorSubject } from 'rxjs/Rx'; @Injectable() export class DataService { keys : number[] = [4,5,1,3,2]; private data :BehaviorSubject<number[]> = new BehaviorSubject(this.keys); constructor() {}; public setKey(i:number, val:number) :void {