diff options
Diffstat (limited to 'Juick')
-rw-r--r-- | Juick/AppDelegate.m | 6 | ||||
-rw-r--r-- | Juick/Main.storyboard | 23 | ||||
-rw-r--r-- | Juick/ViewControllers/ChatViewController.m | 4 | ||||
-rw-r--r-- | Juick/ViewControllers/DialogsViewController.m | 7 | ||||
-rw-r--r-- | Juick/ViewControllers/MessagesViewController.m | 2 | ||||
-rw-r--r-- | Juick/Views/ConversationCell.m | 2 | ||||
-rw-r--r-- | Juick/Views/ConversationCell.xib | 98 |
7 files changed, 65 insertions, 77 deletions
diff --git a/Juick/AppDelegate.m b/Juick/AppDelegate.m index da72111..51e5df1 100644 --- a/Juick/AppDelegate.m +++ b/Juick/AppDelegate.m @@ -66,6 +66,12 @@ if (userInfo) { [self parseNotificationPayload:userInfo]; } + UISplitViewController *splitViewController = (UISplitViewController *)[self window].rootViewController; +#if TARGET_OS_MACCATALYST + splitViewController.primaryBackgroundStyle = UISplitViewControllerBackgroundStyleSidebar; +#else + splitViewController.preferredDisplayMode = UISplitViewControllerDisplayModeAllVisible; +#endif return YES; } diff --git a/Juick/Main.storyboard b/Juick/Main.storyboard index 6a7f2d2..41051bf 100644 --- a/Juick/Main.storyboard +++ b/Juick/Main.storyboard @@ -121,16 +121,6 @@ <rect key="frame" x="0.0" y="0.0" width="375" height="667"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <color key="backgroundColor" systemColor="systemBackgroundColor"/> - <prototypes> - <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" id="AEY-as-2qP"> - <rect key="frame" x="0.0" y="44.5" width="375" height="43.5"/> - <autoresizingMask key="autoresizingMask"/> - <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="AEY-as-2qP" id="Cq3-u0-nDX"> - <rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/> - <autoresizingMask key="autoresizingMask"/> - </tableViewCellContentView> - </tableViewCell> - </prototypes> <connections> <outlet property="dataSource" destination="EdR-oD-q3M" id="Eng-FK-usf"/> <outlet property="delegate" destination="EdR-oD-q3M" id="cn9-am-VAa"/> @@ -292,20 +282,11 @@ <scene sceneID="CAp-HD-pIQ"> <objects> <tableViewController title="Chats" id="vqF-gx-pZG" customClass="DialogsViewController" sceneMemberID="viewController"> - <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" id="ZQ7-23-Nqu"> + <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="68" sectionHeaderHeight="28" sectionFooterHeight="28" id="ZQ7-23-Nqu"> <rect key="frame" x="0.0" y="0.0" width="375" height="667"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> - <prototypes> - <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="notificationCell" id="KSR-Fu-ZcK" userLabel=" " customClass="ConversationCell"> - <rect key="frame" x="0.0" y="44.5" width="375" height="43.5"/> - <autoresizingMask key="autoresizingMask"/> - <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="KSR-Fu-ZcK" id="BUc-6q-MYj"> - <rect key="frame" x="0.0" y="0.0" width="349.5" height="43.5"/> - <autoresizingMask key="autoresizingMask"/> - </tableViewCellContentView> - </tableViewCell> - </prototypes> + <sections/> <connections> <outlet property="dataSource" destination="vqF-gx-pZG" id="kEz-Xy-OQT"/> <outlet property="delegate" destination="vqF-gx-pZG" id="xKF-Xt-zWe"/> diff --git a/Juick/ViewControllers/ChatViewController.m b/Juick/ViewControllers/ChatViewController.m index cfecc48..9ca024c 100644 --- a/Juick/ViewControllers/ChatViewController.m +++ b/Juick/ViewControllers/ChatViewController.m @@ -34,12 +34,12 @@ self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentAutomatic; [self reloadChat]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillChangeFrame:) name:UIKeyboardWillChangeFrameNotification object:nil]; - self.tableView.refreshControl = [UIRefreshControl new]; - [self.tableView.refreshControl addTarget:self action:@selector(reloadChat) forControlEvents:UIControlEventValueChanged]; [self addObserver:self forKeyPath:@"uname" options:0 context:nil]; #if TARGET_OS_MACCATALYST [self.stack addArrangedSubview:[self inputAccessoryView]]; #else + self.tableView.refreshControl = [UIRefreshControl new]; + [self.tableView.refreshControl addTarget:self action:@selector(reloadChat) forControlEvents:UIControlEventValueChanged]; self.stackBottomConstraint.constant = kMessageInputInitialHeight; #endif } diff --git a/Juick/ViewControllers/DialogsViewController.m b/Juick/ViewControllers/DialogsViewController.m index 5f2dca9..dff8529 100644 --- a/Juick/ViewControllers/DialogsViewController.m +++ b/Juick/ViewControllers/DialogsViewController.m @@ -25,8 +25,11 @@ [super viewDidLoad]; [self.view setBackgroundColor:[UIColor colorNamed:@"Background"]]; [self.tableView registerNib:[UINib nibWithNibName:@"ConversationCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@"notificationCell"]; + self.tableView.rowHeight = UITableViewAutomaticDimension; +#if !TARGET_OS_MACCATALYST self.refreshControl = [UIRefreshControl new]; [self.refreshControl addTarget:self action:@selector(refreshData) forControlEvents:UIControlEventValueChanged]; +#endif [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationActivated) name:UIApplicationDidBecomeActiveNotification object:nil]; [self refreshData]; } @@ -83,6 +86,10 @@ return cell; } +- (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath { + return 84.0f; +} + -(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [self performSegueWithIdentifier:@"chatSegue" sender:self]; } diff --git a/Juick/ViewControllers/MessagesViewController.m b/Juick/ViewControllers/MessagesViewController.m index 7814d1e..cd4d740 100644 --- a/Juick/ViewControllers/MessagesViewController.m +++ b/Juick/ViewControllers/MessagesViewController.m @@ -118,8 +118,10 @@ NSString* const messageCellIdentifier = @"messageCell"; if (!self.messages) { self.messages = [NSMutableArray array]; } +#if !TARGET_OS_MACCATALYST self.refreshControl = [UIRefreshControl new]; [self.refreshControl addTarget:self action:@selector(refreshData) forControlEvents:UIControlEventValueChanged]; +#endif [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(newMessage:) name:NewMessageNotificationName object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationActivated) name:UIApplicationDidBecomeActiveNotification object:nil]; [self refreshData]; diff --git a/Juick/Views/ConversationCell.m b/Juick/Views/ConversationCell.m index 21a3af2..360ed2b 100644 --- a/Juick/Views/ConversationCell.m +++ b/Juick/Views/ConversationCell.m @@ -15,7 +15,7 @@ self.chatName.textColor = [UIColor colorNamed:@"Title"]; self.chatName.text = chat.uname; self.lastMessage.text = chat.lastMessageText; - self.unreadMarker.hidden = true; + self.unreadMarker.hidden = false; __weak UIImageView *weakAvatar = self.avatar; [[AppDelegate shared].api fetchImageWithURL:[NSURL URLWithString:chat.avatar] callback:^(NSData *data) { [UIView transitionWithView:weakAvatar diff --git a/Juick/Views/ConversationCell.xib b/Juick/Views/ConversationCell.xib index 4cd7a30..b524816 100644 --- a/Juick/Views/ConversationCell.xib +++ b/Juick/Views/ConversationCell.xib @@ -10,64 +10,56 @@ <objects> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> - <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="notificationCell" rowHeight="114" id="eKX-ht-IFf" customClass="ConversationCell"> - <rect key="frame" x="0.0" y="0.0" width="324" height="114"/> + <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="notificationCell" rowHeight="84" id="eKX-ht-IFf" customClass="ConversationCell"> + <rect key="frame" x="0.0" y="0.0" width="324" height="84"/> <autoresizingMask key="autoresizingMask"/> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="eKX-ht-IFf" id="3NU-ng-4QM"> - <rect key="frame" x="0.0" y="0.0" width="324" height="114"/> + <rect key="frame" x="0.0" y="0.0" width="324" height="84"/> <autoresizingMask key="autoresizingMask"/> <subviews> - <stackView opaque="NO" contentMode="scaleToFill" alignment="center" spacing="12" translatesAutoresizingMaskIntoConstraints="NO" id="6O8-u9-Jvc"> - <rect key="frame" x="6" y="17" width="312" height="80"/> - <subviews> - <stackView opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="256" verticalHuggingPriority="252" horizontalCompressionResistancePriority="747" verticalCompressionResistancePriority="752" axis="vertical" alignment="center" spacing="6" translatesAutoresizingMaskIntoConstraints="NO" id="Sas-e1-iNF"> - <rect key="frame" x="0.0" y="3.5" width="52" height="73"/> - <subviews> - <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="751" verticalCompressionResistancePriority="751" adjustsImageSizeForAccessibilityContentSizeCategory="YES" translatesAutoresizingMaskIntoConstraints="NO" id="WsB-eh-dhD"> - <rect key="frame" x="1" y="0.0" width="50" height="50"/> - <constraints> - <constraint firstAttribute="width" priority="750" constant="48" id="6ox-eq-Vlp"/> - <constraint firstAttribute="height" priority="750" constant="48" id="e88-rG-unU"/> - </constraints> - </imageView> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" verticalCompressionResistancePriority="751" text="●" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jW2-kr-sJn"> - <rect key="frame" x="19.5" y="56" width="13" height="17"/> - <fontDescription key="fontDescription" style="UICTFontTextStyleBody"/> - <color key="textColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> - <nil key="highlightedColor"/> - </label> - </subviews> - <constraints> - <constraint firstAttribute="width" constant="52" id="333-j0-nGK"/> - <constraint firstAttribute="height" priority="750" constant="68" id="D1h-DA-sXz"/> - </constraints> - </stackView> - <stackView opaque="NO" contentMode="scaleToFill" horizontalCompressionResistancePriority="751" axis="vertical" spacing="6" translatesAutoresizingMaskIntoConstraints="NO" id="dJe-jR-n42"> - <rect key="frame" x="64" y="13.5" width="248" height="53.5"/> - <subviews> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="1000" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="TTg-gl-dzG"> - <rect key="frame" x="0.0" y="0.0" width="248" height="17"/> - <fontDescription key="fontDescription" style="UICTFontTextStyleHeadline"/> - <color key="textColor" name="Text"/> - <nil key="highlightedColor"/> - </label> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="1000" verticalCompressionResistancePriority="1000" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="EiA-lG-gV5"> - <rect key="frame" x="0.0" y="23" width="248" height="30.5"/> - <string key="text">Lorem sdsdasds sdsada ddas dsad asdsadas dasd asdsa sadsa dasdsad asd asdas dasd asdas dasd asdas dasdasdasd asdasdasdadasdasd asdasd asdas dasdsa dasdasdasdasdas dasdas</string> - <fontDescription key="fontDescription" style="UICTFontTextStyleSubhead"/> - <color key="textColor" name="Muted"/> - <nil key="highlightedColor"/> - </label> - </subviews> - </stackView> - </subviews> - </stackView> + <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="751" verticalCompressionResistancePriority="751" adjustsImageSizeForAccessibilityContentSizeCategory="YES" translatesAutoresizingMaskIntoConstraints="NO" id="WsB-eh-dhD"> + <rect key="frame" x="12" y="12" width="48" height="48"/> + <constraints> + <constraint firstAttribute="width" constant="48" id="6ox-eq-Vlp"/> + <constraint firstAttribute="height" constant="48" id="e88-rG-unU"/> + </constraints> + </imageView> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" verticalCompressionResistancePriority="751" text="●" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jW2-kr-sJn"> + <rect key="frame" x="29.5" y="55" width="13" height="17"/> + <constraints> + <constraint firstAttribute="height" constant="17" id="AG9-E4-rLK"/> + <constraint firstAttribute="width" constant="13" id="KHD-TS-qMx"/> + </constraints> + <fontDescription key="fontDescription" style="UICTFontTextStyleBody"/> + <color key="textColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> + <nil key="highlightedColor"/> + </label> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="1000" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="TTg-gl-dzG"> + <rect key="frame" x="68" y="12" width="244" height="17"/> + <fontDescription key="fontDescription" style="UICTFontTextStyleHeadline"/> + <color key="textColor" name="Text"/> + <nil key="highlightedColor"/> + </label> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" verticalCompressionResistancePriority="1000" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="EiA-lG-gV5"> + <rect key="frame" x="68" y="37" width="244" height="30.5"/> + <string key="text">Lorem sdsdasds sdsada ddas dsad asdsadas dasd asdsa sadsa dasdsad asd asdas dasd asdas dasd asdas dasdasdasd asdasdasdadasdasd asdasd asdas dasdsa dasdasdasdasdas dasdas</string> + <fontDescription key="fontDescription" style="UICTFontTextStyleSubhead"/> + <color key="textColor" name="Muted"/> + <nil key="highlightedColor"/> + </label> </subviews> <constraints> - <constraint firstAttribute="bottomMargin" secondItem="6O8-u9-Jvc" secondAttribute="bottom" constant="6" id="O4J-FE-mKI"/> - <constraint firstItem="6O8-u9-Jvc" firstAttribute="leading" secondItem="3NU-ng-4QM" secondAttribute="leading" constant="6" id="h0T-Kd-7A4"/> - <constraint firstAttribute="trailing" secondItem="6O8-u9-Jvc" secondAttribute="trailing" constant="6" id="igy-EX-VYt"/> - <constraint firstItem="6O8-u9-Jvc" firstAttribute="top" secondItem="3NU-ng-4QM" secondAttribute="topMargin" constant="6" id="lS8-Oc-I4J"/> + <constraint firstAttribute="trailing" secondItem="TTg-gl-dzG" secondAttribute="trailing" constant="12" id="1uw-1z-335"/> + <constraint firstAttribute="bottom" secondItem="jW2-kr-sJn" secondAttribute="bottom" constant="12" id="6n4-T7-Jph"/> + <constraint firstItem="jW2-kr-sJn" firstAttribute="top" secondItem="WsB-eh-dhD" secondAttribute="bottom" priority="750" constant="8" symbolic="YES" id="GXK-L2-yPH"/> + <constraint firstAttribute="trailing" secondItem="EiA-lG-gV5" secondAttribute="trailing" constant="12" id="H4w-29-uxg"/> + <constraint firstItem="WsB-eh-dhD" firstAttribute="leading" secondItem="3NU-ng-4QM" secondAttribute="leading" constant="12" id="Vg1-Ss-N8r"/> + <constraint firstItem="WsB-eh-dhD" firstAttribute="top" secondItem="3NU-ng-4QM" secondAttribute="top" constant="12" id="ji2-4k-ZsD"/> + <constraint firstItem="EiA-lG-gV5" firstAttribute="leading" secondItem="WsB-eh-dhD" secondAttribute="trailing" constant="8" symbolic="YES" id="n5j-fx-61t"/> + <constraint firstItem="EiA-lG-gV5" firstAttribute="top" secondItem="TTg-gl-dzG" secondAttribute="bottom" constant="8" symbolic="YES" id="nvI-wS-KRq"/> + <constraint firstItem="jW2-kr-sJn" firstAttribute="centerX" secondItem="WsB-eh-dhD" secondAttribute="centerX" id="pJH-mQ-9dF"/> + <constraint firstItem="TTg-gl-dzG" firstAttribute="leading" secondItem="WsB-eh-dhD" secondAttribute="trailing" constant="8" symbolic="YES" id="zAw-P6-Ac1"/> + <constraint firstItem="TTg-gl-dzG" firstAttribute="top" secondItem="3NU-ng-4QM" secondAttribute="top" constant="12" id="zvB-Ak-HDC"/> </constraints> </tableViewCellContentView> <connections> @@ -76,7 +68,7 @@ <outlet property="lastMessage" destination="EiA-lG-gV5" id="Eq9-zQ-ivW"/> <outlet property="unreadMarker" destination="jW2-kr-sJn" id="E5Q-wn-yln"/> </connections> - <point key="canvasLocation" x="-1768" y="64.767616191904054"/> + <point key="canvasLocation" x="-1768" y="55.772113943028494"/> </tableViewCell> </objects> <resources> |