This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Contact aContact = // This would be Contact from your account contacts or from a result from contact search | |
| Textile.instance().invites.add( | |
| myThread.getId(), | |
| aContact.getAddress() | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| AddThreadConfig.Schema schema = AddThreadConfig.Schema.newBuilder() | |
| .setPreset(AddThreadConfig.Schema.Preset.MEDIA) | |
| .build(); | |
| AddThreadConfig config = AddThreadConfig.newBuilder() | |
| .setKey("your.bundle.id.version.Media") | |
| .setName("Dogs") | |
| .setType(Thread.Type.OPEN) | |
| .setSharing(Thread.Sharing.SHARED) | |
| .setSchema(schema) | |
| .build(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let threadId = "12D3KooWBfdhD4tNMuTn5MHGof2bMZBKAUjFF3DBL3kuQQE5m1qw" | |
| let jsonData = "{ latitude: 48.858093, longitude: 2.294694 }".data(using: .utf8) | |
| if let data = jsonData { | |
| let dataString = data.base64EncodedString() | |
| Textile.instance().files.prepare(dataString, threadId: threadId) { (preparedFiles, error) in | |
| if let files = preparedFiles { | |
| var filesAddError: NSError? | |
| Textile.instance().files.add(files.dir, threadId: threadId, caption: nil, error: &filesAddError) | |
| if (filesAddError != nil) { | |
| // Do something with this error |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let request = FeedRequest() | |
| request.thread = "12D3KooWBfdhD4tNMuTn5MHGof2bMZBKAUjFF3DBL3kuQQE5m1qw" | |
| var error: NSError? | |
| let feedItemList = Textile.instance().feed.list(request, error: &error) | |
| if (error != nil) { | |
| // Do something with this error | |
| } else { | |
| // Success! | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Foundation | |
| import RxSwift | |
| import Set | |
| private let setClientId = "<your client id>" | |
| private let setClientSecret = "<your client secret>" | |
| enum NavigationStackAction { | |
| case set(viewModels: [Any], animated: Bool) | |
| case push(viewModel: Any, animated: Bool) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Foundation | |
| import RxSwift | |
| class LoginViewModel { | |
| let phoneNumber = Variable<String?>(nil) | |
| lazy private(set) var phoneNumberIsValid: Observable<Bool> = self.phoneNumber | |
| .asObservable() | |
| .map { number in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Foundation | |
| import RxSwift | |
| enum NavigationStackAction { | |
| case set(viewModels: [Any], animated: Bool) | |
| case push(viewModel: Any, animated: Bool) | |
| case pop(animated: Bool) | |
| } | |
| class RootViewModel { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Foundation | |
| import UIKit | |
| class LoginViewController: UIViewController { | |
| var viewModel: LoginViewModel! | |
| @IBOutlet weak var textField: UITextField! | |
| @IBOutlet weak var button: UIButton! | |
| override func viewDidLoad() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Foundation | |
| class LoginViewModel { | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Foundation | |
| import RxSwift | |
| enum NavigationStackAction { | |
| case set(viewModels: [Any], animated: Bool) | |
| case push(viewModel: Any, animated: Bool) | |
| case pop(animated: Bool) | |
| } | |
| class RootViewModel { |
NewerOlder