mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-28 23:32:41 +00:00
1st version
This commit is contained in:
parent
1a57e99c47
commit
e1ede92f65
12 changed files with 458 additions and 59 deletions
|
@ -1,26 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11134" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="j1y-V4-xli">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11106"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--Share View Controller-->
|
||||
<scene sceneID="ceB-am-kn3">
|
||||
<objects>
|
||||
<viewController id="j1y-V4-xli" customClass="ShareViewController" customModuleProvider="" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="8bI-gs-bmD"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="d5i-Ba-RvD"/>
|
||||
</layoutGuides>
|
||||
<view key="view" opaque="NO" contentMode="scaleToFill" id="wbc-yd-nQP">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="CEy-Cv-SGf" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
|
@ -22,13 +22,13 @@
|
|||
<string>1</string>
|
||||
<key>NSExtension</key>
|
||||
<dict>
|
||||
<key>NSExtensionPrincipalClass</key>
|
||||
<string>SharePresentingViewController</string>
|
||||
<key>NSExtensionAttributes</key>
|
||||
<dict>
|
||||
<key>NSExtensionActivationRule</key>
|
||||
<string>TRUEPREDICATE</string>
|
||||
</dict>
|
||||
<key>NSExtensionMainStoryboard</key>
|
||||
<string>MainInterface</string>
|
||||
<key>NSExtensionPointIdentifier</key>
|
||||
<string>com.apple.share-services</string>
|
||||
</dict>
|
||||
|
|
24
Riot Share Extension/RoomsListViewController.h
Normal file
24
Riot Share Extension/RoomsListViewController.h
Normal file
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
Copyright 2017 Aram Sargsyan
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "MXRoom+Riot.h"
|
||||
|
||||
@interface RoomsListViewController : UIViewController
|
||||
|
||||
- (void)updateWithRooms:(NSArray <MXRoom *>*)rooms;
|
||||
|
||||
@end
|
105
Riot Share Extension/RoomsListViewController.m
Normal file
105
Riot Share Extension/RoomsListViewController.m
Normal file
|
@ -0,0 +1,105 @@
|
|||
/*
|
||||
Copyright 2017 Aram Sargsyan
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#import "RoomsListViewController.h"
|
||||
#import "RoomTableViewCell.h"
|
||||
|
||||
@interface RoomsListViewController () <UITableViewDataSource, UITableViewDelegate>
|
||||
|
||||
@property (nonatomic) NSArray <MXRoom *> *rooms;
|
||||
@property (nonatomic) UITableView *mainTableView;
|
||||
|
||||
@end
|
||||
|
||||
@implementation RoomsListViewController
|
||||
|
||||
#pragma mark - Lifecycle
|
||||
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
[super viewDidLoad];
|
||||
[self configureTableView];
|
||||
}
|
||||
|
||||
#pragma mark - Public
|
||||
|
||||
- (void)updateWithRooms:(NSArray <MXRoom *>*)rooms
|
||||
{
|
||||
self.rooms = rooms;
|
||||
[self.mainTableView reloadData];
|
||||
}
|
||||
|
||||
#pragma mark - Views
|
||||
|
||||
- (void)configureTableView
|
||||
{
|
||||
self.mainTableView = [[UITableView alloc] initWithFrame:self.view.frame style:UITableViewStylePlain];
|
||||
self.mainTableView.dataSource = self;
|
||||
self.mainTableView.delegate = self;
|
||||
[self.mainTableView registerNib:[RoomTableViewCell nib] forCellReuseIdentifier:[RoomTableViewCell defaultReuseIdentifier]];
|
||||
|
||||
[self.view addSubview:self.mainTableView];
|
||||
self.mainTableView.translatesAutoresizingMaskIntoConstraints = NO;
|
||||
self.view.translatesAutoresizingMaskIntoConstraints = NO;
|
||||
NSLayoutConstraint *widthConstraint = [NSLayoutConstraint constraintWithItem:self.mainTableView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeWidth multiplier:1 constant:0];
|
||||
widthConstraint.active = YES;
|
||||
NSLayoutConstraint *heightConstraint = [NSLayoutConstraint constraintWithItem:self.mainTableView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeHeight multiplier:1 constant:0];
|
||||
heightConstraint.active = YES;
|
||||
NSLayoutConstraint *centerXConstraint = [NSLayoutConstraint constraintWithItem:self.mainTableView attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeCenterX multiplier:1 constant:0];
|
||||
centerXConstraint.active = YES;
|
||||
NSLayoutConstraint *centerYConstraint = [NSLayoutConstraint constraintWithItem:self.mainTableView attribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeCenterY multiplier:1 constant:0];
|
||||
centerYConstraint.active = YES;
|
||||
}
|
||||
|
||||
#pragma mark - UITableViewDataSource
|
||||
|
||||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
|
||||
{
|
||||
return self.rooms.count;
|
||||
}
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
RoomTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:[RoomTableViewCell defaultReuseIdentifier]];
|
||||
MXRoom *room = self.rooms[indexPath.row];
|
||||
|
||||
[cell render:room];
|
||||
if (!room.summary.displayname.length && !cell.titleLabel.text.length)
|
||||
{
|
||||
cell.titleLabel.text = NSLocalizedStringFromTable(@"room_displayname_no_title", @"Vector", nil);
|
||||
}
|
||||
|
||||
return cell;
|
||||
}
|
||||
|
||||
#pragma mark - UITableViewDelegate
|
||||
|
||||
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
return [RoomTableViewCell cellHeight];
|
||||
}
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
NSLog(@"%@", self.rooms[indexPath.row]);
|
||||
}
|
||||
|
||||
@end
|
21
Riot Share Extension/SharePresentingViewController.h
Normal file
21
Riot Share Extension/SharePresentingViewController.h
Normal file
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
Copyright 2017 Aram Sargsyan
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface SharePresentingViewController : UIViewController
|
||||
|
||||
@end
|
47
Riot Share Extension/SharePresentingViewController.m
Normal file
47
Riot Share Extension/SharePresentingViewController.m
Normal file
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
Copyright 2017 Aram Sargsyan
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#import "SharePresentingViewController.h"
|
||||
#import "ShareViewController.h"
|
||||
|
||||
@interface SharePresentingViewController ()
|
||||
|
||||
@end
|
||||
|
||||
@implementation SharePresentingViewController
|
||||
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
[super viewDidLoad];
|
||||
|
||||
ShareViewController *shareViewController = [[ShareViewController alloc] init];
|
||||
shareViewController.shareExtensionContext = self.extensionContext;
|
||||
|
||||
shareViewController.providesPresentationContextTransitionStyle = YES;
|
||||
shareViewController.definesPresentationContext = YES;
|
||||
shareViewController.modalPresentationStyle = UIModalPresentationOverFullScreen;
|
||||
shareViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
|
||||
|
||||
[self presentViewController:shareViewController animated:YES completion:nil];
|
||||
}
|
||||
|
||||
- (void)didReceiveMemoryWarning {
|
||||
[super didReceiveMemoryWarning];
|
||||
// Dispose of any resources that can be recreated.
|
||||
}
|
||||
|
||||
|
||||
@end
|
|
@ -16,7 +16,10 @@
|
|||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <Social/Social.h>
|
||||
#import <MatrixKit/MatrixKit.h>
|
||||
|
||||
@interface ShareViewController : UIViewController
|
||||
@interface ShareViewController : MXKViewController
|
||||
|
||||
@property (nonatomic) NSExtensionContext *shareExtensionContext;
|
||||
|
||||
@end
|
||||
|
|
|
@ -15,9 +15,23 @@
|
|||
*/
|
||||
|
||||
#import "ShareViewController.h"
|
||||
#import "RoomTableViewCell.h"
|
||||
#import "RoomsListViewController.h"
|
||||
#import "SegmentedViewController.h"
|
||||
|
||||
#import <MatrixSDK/MatrixSDK.h>
|
||||
#import <MatrixKit/MatrixKit.h>
|
||||
|
||||
@interface ShareViewController ()
|
||||
|
||||
@property (nonatomic) NSArray <MXRoom *> *rooms;
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UIView *masterContainerView;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *tittleLabel;
|
||||
@property (weak, nonatomic) IBOutlet UIView *contentView;
|
||||
|
||||
@property (nonatomic) SegmentedViewController *segmentedViewController;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation ShareViewController
|
||||
|
@ -28,20 +42,98 @@
|
|||
{
|
||||
[super viewDidLoad];
|
||||
|
||||
//UI configuration
|
||||
[self.view setBackgroundColor:[UIColor yellowColor]];
|
||||
self.view.alpha = 0.5;
|
||||
[self prepareSession];
|
||||
[self configureViews];
|
||||
|
||||
//MatrixSDK test
|
||||
NSLog(@"SDK VERSION ====== %@", MatrixSDKVersion);
|
||||
|
||||
//MatrixKit test
|
||||
NSLog(@"KIT VERSION ====== %@", MatrixKitVersion);
|
||||
|
||||
//UserDefaults test
|
||||
//NSUserDefaults *sharedUserDefaults = [[NSUserDefaults alloc] initWithSuiteName:@"group.org.matrix.riot"];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onSessionSync:) name:kMXSessionDidSyncNotification object:nil];
|
||||
}
|
||||
|
||||
- (void)viewWillDisappear:(BOOL)animated
|
||||
{
|
||||
[super viewWillDisappear:animated];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
}
|
||||
|
||||
#pragma mark - Private
|
||||
|
||||
- (void)prepareSession
|
||||
{
|
||||
// Prepare account manager
|
||||
MXKAccountManager *accountManager = [MXKAccountManager sharedManager];
|
||||
|
||||
// Use MXFileStore as MXStore to permanently store events.
|
||||
accountManager.storeClass = [MXFileStore class];
|
||||
|
||||
// Start a matrix session for each enabled accounts.
|
||||
NSLog(@"[AppDelegate] initMatrixSessions: prepareSessionForActiveAccounts");
|
||||
[accountManager prepareSessionForActiveAccounts];
|
||||
|
||||
// Resume all existing matrix sessions
|
||||
NSArray *mxAccounts = accountManager.activeAccounts;
|
||||
for (MXKAccount *account in mxAccounts)
|
||||
{
|
||||
[account resume];
|
||||
[self addMatrixSession:account.mxSession];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)configureViews
|
||||
{
|
||||
self.masterContainerView.layer.cornerRadius = 7;
|
||||
self.tittleLabel.text = @"Send to";
|
||||
|
||||
self.segmentedViewController = [SegmentedViewController segmentedViewController];
|
||||
NSArray *titles = @[@"v1", @"v2"];
|
||||
NSArray *vcs = @[[RoomsListViewController new], [RoomsListViewController new]];
|
||||
[self.segmentedViewController initWithTitles:titles viewControllers:vcs defaultSelected:0];
|
||||
|
||||
[self addChildViewController:self.segmentedViewController];
|
||||
[self.contentView addSubview:self.segmentedViewController.view];
|
||||
[self.segmentedViewController didMoveToParentViewController:self];
|
||||
|
||||
self.segmentedViewController.view.translatesAutoresizingMaskIntoConstraints = NO;
|
||||
NSLayoutConstraint *widthConstraint = [NSLayoutConstraint constraintWithItem:self.segmentedViewController.view attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeWidth multiplier:1 constant:0];
|
||||
widthConstraint.active = YES;
|
||||
NSLayoutConstraint *heightConstraint = [NSLayoutConstraint constraintWithItem:self.segmentedViewController.view attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeHeight multiplier:1 constant:0];
|
||||
heightConstraint.active = YES;
|
||||
NSLayoutConstraint *centerXConstraint = [NSLayoutConstraint constraintWithItem:self.segmentedViewController.view attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeCenterX multiplier:1 constant:0];
|
||||
centerXConstraint.active = YES;
|
||||
NSLayoutConstraint *centerYConstraint = [NSLayoutConstraint constraintWithItem:self.segmentedViewController.view attribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeCenterY multiplier:1 constant:0];
|
||||
centerYConstraint.active = YES;
|
||||
}
|
||||
|
||||
- (void)cancelSharing
|
||||
{
|
||||
[self dismissViewControllerAnimated:YES completion:^{
|
||||
NSError *error = [NSError errorWithDomain:@"cancel" code:4201 userInfo:nil];
|
||||
[self.shareExtensionContext cancelRequestWithError:error];
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Notifications
|
||||
|
||||
- (void)onSessionSync:(NSNotification *)notification
|
||||
{
|
||||
if ([notification.object isEqual:self.mainSession] && !self.rooms.count)
|
||||
{
|
||||
self.rooms = self.mainSession.rooms;
|
||||
if (self.rooms.count)
|
||||
{
|
||||
//update the tab controllers
|
||||
[((RoomsListViewController *)self.segmentedViewController.viewControllers[0]) updateWithRooms:self.rooms];
|
||||
[((RoomsListViewController *)self.segmentedViewController.viewControllers[1]) updateWithRooms:self.rooms];
|
||||
NSLog(@"THE ARRAY IS HERE --- \n%@", self.rooms);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Actions
|
||||
|
||||
- (IBAction)close:(UIButton *)sender
|
||||
{
|
||||
[self cancelSharing];
|
||||
}
|
||||
|
||||
/*#pragma mark - SLComposeServiceViewController
|
||||
|
||||
|
|
103
Riot Share Extension/ShareViewController.xib
Normal file
103
Riot Share Extension/ShareViewController.xib
Normal file
|
@ -0,0 +1,103 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="12120" systemVersion="16F73" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12088"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ShareViewController">
|
||||
<connections>
|
||||
<outlet property="contentView" destination="jAn-9F-DlU" id="NWV-TS-MGK"/>
|
||||
<outlet property="masterContainerView" destination="oax-z3-vv0" id="KvN-B4-ZkF"/>
|
||||
<outlet property="tittleLabel" destination="BQ5-AW-rsV" id="qm6-T7-3LB"/>
|
||||
<outlet property="view" destination="Bej-An-0PZ" id="sgO-5Q-y1c"/>
|
||||
</connections>
|
||||
</placeholder>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<view opaque="NO" contentMode="scaleToFill" id="Bej-An-0PZ">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<view alpha="0.59999999999999998" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="0SU-xL-B4a" userLabel="Overlay View">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<color key="backgroundColor" red="0.16337278091968011" green="0.16337278091968011" blue="0.16337278091968011" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
|
||||
</view>
|
||||
<view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="oax-z3-vv0" userLabel="Master Container View">
|
||||
<rect key="frame" x="30" y="58.5" width="315" height="550"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="7Ye-Ni-Nsr" userLabel="Title Container View">
|
||||
<rect key="frame" x="0.0" y="0.0" width="315" height="40"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="BQ5-AW-rsV" userLabel="Title Label">
|
||||
<rect key="frame" x="132.5" y="8" width="51.5" height="24"/>
|
||||
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="20"/>
|
||||
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="RBD-vS-rcr">
|
||||
<rect key="frame" x="5" y="9" width="30" height="22"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="30" id="Pym-oR-KoO"/>
|
||||
</constraints>
|
||||
<state key="normal" image="cancel.png"/>
|
||||
<connections>
|
||||
<action selector="close:" destination="-1" eventType="touchUpInside" id="rko-d0-x9l"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstItem="BQ5-AW-rsV" firstAttribute="centerY" secondItem="7Ye-Ni-Nsr" secondAttribute="centerY" id="1d9-JD-CVF"/>
|
||||
<constraint firstItem="RBD-vS-rcr" firstAttribute="leading" secondItem="7Ye-Ni-Nsr" secondAttribute="leading" constant="5" id="Swk-mu-OcC"/>
|
||||
<constraint firstItem="BQ5-AW-rsV" firstAttribute="centerX" secondItem="7Ye-Ni-Nsr" secondAttribute="centerX" id="ZDz-XD-buD"/>
|
||||
<constraint firstAttribute="height" constant="40" id="dFb-An-mc6"/>
|
||||
<constraint firstItem="RBD-vS-rcr" firstAttribute="centerY" secondItem="7Ye-Ni-Nsr" secondAttribute="centerY" id="wUd-cN-mek"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="jAn-9F-DlU">
|
||||
<rect key="frame" x="0.0" y="40" width="315" height="510"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailing" secondItem="jAn-9F-DlU" secondAttribute="trailing" id="1ce-br-3uU"/>
|
||||
<constraint firstItem="jAn-9F-DlU" firstAttribute="top" secondItem="7Ye-Ni-Nsr" secondAttribute="bottom" id="1zc-qn-eFO"/>
|
||||
<constraint firstItem="7Ye-Ni-Nsr" firstAttribute="leading" secondItem="oax-z3-vv0" secondAttribute="leading" id="RTO-at-ZR0"/>
|
||||
<constraint firstAttribute="trailing" secondItem="7Ye-Ni-Nsr" secondAttribute="trailing" id="RtW-o3-kOS"/>
|
||||
<constraint firstAttribute="height" relation="lessThanOrEqual" constant="550" id="Uon-Cb-HY2"/>
|
||||
<constraint firstItem="7Ye-Ni-Nsr" firstAttribute="top" secondItem="oax-z3-vv0" secondAttribute="top" id="YIj-72-BeJ"/>
|
||||
<constraint firstAttribute="width" relation="lessThanOrEqual" constant="550" id="de2-m2-xUY"/>
|
||||
<constraint firstItem="jAn-9F-DlU" firstAttribute="leading" secondItem="oax-z3-vv0" secondAttribute="leading" id="hju-02-xMk"/>
|
||||
<constraint firstAttribute="bottom" secondItem="jAn-9F-DlU" secondAttribute="bottom" id="rDT-Zr-eUB"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="bottom" secondItem="0SU-xL-B4a" secondAttribute="bottom" id="51f-Wf-Yg2"/>
|
||||
<constraint firstAttribute="bottom" secondItem="oax-z3-vv0" secondAttribute="bottom" priority="750" constant="10" id="Qjd-aK-VSL"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="oax-z3-vv0" secondAttribute="trailing" constant="30" id="VUX-RZ-Jke"/>
|
||||
<constraint firstItem="0SU-xL-B4a" firstAttribute="top" secondItem="Bej-An-0PZ" secondAttribute="top" id="avs-GA-7eh"/>
|
||||
<constraint firstAttribute="trailing" secondItem="0SU-xL-B4a" secondAttribute="trailing" id="bgh-PD-Xqx"/>
|
||||
<constraint firstAttribute="trailing" secondItem="oax-z3-vv0" secondAttribute="trailing" priority="750" constant="30" id="cYZ-zQ-1Dh"/>
|
||||
<constraint firstItem="oax-z3-vv0" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Bej-An-0PZ" secondAttribute="leading" constant="30" id="h8V-gU-iRt"/>
|
||||
<constraint firstItem="oax-z3-vv0" firstAttribute="centerY" secondItem="Bej-An-0PZ" secondAttribute="centerY" id="lbe-HZ-ZsR"/>
|
||||
<constraint firstItem="oax-z3-vv0" firstAttribute="top" secondItem="Bej-An-0PZ" secondAttribute="top" priority="750" constant="40" id="loD-b9-Eog"/>
|
||||
<constraint firstItem="oax-z3-vv0" firstAttribute="centerX" secondItem="Bej-An-0PZ" secondAttribute="centerX" id="mzY-Ok-RAp"/>
|
||||
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="oax-z3-vv0" secondAttribute="bottom" constant="10" id="qnO-IP-fp3"/>
|
||||
<constraint firstItem="oax-z3-vv0" firstAttribute="leading" secondItem="Bej-An-0PZ" secondAttribute="leading" priority="750" constant="30" id="sYU-AK-85d"/>
|
||||
<constraint firstItem="oax-z3-vv0" firstAttribute="top" relation="greaterThanOrEqual" secondItem="Bej-An-0PZ" secondAttribute="top" constant="40" id="vXO-uW-nFN"/>
|
||||
<constraint firstItem="0SU-xL-B4a" firstAttribute="leading" secondItem="Bej-An-0PZ" secondAttribute="leading" id="wol-Zy-dCb"/>
|
||||
</constraints>
|
||||
<point key="canvasLocation" x="39.5" y="89.5"/>
|
||||
</view>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="cancel.png" width="20" height="20"/>
|
||||
</resources>
|
||||
</document>
|
|
@ -11,8 +11,21 @@
|
|||
24B5103E1EFA7083004C6AD2 /* ReadReceiptsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 24B5103D1EFA7083004C6AD2 /* ReadReceiptsViewController.m */; };
|
||||
24B510401EFA88CC004C6AD2 /* ReadReceiptsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 24B5103F1EFA88CC004C6AD2 /* ReadReceiptsViewController.xib */; };
|
||||
24CBEC521F0EAD310093EABB /* ShareViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 24CBEC511F0EAD310093EABB /* ShareViewController.m */; };
|
||||
24CBEC551F0EAD310093EABB /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 24CBEC531F0EAD310093EABB /* MainInterface.storyboard */; };
|
||||
24CBEC591F0EAD310093EABB /* RiotShareExtension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 24CBEC4E1F0EAD310093EABB /* RiotShareExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
|
||||
24EEE5A01F23A08900B3C705 /* RoomTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F083BCED1E7009EC00A9B29C /* RoomTableViewCell.m */; };
|
||||
24EEE5A11F23A09A00B3C705 /* RiotDesignValues.m in Sources */ = {isa = PBXBuildFile; fileRef = F083BC171E7009EC00A9B29C /* RiotDesignValues.m */; };
|
||||
24EEE5A21F23A8B400B3C705 /* MXRoom+Riot.m in Sources */ = {isa = PBXBuildFile; fileRef = F083BBE81E7009EC00A9B29C /* MXRoom+Riot.m */; };
|
||||
24EEE5A31F23A8C300B3C705 /* AvatarGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = F083BC111E7009EC00A9B29C /* AvatarGenerator.m */; };
|
||||
24EEE5A41F24C06E00B3C705 /* Vector.strings in Resources */ = {isa = PBXBuildFile; fileRef = F083BB131E7009EC00A9B29C /* Vector.strings */; };
|
||||
24EEE5A71F24E03400B3C705 /* ShareViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 24EEE5A51F24DD5500B3C705 /* ShareViewController.xib */; };
|
||||
24EEE5A81F25529600B3C705 /* cancel@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = F0614A121EDEE65000F5DC9A /* cancel@3x.png */; };
|
||||
24EEE5A91F25529900B3C705 /* cancel@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F0614A111EDEE65000F5DC9A /* cancel@2x.png */; };
|
||||
24EEE5AA1F25529C00B3C705 /* cancel.png in Resources */ = {isa = PBXBuildFile; fileRef = F0614A101EDEE65000F5DC9A /* cancel.png */; };
|
||||
24EEE5AE1F25ED3600B3C705 /* SharePresentingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 24EEE5AC1F25ED2E00B3C705 /* SharePresentingViewController.m */; };
|
||||
24EEE5AF1F25F0F500B3C705 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F083BBEF1E7009EC00A9B29C /* Images.xcassets */; };
|
||||
24EEE5B31F2607AB00B3C705 /* RoomsListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 24EEE5B11F25FF0400B3C705 /* RoomsListViewController.m */; };
|
||||
24EEE5B41F2607C000B3C705 /* SegmentedViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F083BC4E1E7009EC00A9B29C /* SegmentedViewController.m */; };
|
||||
24EEE5B51F2607C500B3C705 /* SegmentedViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F083BC4F1E7009EC00A9B29C /* SegmentedViewController.xib */; };
|
||||
3205ED7D1E976C8A003D65FA /* DirectoryServerPickerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3205ED7C1E976C8A003D65FA /* DirectoryServerPickerViewController.m */; };
|
||||
3205ED841E97725E003D65FA /* DirectoryServerTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3205ED821E97725E003D65FA /* DirectoryServerTableViewCell.m */; };
|
||||
3205ED851E97725E003D65FA /* DirectoryServerTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3205ED831E97725E003D65FA /* DirectoryServerTableViewCell.xib */; };
|
||||
|
@ -519,9 +532,13 @@
|
|||
24CBEC4E1F0EAD310093EABB /* RiotShareExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = RiotShareExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
24CBEC501F0EAD310093EABB /* ShareViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ShareViewController.h; sourceTree = "<group>"; };
|
||||
24CBEC511F0EAD310093EABB /* ShareViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ShareViewController.m; sourceTree = "<group>"; };
|
||||
24CBEC541F0EAD310093EABB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/MainInterface.storyboard; sourceTree = "<group>"; };
|
||||
24CBEC561F0EAD310093EABB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
24CBEC5E1F0EB15D0093EABB /* Riot Share Extension.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "Riot Share Extension.entitlements"; sourceTree = "<group>"; };
|
||||
24EEE5A51F24DD5500B3C705 /* ShareViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ShareViewController.xib; sourceTree = "<group>"; };
|
||||
24EEE5AB1F25ED2E00B3C705 /* SharePresentingViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SharePresentingViewController.h; sourceTree = "<group>"; };
|
||||
24EEE5AC1F25ED2E00B3C705 /* SharePresentingViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SharePresentingViewController.m; sourceTree = "<group>"; };
|
||||
24EEE5B01F25FF0400B3C705 /* RoomsListViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RoomsListViewController.h; sourceTree = "<group>"; };
|
||||
24EEE5B11F25FF0400B3C705 /* RoomsListViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RoomsListViewController.m; sourceTree = "<group>"; };
|
||||
3205ED7B1E976C8A003D65FA /* DirectoryServerPickerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DirectoryServerPickerViewController.h; sourceTree = "<group>"; };
|
||||
3205ED7C1E976C8A003D65FA /* DirectoryServerPickerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DirectoryServerPickerViewController.m; sourceTree = "<group>"; };
|
||||
3205ED811E97725E003D65FA /* DirectoryServerTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DirectoryServerTableViewCell.h; sourceTree = "<group>"; };
|
||||
|
@ -1157,9 +1174,13 @@
|
|||
isa = PBXGroup;
|
||||
children = (
|
||||
24CBEC5E1F0EB15D0093EABB /* Riot Share Extension.entitlements */,
|
||||
24EEE5AB1F25ED2E00B3C705 /* SharePresentingViewController.h */,
|
||||
24EEE5AC1F25ED2E00B3C705 /* SharePresentingViewController.m */,
|
||||
24CBEC501F0EAD310093EABB /* ShareViewController.h */,
|
||||
24CBEC511F0EAD310093EABB /* ShareViewController.m */,
|
||||
24CBEC531F0EAD310093EABB /* MainInterface.storyboard */,
|
||||
24EEE5A51F24DD5500B3C705 /* ShareViewController.xib */,
|
||||
24EEE5B01F25FF0400B3C705 /* RoomsListViewController.h */,
|
||||
24EEE5B11F25FF0400B3C705 /* RoomsListViewController.m */,
|
||||
24CBEC561F0EAD310093EABB /* Info.plist */,
|
||||
);
|
||||
path = "Riot Share Extension";
|
||||
|
@ -2194,7 +2215,13 @@
|
|||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
24CBEC551F0EAD310093EABB /* MainInterface.storyboard in Resources */,
|
||||
24EEE5B51F2607C500B3C705 /* SegmentedViewController.xib in Resources */,
|
||||
24EEE5A91F25529900B3C705 /* cancel@2x.png in Resources */,
|
||||
24EEE5A71F24E03400B3C705 /* ShareViewController.xib in Resources */,
|
||||
24EEE5A81F25529600B3C705 /* cancel@3x.png in Resources */,
|
||||
24EEE5AF1F25F0F500B3C705 /* Images.xcassets in Resources */,
|
||||
24EEE5AA1F25529C00B3C705 /* cancel.png in Resources */,
|
||||
24EEE5A41F24C06E00B3C705 /* Vector.strings in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -2631,7 +2658,14 @@
|
|||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
24EEE5A01F23A08900B3C705 /* RoomTableViewCell.m in Sources */,
|
||||
24EEE5A31F23A8C300B3C705 /* AvatarGenerator.m in Sources */,
|
||||
24CBEC521F0EAD310093EABB /* ShareViewController.m in Sources */,
|
||||
24EEE5B31F2607AB00B3C705 /* RoomsListViewController.m in Sources */,
|
||||
24EEE5A11F23A09A00B3C705 /* RiotDesignValues.m in Sources */,
|
||||
24EEE5A21F23A8B400B3C705 /* MXRoom+Riot.m in Sources */,
|
||||
24EEE5AE1F25ED3600B3C705 /* SharePresentingViewController.m in Sources */,
|
||||
24EEE5B41F2607C000B3C705 /* SegmentedViewController.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -2797,14 +2831,6 @@
|
|||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
24CBEC531F0EAD310093EABB /* MainInterface.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
24CBEC541F0EAD310093EABB /* Base */,
|
||||
);
|
||||
name = MainInterface.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
325E1C131E8D03950018D91E /* LaunchScreen.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
|
@ -2877,6 +2903,7 @@
|
|||
baseConfigurationReference = 12AA0005C8B3D8D8162584C5 /* Pods-RiotShareExtension.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
APPLICATION_EXTENSION_API_ONLY = YES;
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
|
@ -2887,7 +2914,7 @@
|
|||
INFOPLIST_FILE = "Riot Share Extension/Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "im.vector.app.Riot-Share-Extension";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = im.vector.app.share.extension;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
};
|
||||
|
@ -2898,6 +2925,7 @@
|
|||
baseConfigurationReference = 765F5104DB3EC39713DEB3A4 /* Pods-RiotShareExtension.release.xcconfig */;
|
||||
buildSettings = {
|
||||
APPLICATION_EXTENSION_API_ONLY = YES;
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
|
@ -2909,7 +2937,7 @@
|
|||
INFOPLIST_FILE = "Riot Share Extension/Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "im.vector.app.Riot-Share-Extension";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = im.vector.app.share.extension;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
};
|
||||
|
|
|
@ -20,7 +20,7 @@ limitations under the License.
|
|||
#import "UIViewController+RiotSearch.h"
|
||||
|
||||
/**
|
||||
This view controller manages several uiviewcontrollers like UISegmentedControlled manages uiTableView
|
||||
This view controller manages several uiviewcontrollers like UISegmentedController manages uiTableView
|
||||
except that the managed items are custom UIViewControllers.
|
||||
It uses a Vector design.
|
||||
*/
|
||||
|
|
|
@ -17,7 +17,9 @@
|
|||
|
||||
#import "SegmentedViewController.h"
|
||||
|
||||
#import "AppDelegate.h"
|
||||
#import "RiotDesignValues.h"
|
||||
//#import "RageShakeManager.h"
|
||||
//#import "AppDelegate.h"
|
||||
|
||||
@interface SegmentedViewController ()
|
||||
{
|
||||
|
@ -121,7 +123,7 @@
|
|||
// Setup `MXKViewControllerHandling` properties
|
||||
self.defaultBarTintColor = kRiotNavBarTintColor;
|
||||
self.enableBarTintColorStatusChange = NO;
|
||||
self.rageShakeManager = [RageShakeManager sharedManager];
|
||||
//self.rageShakeManager = [RageShakeManager sharedManager];
|
||||
}
|
||||
|
||||
- (void)viewDidLoad
|
||||
|
|
Loading…
Reference in a new issue