mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-18 23:48:29 +02:00
Merge MatrixKit develop with commit hash: b85b736313bec0592bd1cabc68035d97f5331137
This commit is contained in:
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
Copyright 2015 OpenMarket Ltd
|
||||
|
||||
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 "MXKCellData.h"
|
||||
|
||||
/**
|
||||
List the display box types for the cell subviews.
|
||||
*/
|
||||
typedef enum : NSUInteger {
|
||||
/**
|
||||
By default the view display box is unchanged.
|
||||
*/
|
||||
MXKTableViewCellDisplayBoxTypeDefault,
|
||||
/**
|
||||
Define a circle box based on the smaller size of the view frame, some portion of content may be clipped.
|
||||
*/
|
||||
MXKTableViewCellDisplayBoxTypeCircle,
|
||||
/**
|
||||
Round the corner of the display box of the view.
|
||||
*/
|
||||
MXKTableViewCellDisplayBoxTypeRoundedCorner
|
||||
|
||||
} MXKTableViewCellDisplayBoxType;
|
||||
|
||||
/**
|
||||
'MXKTableViewCell' class is used to define custom UITableViewCell.
|
||||
Each 'MXKTableViewCell-inherited' class has its own 'reuseIdentifier'.
|
||||
*/
|
||||
@interface MXKTableViewCell : UITableViewCell
|
||||
{
|
||||
@protected
|
||||
NSString *mxkReuseIdentifier;
|
||||
}
|
||||
|
||||
/**
|
||||
Returns the `UINib` object initialized for the cell.
|
||||
|
||||
@return The initialized `UINib` object or `nil` if there were errors during
|
||||
initialization or the nib file could not be located.
|
||||
*/
|
||||
+ (UINib *)nib;
|
||||
|
||||
/**
|
||||
The default reuseIdentifier of the 'MXKTableViewCell-inherited' class.
|
||||
*/
|
||||
+ (NSString*)defaultReuseIdentifier;
|
||||
|
||||
/**
|
||||
Override [UITableViewCell initWithStyle:reuseIdentifier:] to load cell content from nib file (if any),
|
||||
and handle reuse identifier.
|
||||
*/
|
||||
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier;
|
||||
|
||||
/**
|
||||
Customize the rendering of the table view cell and its subviews (Do nothing by default).
|
||||
This method is called when the view is initialized or prepared for reuse.
|
||||
|
||||
Override this method to customize the table view cell at the application level.
|
||||
*/
|
||||
- (void)customizeTableViewCellRendering;
|
||||
|
||||
/**
|
||||
The current cell data displayed by the table view cell
|
||||
*/
|
||||
@property (weak, nonatomic, readonly) MXKCellData *mxkCellData;
|
||||
|
||||
@end
|
||||
100
Riot/Modules/MatrixKit/Views/MXKTableViewCell/MXKTableViewCell.m
Normal file
100
Riot/Modules/MatrixKit/Views/MXKTableViewCell/MXKTableViewCell.m
Normal file
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
Copyright 2015 OpenMarket Ltd
|
||||
|
||||
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 "MXKTableViewCell.h"
|
||||
#import "NSBundle+MatrixKit.h"
|
||||
|
||||
@implementation MXKTableViewCell
|
||||
|
||||
+ (UINib *)nib
|
||||
{
|
||||
// Check whether a nib file is available
|
||||
NSBundle *mainBundle = [NSBundle mxk_bundleForClass:self.class];
|
||||
|
||||
NSString *path = [mainBundle pathForResource:NSStringFromClass([self class]) ofType:@"nib"];
|
||||
if (path)
|
||||
{
|
||||
return [UINib nibWithNibName:NSStringFromClass([self class]) bundle:mainBundle];
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
+ (NSString*)defaultReuseIdentifier
|
||||
{
|
||||
return NSStringFromClass([self class]);
|
||||
}
|
||||
|
||||
- (void)awakeFromNib
|
||||
{
|
||||
[super awakeFromNib];
|
||||
|
||||
[self customizeTableViewCellRendering];
|
||||
}
|
||||
|
||||
- (void)prepareForReuse
|
||||
{
|
||||
[super prepareForReuse];
|
||||
|
||||
[self customizeTableViewCellRendering];
|
||||
}
|
||||
|
||||
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
|
||||
{
|
||||
// Check whether a xib is defined
|
||||
if ([[self class] nib])
|
||||
{
|
||||
self = [[[self class] nib] instantiateWithOwner:nil options:nil].firstObject;
|
||||
}
|
||||
else
|
||||
{
|
||||
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
|
||||
[self customizeTableViewCellRendering];
|
||||
}
|
||||
|
||||
if (reuseIdentifier.length)
|
||||
{
|
||||
// The provided identifier is not always conserved in the new created cell.
|
||||
// This depends how the method [initWithStyle:reuseIdentifier:] is trigerred.
|
||||
// Trick: we store a copy of this identifier.
|
||||
mxkReuseIdentifier = reuseIdentifier;
|
||||
}
|
||||
else
|
||||
{
|
||||
mxkReuseIdentifier = [[self class] defaultReuseIdentifier];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (NSString*)reuseIdentifier
|
||||
{
|
||||
NSString *identifier = super.reuseIdentifier;
|
||||
|
||||
if (!identifier.length)
|
||||
{
|
||||
identifier = mxkReuseIdentifier;
|
||||
}
|
||||
|
||||
return identifier;
|
||||
}
|
||||
|
||||
- (void)customizeTableViewCellRendering
|
||||
{
|
||||
// Do nothing by default.
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
Copyright 2015 OpenMarket Ltd
|
||||
|
||||
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 "MXKTableViewCell.h"
|
||||
|
||||
/**
|
||||
'MXKTableViewCellWithButton' inherits 'MXKTableViewCell' class.
|
||||
It constains a 'UIButton' centered in cell content view.
|
||||
*/
|
||||
@interface MXKTableViewCellWithButton : MXKTableViewCell
|
||||
|
||||
@property (strong, nonatomic) IBOutlet UIButton *mxkButton;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
Copyright 2015 OpenMarket Ltd
|
||||
|
||||
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 "MXKTableViewCellWithButton.h"
|
||||
|
||||
@implementation MXKTableViewCellWithButton
|
||||
|
||||
- (void)prepareForReuse
|
||||
{
|
||||
[super prepareForReuse];
|
||||
|
||||
// TODO: Code commented for a quick fix for https://github.com/vector-im/riot-ios/issues/1323
|
||||
// This line was a fix for https://github.com/vector-im/riot-ios/issues/1354
|
||||
// but it creates a regression that is worse than the bug it fixes.
|
||||
// self.mxkButton.titleLabel.text = nil;
|
||||
|
||||
[self.mxkButton removeTarget:nil action:nil forControlEvents:UIControlEventAllEvents];
|
||||
self.mxkButton.accessibilityIdentifier = nil;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="16C67" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" id="20U-7H-xmi" customClass="MXKTableViewCellWithButton">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="20U-7H-xmi" id="cFw-g7-Cgn">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Ycy-33-7Zq">
|
||||
<rect key="frame" x="276" y="7" width="49" height="30"/>
|
||||
<state key="normal" title="Submit">
|
||||
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</state>
|
||||
</button>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="centerY" secondItem="Ycy-33-7Zq" secondAttribute="centerY" id="6kh-Pa-47V"/>
|
||||
<constraint firstAttribute="centerX" secondItem="Ycy-33-7Zq" secondAttribute="centerX" id="uAj-IK-F0I"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<connections>
|
||||
<outlet property="mxkButton" destination="Ycy-33-7Zq" id="rQt-Th-xOb"/>
|
||||
</connections>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
Copyright 2015 OpenMarket Ltd
|
||||
|
||||
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 "MXKTableViewCell.h"
|
||||
|
||||
/**
|
||||
'MXKTableViewCellWithButtons' inherits 'MXKTableViewCell' class.
|
||||
It displays several buttons with the system style in a UITableViewCell. All buttons have the same width and they are horizontally aligned.
|
||||
They are vertically centered.
|
||||
*/
|
||||
@interface MXKTableViewCellWithButtons : MXKTableViewCell
|
||||
|
||||
/**
|
||||
The number of buttons
|
||||
*/
|
||||
@property (nonatomic) NSUInteger mxkButtonNumber;
|
||||
|
||||
/**
|
||||
The current array of buttons
|
||||
*/
|
||||
@property (nonatomic) NSArray *mxkButtons;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,156 @@
|
||||
/*
|
||||
Copyright 2015 OpenMarket Ltd
|
||||
|
||||
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 "MXKTableViewCellWithButtons.h"
|
||||
|
||||
@interface MXKTableViewCellWithButtons ()
|
||||
{
|
||||
NSMutableArray *buttonArray;
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation MXKTableViewCellWithButtons
|
||||
|
||||
- (void)setMxkButtonNumber:(NSUInteger)buttonNumber
|
||||
{
|
||||
if (_mxkButtonNumber == buttonNumber)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_mxkButtonNumber = buttonNumber;
|
||||
buttonArray = [NSMutableArray arrayWithCapacity:buttonNumber];
|
||||
|
||||
CGFloat containerWidth = self.contentView.frame.size.width / buttonNumber;
|
||||
UIView *previousContainer = nil;
|
||||
NSLayoutConstraint *leftConstraint;
|
||||
NSLayoutConstraint *rightConstraint;
|
||||
NSLayoutConstraint *widthConstraint;
|
||||
NSLayoutConstraint *topConstraint;
|
||||
NSLayoutConstraint *bottomConstraint;
|
||||
|
||||
for (NSInteger index = 0; index < buttonNumber; index++)
|
||||
{
|
||||
UIView *buttonContainer = [[UIView alloc] initWithFrame:CGRectMake(index * containerWidth, 0, containerWidth, self.contentView.frame.size.height)];
|
||||
buttonContainer.backgroundColor = [UIColor clearColor];
|
||||
[self.contentView addSubview:buttonContainer];
|
||||
|
||||
// Add container constraints
|
||||
buttonContainer.translatesAutoresizingMaskIntoConstraints = NO;
|
||||
if (!previousContainer)
|
||||
{
|
||||
leftConstraint = [NSLayoutConstraint constraintWithItem:buttonContainer
|
||||
attribute:NSLayoutAttributeLeading
|
||||
relatedBy:NSLayoutRelationEqual
|
||||
toItem:self.contentView
|
||||
attribute:NSLayoutAttributeLeading
|
||||
multiplier:1
|
||||
constant:0];
|
||||
widthConstraint = [NSLayoutConstraint constraintWithItem:buttonContainer
|
||||
attribute:NSLayoutAttributeWidth
|
||||
relatedBy:NSLayoutRelationEqual
|
||||
toItem:self.contentView
|
||||
attribute:NSLayoutAttributeWidth
|
||||
multiplier:(1.0 / buttonNumber)
|
||||
constant:0];
|
||||
}
|
||||
else
|
||||
{
|
||||
leftConstraint = [NSLayoutConstraint constraintWithItem:buttonContainer
|
||||
attribute:NSLayoutAttributeLeading
|
||||
relatedBy:NSLayoutRelationEqual
|
||||
toItem:previousContainer
|
||||
attribute:NSLayoutAttributeTrailing
|
||||
multiplier:1
|
||||
constant:0];
|
||||
widthConstraint = [NSLayoutConstraint constraintWithItem:buttonContainer
|
||||
attribute:NSLayoutAttributeWidth
|
||||
relatedBy:NSLayoutRelationEqual
|
||||
toItem:previousContainer
|
||||
attribute:NSLayoutAttributeWidth
|
||||
multiplier:1
|
||||
constant:0];
|
||||
}
|
||||
|
||||
topConstraint = [NSLayoutConstraint constraintWithItem:buttonContainer
|
||||
attribute:NSLayoutAttributeTop
|
||||
relatedBy:NSLayoutRelationEqual
|
||||
toItem:self.contentView
|
||||
attribute:NSLayoutAttributeTop
|
||||
multiplier:1
|
||||
constant:0];
|
||||
|
||||
bottomConstraint = [NSLayoutConstraint constraintWithItem:buttonContainer
|
||||
attribute:NSLayoutAttributeBottom
|
||||
relatedBy:NSLayoutRelationEqual
|
||||
toItem:self.contentView
|
||||
attribute:NSLayoutAttributeBottom
|
||||
multiplier:1
|
||||
constant:0];
|
||||
|
||||
[NSLayoutConstraint activateConstraints:@[leftConstraint, widthConstraint, topConstraint, bottomConstraint]];
|
||||
previousContainer = buttonContainer;
|
||||
|
||||
// Add Button
|
||||
UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
|
||||
button.frame = CGRectMake(10, 8, containerWidth - 20, buttonContainer.frame.size.height - 16);
|
||||
[buttonContainer addSubview:button];
|
||||
[buttonArray addObject:button];
|
||||
|
||||
// Add button constraints
|
||||
button.translatesAutoresizingMaskIntoConstraints = NO;
|
||||
leftConstraint = [NSLayoutConstraint constraintWithItem:button
|
||||
attribute:NSLayoutAttributeLeading
|
||||
relatedBy:NSLayoutRelationEqual
|
||||
toItem:buttonContainer
|
||||
attribute:NSLayoutAttributeLeading
|
||||
multiplier:1
|
||||
constant:10];
|
||||
rightConstraint = [NSLayoutConstraint constraintWithItem:button
|
||||
attribute:NSLayoutAttributeTrailing
|
||||
relatedBy:NSLayoutRelationEqual
|
||||
toItem:buttonContainer
|
||||
attribute:NSLayoutAttributeTrailing
|
||||
multiplier:1
|
||||
constant:-10];
|
||||
|
||||
topConstraint = [NSLayoutConstraint constraintWithItem:button
|
||||
attribute:NSLayoutAttributeTop
|
||||
relatedBy:NSLayoutRelationEqual
|
||||
toItem:buttonContainer
|
||||
attribute:NSLayoutAttributeTop
|
||||
multiplier:1
|
||||
constant:8];
|
||||
|
||||
bottomConstraint = [NSLayoutConstraint constraintWithItem:button
|
||||
attribute:NSLayoutAttributeBottom
|
||||
relatedBy:NSLayoutRelationEqual
|
||||
toItem:buttonContainer
|
||||
attribute:NSLayoutAttributeBottom
|
||||
multiplier:1
|
||||
constant:-8];
|
||||
|
||||
[NSLayoutConstraint activateConstraints:@[leftConstraint, rightConstraint, topConstraint, bottomConstraint]];
|
||||
}
|
||||
}
|
||||
|
||||
- (NSArray*)mxkButtons
|
||||
{
|
||||
return [NSArray arrayWithArray:buttonArray];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
Copyright 2015 OpenMarket Ltd
|
||||
|
||||
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 "MXKTableViewCell.h"
|
||||
|
||||
/**
|
||||
'MXKTableViewCellWithLabelAndButton' inherits 'MXKTableViewCell' class.
|
||||
It constains a 'UILabel' and a 'UIButton' vertically centered.
|
||||
*/
|
||||
@interface MXKTableViewCellWithLabelAndButton : MXKTableViewCell
|
||||
|
||||
@property (strong, nonatomic) IBOutlet UILabel *mxkLabel;
|
||||
@property (strong, nonatomic) IBOutlet UIButton *mxkButton;
|
||||
|
||||
/**
|
||||
Leading/Trailing constraints define here spacing to nearest neighbor (no relative to margin)
|
||||
*/
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkLabelLeadingConstraint;
|
||||
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkButtonLeadingConstraint;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkButtonTrailingConstraint;
|
||||
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkButtonProportionalWidthToMxkButtonConstraint;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
Copyright 2015 OpenMarket Ltd
|
||||
|
||||
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 "MXKTableViewCellWithLabelAndButton.h"
|
||||
|
||||
@implementation MXKTableViewCellWithLabelAndButton
|
||||
|
||||
@end
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="16C67" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
|
||||
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" id="aCf-VI-ocb" customClass="MXKTableViewCellWithLabelAndButton">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="aCf-VI-ocb" id="Eg5-vl-rni">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Xx4-AP-OQs">
|
||||
<rect key="frame" x="8" y="11" width="411" height="21"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="nTw-zr-xt2">
|
||||
<rect key="frame" x="427" y="7" width="165" height="30"/>
|
||||
<state key="normal" title="Button">
|
||||
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</state>
|
||||
</button>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="centerY" secondItem="Xx4-AP-OQs" secondAttribute="centerY" id="A2R-gN-0sW"/>
|
||||
<constraint firstItem="Xx4-AP-OQs" firstAttribute="leading" secondItem="Eg5-vl-rni" secondAttribute="leading" constant="8" id="Wih-ke-1dd"/>
|
||||
<constraint firstAttribute="trailing" secondItem="nTw-zr-xt2" secondAttribute="trailing" constant="8" id="f4b-wS-uFy"/>
|
||||
<constraint firstAttribute="centerY" secondItem="nTw-zr-xt2" secondAttribute="centerY" id="gyq-nC-R4z"/>
|
||||
<constraint firstItem="nTw-zr-xt2" firstAttribute="width" secondItem="Xx4-AP-OQs" secondAttribute="width" multiplier="0.4" id="ill-js-N8j"/>
|
||||
<constraint firstItem="nTw-zr-xt2" firstAttribute="leading" secondItem="Xx4-AP-OQs" secondAttribute="trailing" constant="8" id="s8d-Y5-xZR"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<connections>
|
||||
<outlet property="mxkButton" destination="nTw-zr-xt2" id="I8D-FA-NHu"/>
|
||||
<outlet property="mxkButtonLeadingConstraint" destination="s8d-Y5-xZR" id="yFz-3Q-x4B"/>
|
||||
<outlet property="mxkButtonProportionalWidthToMxkButtonConstraint" destination="ill-js-N8j" id="XNz-6f-8V1"/>
|
||||
<outlet property="mxkButtonTrailingConstraint" destination="f4b-wS-uFy" id="W7t-7z-PeJ"/>
|
||||
<outlet property="mxkLabel" destination="Xx4-AP-OQs" id="LI1-Yq-PW8"/>
|
||||
<outlet property="mxkLabelLeadingConstraint" destination="Wih-ke-1dd" id="2dO-ba-i74"/>
|
||||
</connections>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
Copyright 2015 OpenMarket Ltd
|
||||
|
||||
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 "MXKTableViewCell.h"
|
||||
|
||||
/**
|
||||
'MXKTableViewCellWithLabelAndImageView' inherits 'MXKTableViewCell' class.
|
||||
It constains a 'UILabel' and a 'UIImageView' vertically centered.
|
||||
*/
|
||||
@interface MXKTableViewCellWithLabelAndImageView : MXKTableViewCell
|
||||
|
||||
@property (strong, nonatomic) IBOutlet UILabel *mxkLabel;
|
||||
@property (strong, nonatomic) IBOutlet UIImageView *mxkImageView;
|
||||
|
||||
/**
|
||||
Leading/Trailing constraints define here spacing to nearest neighbor (no relative to margin)
|
||||
*/
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkLabelLeadingConstraint;
|
||||
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkImageViewLeadingConstraint;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkImageViewTrailingConstraint;
|
||||
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkImageViewWidthConstraint;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkImageViewHeightConstraint;
|
||||
|
||||
/**
|
||||
The image view display box type ('MXKTableViewCellDisplayBoxTypeDefault' by default)
|
||||
*/
|
||||
@property (nonatomic) MXKTableViewCellDisplayBoxType mxkImageViewDisplayBoxType;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
Copyright 2015 OpenMarket Ltd
|
||||
|
||||
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 "MXKTableViewCellWithLabelAndImageView.h"
|
||||
|
||||
@implementation MXKTableViewCellWithLabelAndImageView
|
||||
|
||||
- (void)layoutSubviews
|
||||
{
|
||||
[super layoutSubviews];
|
||||
|
||||
if (self.mxkImageViewDisplayBoxType == MXKTableViewCellDisplayBoxTypeCircle)
|
||||
{
|
||||
// Round image view for thumbnail
|
||||
_mxkImageView.layer.cornerRadius = _mxkImageView.frame.size.width / 2;
|
||||
_mxkImageView.clipsToBounds = YES;
|
||||
}
|
||||
else if (self.mxkImageViewDisplayBoxType == MXKTableViewCellDisplayBoxTypeRoundedCorner)
|
||||
{
|
||||
_mxkImageView.layer.cornerRadius = 5;
|
||||
_mxkImageView.clipsToBounds = YES;
|
||||
}
|
||||
else
|
||||
{
|
||||
_mxkImageView.layer.cornerRadius = 0;
|
||||
_mxkImageView.clipsToBounds = NO;
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="16C67" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" id="aCf-VI-ocb" customClass="MXKTableViewCellWithLabelAndImageView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="aCf-VI-ocb" id="Eg5-vl-rni">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Xx4-AP-OQs">
|
||||
<rect key="frame" x="8" y="11" width="543" height="21"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="F9Q-h1-mTt">
|
||||
<rect key="frame" x="559" y="5" width="33" height="33"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="33" id="Mbb-3z-EJx"/>
|
||||
<constraint firstAttribute="height" constant="33" id="SN2-B2-NSE"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="F9Q-h1-mTt" firstAttribute="centerY" secondItem="Eg5-vl-rni" secondAttribute="centerY" id="2I6-r3-K1d"/>
|
||||
<constraint firstItem="Xx4-AP-OQs" firstAttribute="leading" secondItem="Eg5-vl-rni" secondAttribute="leading" constant="8" id="Wih-ke-1dd"/>
|
||||
<constraint firstItem="F9Q-h1-mTt" firstAttribute="leading" secondItem="Xx4-AP-OQs" secondAttribute="trailing" priority="750" constant="8" id="mXu-V2-6Sm"/>
|
||||
<constraint firstAttribute="trailing" secondItem="F9Q-h1-mTt" secondAttribute="trailing" constant="8" id="v4T-uD-LAm"/>
|
||||
<constraint firstAttribute="centerY" secondItem="Xx4-AP-OQs" secondAttribute="centerY" id="v6O-QC-moW"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<connections>
|
||||
<outlet property="mxkImageView" destination="F9Q-h1-mTt" id="4Lx-au-5RN"/>
|
||||
<outlet property="mxkImageViewHeightConstraint" destination="SN2-B2-NSE" id="Zql-LZ-nsj"/>
|
||||
<outlet property="mxkImageViewLeadingConstraint" destination="mXu-V2-6Sm" id="Ecf-aj-MJv"/>
|
||||
<outlet property="mxkImageViewTrailingConstraint" destination="v4T-uD-LAm" id="HLK-AJ-Gj9"/>
|
||||
<outlet property="mxkImageViewWidthConstraint" destination="Mbb-3z-EJx" id="10m-q5-Yok"/>
|
||||
<outlet property="mxkLabel" destination="Xx4-AP-OQs" id="PHz-Lv-lrf"/>
|
||||
<outlet property="mxkLabelLeadingConstraint" destination="Wih-ke-1dd" id="tyK-6D-jiQ"/>
|
||||
</connections>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
Copyright 2015 OpenMarket Ltd
|
||||
|
||||
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 "MXKTableViewCell.h"
|
||||
|
||||
#import "MXKImageView.h"
|
||||
|
||||
/**
|
||||
'MXKTableViewCellWithLabelAndMXKImageView' inherits 'MXKTableViewCell' class.
|
||||
It constains a 'UILabel' and a 'MXKImageView' vertically centered.
|
||||
*/
|
||||
@interface MXKTableViewCellWithLabelAndMXKImageView : MXKTableViewCell
|
||||
|
||||
@property (strong, nonatomic) IBOutlet UILabel *mxkLabel;
|
||||
@property (strong, nonatomic) IBOutlet MXKImageView *mxkImageView;
|
||||
|
||||
/**
|
||||
Leading/Trailing constraints define here spacing to nearest neighbor (no relative to margin)
|
||||
*/
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkLabelLeadingConstraint;
|
||||
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkImageViewLeadingConstraint;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkImageViewTrailingConstraint;
|
||||
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkImageViewWidthConstraint;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkImageViewHeightConstraint;
|
||||
|
||||
/**
|
||||
The MXKImageView display box type ('MXKTableViewCellDisplayBoxTypeDefault' by default)
|
||||
*/
|
||||
@property (nonatomic) MXKTableViewCellDisplayBoxType mxkImageViewDisplayBoxType;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
Copyright 2015 OpenMarket Ltd
|
||||
|
||||
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 "MXKTableViewCellWithLabelAndMXKImageView.h"
|
||||
|
||||
@implementation MXKTableViewCellWithLabelAndMXKImageView
|
||||
|
||||
- (void)layoutSubviews
|
||||
{
|
||||
[super layoutSubviews];
|
||||
|
||||
if (self.mxkImageViewDisplayBoxType == MXKTableViewCellDisplayBoxTypeCircle)
|
||||
{
|
||||
// Round image view for thumbnail
|
||||
_mxkImageView.layer.cornerRadius = _mxkImageView.frame.size.width / 2;
|
||||
_mxkImageView.clipsToBounds = YES;
|
||||
}
|
||||
else if (self.mxkImageViewDisplayBoxType == MXKTableViewCellDisplayBoxTypeRoundedCorner)
|
||||
{
|
||||
_mxkImageView.layer.cornerRadius = 5;
|
||||
_mxkImageView.clipsToBounds = YES;
|
||||
}
|
||||
else
|
||||
{
|
||||
_mxkImageView.layer.cornerRadius = 0;
|
||||
_mxkImageView.clipsToBounds = NO;
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="16C67" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" id="aCf-VI-ocb" customClass="MXKTableViewCellWithLabelAndMXKImageView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="aCf-VI-ocb" id="Eg5-vl-rni">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Xx4-AP-OQs">
|
||||
<rect key="frame" x="8" y="11" width="538" height="21"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="7Ts-eR-MZV" userLabel="Mxk ImageView" customClass="MXKImageView">
|
||||
<rect key="frame" x="554" y="5" width="33" height="33"/>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="33" id="Ejk-bJ-0MB"/>
|
||||
<constraint firstAttribute="height" constant="33" id="m9S-XK-OTa"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="Xx4-AP-OQs" firstAttribute="leading" secondItem="Eg5-vl-rni" secondAttribute="leading" constant="8" id="Wih-ke-1dd"/>
|
||||
<constraint firstAttribute="trailing" secondItem="7Ts-eR-MZV" secondAttribute="trailing" constant="13" id="atK-Pp-aD8"/>
|
||||
<constraint firstItem="7Ts-eR-MZV" firstAttribute="leading" secondItem="Xx4-AP-OQs" secondAttribute="trailing" constant="8" id="mm9-sU-77x"/>
|
||||
<constraint firstAttribute="centerY" secondItem="Xx4-AP-OQs" secondAttribute="centerY" id="v6O-QC-moW"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<constraints>
|
||||
<constraint firstItem="7Ts-eR-MZV" firstAttribute="centerY" secondItem="aCf-VI-ocb" secondAttribute="centerY" id="lgB-TU-fX3"/>
|
||||
</constraints>
|
||||
<connections>
|
||||
<outlet property="mxkImageView" destination="7Ts-eR-MZV" id="ALS-2d-HUG"/>
|
||||
<outlet property="mxkImageViewHeightConstraint" destination="m9S-XK-OTa" id="hRs-A7-Zrx"/>
|
||||
<outlet property="mxkImageViewLeadingConstraint" destination="mm9-sU-77x" id="nNv-Ns-zdz"/>
|
||||
<outlet property="mxkImageViewTrailingConstraint" destination="atK-Pp-aD8" id="kr5-ot-BDV"/>
|
||||
<outlet property="mxkImageViewWidthConstraint" destination="Ejk-bJ-0MB" id="fgn-XC-e4o"/>
|
||||
<outlet property="mxkLabel" destination="Xx4-AP-OQs" id="PHz-Lv-lrf"/>
|
||||
<outlet property="mxkLabelLeadingConstraint" destination="Wih-ke-1dd" id="ONt-IX-CEx"/>
|
||||
</connections>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
Copyright 2015 OpenMarket Ltd
|
||||
|
||||
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 "MXKTableViewCell.h"
|
||||
|
||||
/**
|
||||
'MXKTableViewCellWithLabelAndSlider' inherits 'MXKTableViewCell' class.
|
||||
It constains a 'UILabel' and a 'UISlider'.
|
||||
*/
|
||||
@interface MXKTableViewCellWithLabelAndSlider : MXKTableViewCell
|
||||
|
||||
@property (nonatomic) IBOutlet UILabel *mxkLabel;
|
||||
@property (nonatomic) IBOutlet UISlider *mxkSlider;
|
||||
|
||||
/**
|
||||
Leading/Trailing constraints define here spacing to nearest neighbor (no relative to margin)
|
||||
*/
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkLabelTopConstraint;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkLabelLeadingConstraint;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkLabelTrailingConstraint;
|
||||
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkSliderTopConstraint;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkSliderLeadingConstraint;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkSliderTrailingConstraint;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkSliderBottomConstraint;
|
||||
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkSliderHeightConstraint;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
Copyright 2015 OpenMarket Ltd
|
||||
|
||||
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 "MXKTableViewCellWithLabelAndSlider.h"
|
||||
|
||||
@implementation MXKTableViewCellWithLabelAndSlider
|
||||
|
||||
@end
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="16C67" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" rowHeight="88" id="lA9-3N-IIx" customClass="MXKTableViewCellWithLabelAndSlider">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="88"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="lA9-3N-IIx" id="Vc0-lB-zV6">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="87"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="584" translatesAutoresizingMaskIntoConstraints="NO" id="k24-l4-6rr">
|
||||
<rect key="frame" x="8" y="8" width="584" height="34"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="34" id="FNq-mS-rjp"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="0.5" minValue="0.0" maxValue="1" translatesAutoresizingMaskIntoConstraints="NO" id="gcY-FQ-8r8">
|
||||
<rect key="frame" x="6" y="49" width="588" height="31"/>
|
||||
<color key="minimumTrackTintColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<color key="maximumTrackTintColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</slider>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="k24-l4-6rr" firstAttribute="top" secondItem="Vc0-lB-zV6" secondAttribute="top" constant="8" id="2hw-Fl-Xrg"/>
|
||||
<constraint firstAttribute="bottom" secondItem="gcY-FQ-8r8" secondAttribute="bottom" constant="8" id="9Om-Ak-gtM"/>
|
||||
<constraint firstItem="gcY-FQ-8r8" firstAttribute="leading" secondItem="Vc0-lB-zV6" secondAttribute="leading" constant="8" id="FkG-hh-eyX"/>
|
||||
<constraint firstItem="k24-l4-6rr" firstAttribute="leading" secondItem="Vc0-lB-zV6" secondAttribute="leading" constant="8" id="OLf-mB-0l0"/>
|
||||
<constraint firstAttribute="trailing" secondItem="k24-l4-6rr" secondAttribute="trailing" constant="8" id="PFM-WC-USa"/>
|
||||
<constraint firstItem="gcY-FQ-8r8" firstAttribute="top" secondItem="k24-l4-6rr" secondAttribute="bottom" constant="7" id="aEh-bN-jLX"/>
|
||||
<constraint firstAttribute="trailing" secondItem="gcY-FQ-8r8" secondAttribute="trailing" constant="8" id="mo8-a8-N8Q"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<connections>
|
||||
<outlet property="mxkLabel" destination="k24-l4-6rr" id="y0D-Mw-0um"/>
|
||||
<outlet property="mxkLabelLeadingConstraint" destination="OLf-mB-0l0" id="ET4-n2-A2u"/>
|
||||
<outlet property="mxkLabelTopConstraint" destination="2hw-Fl-Xrg" id="t7n-aA-lql"/>
|
||||
<outlet property="mxkLabelTrailingConstraint" destination="PFM-WC-USa" id="MPu-eZ-Utj"/>
|
||||
<outlet property="mxkSlider" destination="gcY-FQ-8r8" id="uhT-97-E4d"/>
|
||||
<outlet property="mxkSliderBottomConstraint" destination="9Om-Ak-gtM" id="A7D-Tr-5Xg"/>
|
||||
<outlet property="mxkSliderHeightConstraint" destination="FNq-mS-rjp" id="0vO-0U-iqS"/>
|
||||
<outlet property="mxkSliderLeadingConstraint" destination="FkG-hh-eyX" id="gCG-SE-H49"/>
|
||||
<outlet property="mxkSliderTopConstraint" destination="aEh-bN-jLX" id="6Y5-0U-7Ma"/>
|
||||
<outlet property="mxkSliderTrailingConstraint" destination="mo8-a8-N8Q" id="G8j-DF-rZr"/>
|
||||
</connections>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
Copyright 2015 OpenMarket Ltd
|
||||
|
||||
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 "MXKTableViewCell.h"
|
||||
|
||||
/**
|
||||
'MXKTableViewCellWithLabelAndSubLabel' inherits 'MXKTableViewCell' class.
|
||||
It constains two 'UILabel' instances.
|
||||
*/
|
||||
@interface MXKTableViewCellWithLabelAndSubLabel : MXKTableViewCell
|
||||
|
||||
@property (strong, nonatomic) IBOutlet UILabel* mxkLabel;
|
||||
@property (strong, nonatomic) IBOutlet UILabel* mxkSublabel;
|
||||
|
||||
/**
|
||||
Leading/Trailing constraints define here spacing to nearest neighbor (no relative to margin)
|
||||
*/
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkLabelTopConstraint;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkLabelLeadingConstraint;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkLabelTrailingConstraint;
|
||||
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkSublabelLeadingConstraint;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkSublabelTrailingConstraint;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkSublabelBottomConstraint;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
Copyright 2015 OpenMarket Ltd
|
||||
|
||||
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 "MXKTableViewCellWithLabelAndSubLabel.h"
|
||||
|
||||
@implementation MXKTableViewCellWithLabelAndSubLabel
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="16C67" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="odA-la-SwE" customClass="MXKTableViewCellWithLabelAndSubLabel">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="odA-la-SwE" id="Ice-YN-Ffy">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="rfi-Fa-7Uq">
|
||||
<rect key="frame" x="8" y="6" width="584" height="18"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="15"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Sublabel" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bFk-PP-KQ8">
|
||||
<rect key="frame" x="8" y="22" width="584" height="15"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="12"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="bFk-PP-KQ8" firstAttribute="leading" secondItem="Ice-YN-Ffy" secondAttribute="leading" constant="8" id="EIU-NZ-lLo"/>
|
||||
<constraint firstItem="rfi-Fa-7Uq" firstAttribute="top" secondItem="Ice-YN-Ffy" secondAttribute="top" constant="6" id="RhT-OU-fAa"/>
|
||||
<constraint firstAttribute="bottom" secondItem="bFk-PP-KQ8" secondAttribute="bottom" constant="6" id="XUy-p8-Cn5"/>
|
||||
<constraint firstItem="rfi-Fa-7Uq" firstAttribute="leading" secondItem="Ice-YN-Ffy" secondAttribute="leading" constant="8" id="czr-je-LwV"/>
|
||||
<constraint firstAttribute="trailing" secondItem="rfi-Fa-7Uq" secondAttribute="trailing" constant="8" id="pnn-m6-Idk"/>
|
||||
<constraint firstAttribute="trailing" secondItem="bFk-PP-KQ8" secondAttribute="trailing" constant="8" id="tlW-4P-80L"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<connections>
|
||||
<outlet property="mxkLabel" destination="rfi-Fa-7Uq" id="F0V-zy-oHR"/>
|
||||
<outlet property="mxkLabelLeadingConstraint" destination="czr-je-LwV" id="RiL-Rk-lx8"/>
|
||||
<outlet property="mxkLabelTopConstraint" destination="RhT-OU-fAa" id="tDf-zZ-FDk"/>
|
||||
<outlet property="mxkLabelTrailingConstraint" destination="pnn-m6-Idk" id="fXH-jC-dc5"/>
|
||||
<outlet property="mxkSublabel" destination="bFk-PP-KQ8" id="w63-Pz-7Fc"/>
|
||||
<outlet property="mxkSublabelBottomConstraint" destination="XUy-p8-Cn5" id="ula-Yb-yTz"/>
|
||||
<outlet property="mxkSublabelLeadingConstraint" destination="EIU-NZ-lLo" id="KF2-oE-8yn"/>
|
||||
<outlet property="mxkSublabelTrailingConstraint" destination="tlW-4P-80L" id="uP5-iq-D1f"/>
|
||||
</connections>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
Copyright 2015 OpenMarket Ltd
|
||||
|
||||
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 "MXKTableViewCell.h"
|
||||
|
||||
/**
|
||||
'MXKTableViewCellWithLabelAndSwitch' inherits 'MXKTableViewCell' class.
|
||||
It constains a 'UILabel' and a 'UISwitch' vertically centered.
|
||||
*/
|
||||
@interface MXKTableViewCellWithLabelAndSwitch : MXKTableViewCell
|
||||
|
||||
@property (strong, nonatomic) IBOutlet UILabel *mxkLabel;
|
||||
@property (strong, nonatomic) IBOutlet UISwitch *mxkSwitch;
|
||||
|
||||
/**
|
||||
Leading/Trailing constraints define here spacing to nearest neighbor (no relative to margin)
|
||||
*/
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkLabelLeadingConstraint;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkSwitchLeadingConstraint;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkSwitchTrailingConstraint;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
Copyright 2015 OpenMarket Ltd
|
||||
|
||||
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 "MXKTableViewCellWithLabelAndSwitch.h"
|
||||
|
||||
@implementation MXKTableViewCellWithLabelAndSwitch
|
||||
|
||||
@end
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="12121" 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="12089"/>
|
||||
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" id="aCf-VI-ocb" customClass="MXKTableViewCellWithLabelAndSwitch">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="aCf-VI-ocb" id="Eg5-vl-rni">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="43.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="9dA-E8-w3v">
|
||||
<rect key="frame" x="543" y="6" width="51" height="31"/>
|
||||
</switch>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Xx4-AP-OQs">
|
||||
<rect key="frame" x="8" y="11" width="42" height="21"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="9dA-E8-w3v" firstAttribute="centerY" secondItem="Eg5-vl-rni" secondAttribute="centerY" id="HHv-PY-RDK"/>
|
||||
<constraint firstAttribute="bottomMargin" secondItem="Xx4-AP-OQs" secondAttribute="bottom" constant="3" id="Ikz-iJ-l4h"/>
|
||||
<constraint firstItem="Xx4-AP-OQs" firstAttribute="top" secondItem="Eg5-vl-rni" secondAttribute="topMargin" constant="3" id="Vem-3Z-NyP"/>
|
||||
<constraint firstItem="Xx4-AP-OQs" firstAttribute="leading" secondItem="Eg5-vl-rni" secondAttribute="leading" constant="8" id="Wih-ke-1dd"/>
|
||||
<constraint firstItem="9dA-E8-w3v" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Xx4-AP-OQs" secondAttribute="trailing" constant="8" id="hms-8a-BYd"/>
|
||||
<constraint firstAttribute="trailing" secondItem="9dA-E8-w3v" secondAttribute="trailing" constant="8" id="oN3-Ph-hS5"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<connections>
|
||||
<outlet property="mxkLabel" destination="Xx4-AP-OQs" id="jTM-zE-gtP"/>
|
||||
<outlet property="mxkLabelLeadingConstraint" destination="Wih-ke-1dd" id="b2U-OW-efL"/>
|
||||
<outlet property="mxkSwitch" destination="9dA-E8-w3v" id="sko-Dh-EsF"/>
|
||||
<outlet property="mxkSwitchLeadingConstraint" destination="hms-8a-BYd" id="ACm-RB-bE8"/>
|
||||
<outlet property="mxkSwitchTrailingConstraint" destination="oN3-Ph-hS5" id="Y17-Ii-c3Y"/>
|
||||
</connections>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
Copyright 2015 OpenMarket Ltd
|
||||
|
||||
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 "MXKTableViewCell.h"
|
||||
|
||||
/**
|
||||
'MXKTableViewCellWithLabelAndTextField' inherits 'MXKTableViewCell' class.
|
||||
It constains a 'UILabel' and a 'UITextField' vertically centered.
|
||||
*/
|
||||
@interface MXKTableViewCellWithLabelAndTextField : MXKTableViewCell <UITextFieldDelegate>
|
||||
{
|
||||
@protected
|
||||
UIView *inputAccessoryView;
|
||||
}
|
||||
|
||||
@property (strong, nonatomic) IBOutlet UILabel *mxkLabel;
|
||||
@property (strong, nonatomic) IBOutlet UITextField *mxkTextField;
|
||||
|
||||
/**
|
||||
The custom accessory view associated with the text field. This view is
|
||||
actually used to retrieve the keyboard view. Indeed the keyboard view is the superview of
|
||||
the accessory view when the text field become the first responder.
|
||||
*/
|
||||
@property (readonly) UIView *inputAccessoryView;
|
||||
|
||||
/**
|
||||
Leading/Trailing constraints define here spacing to nearest neighbor (no relative to margin)
|
||||
*/
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkLabelLeadingConstraint;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkLabelMinWidthConstraint;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkTextFieldLeadingConstraint;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkTextFieldTrailingConstraint;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
Copyright 2015 OpenMarket Ltd
|
||||
|
||||
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 "MXKTableViewCellWithLabelAndTextField.h"
|
||||
|
||||
@implementation MXKTableViewCellWithLabelAndTextField
|
||||
@synthesize inputAccessoryView;
|
||||
|
||||
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
|
||||
{
|
||||
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
|
||||
if (self)
|
||||
{
|
||||
// Add an accessory view to the text view in order to retrieve keyboard view.
|
||||
inputAccessoryView = [[UIView alloc] initWithFrame:CGRectZero];
|
||||
_mxkTextField.inputAccessoryView = inputAccessoryView;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
inputAccessoryView = nil;
|
||||
}
|
||||
|
||||
- (void)layoutSubviews
|
||||
{
|
||||
[super layoutSubviews];
|
||||
|
||||
// Fix the minimum width of the label in order to keep it visible when the textfield width is increasing.
|
||||
[_mxkLabel sizeToFit];
|
||||
_mxkLabelMinWidthConstraint.constant = _mxkLabel.frame.size.width;
|
||||
}
|
||||
|
||||
#pragma mark - UITextField delegate
|
||||
|
||||
- (BOOL)textFieldShouldReturn:(UITextField*)textField
|
||||
{
|
||||
// "Done" key has been pressed
|
||||
[self.mxkTextField resignFirstResponder];
|
||||
return YES;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="16C67" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" id="5Je-1y-foH" customClass="MXKTableViewCellWithLabelAndTextField">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="5Je-1y-foH" id="hCm-wd-Yup">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" minimumFontSize="14" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="SBE-PS-i6p">
|
||||
<rect key="frame" x="58" y="7" width="534" height="30"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<textInputTraits key="textInputTraits" returnKeyType="done"/>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="5Je-1y-foH" id="Nie-b5-gB9"/>
|
||||
</connections>
|
||||
</textField>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="584" translatesAutoresizingMaskIntoConstraints="NO" id="DE7-uC-Oz2">
|
||||
<rect key="frame" x="8" y="11" width="42" height="21"/>
|
||||
<color key="tintColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="10" id="Qzq-Ej-Wdb"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailing" secondItem="SBE-PS-i6p" secondAttribute="trailing" constant="8" id="7NM-6p-4fc"/>
|
||||
<constraint firstItem="SBE-PS-i6p" firstAttribute="centerY" secondItem="DE7-uC-Oz2" secondAttribute="centerY" id="LEG-PI-Zmz"/>
|
||||
<constraint firstAttribute="centerY" secondItem="DE7-uC-Oz2" secondAttribute="centerY" id="PU3-ZA-23J"/>
|
||||
<constraint firstItem="SBE-PS-i6p" firstAttribute="leading" secondItem="DE7-uC-Oz2" secondAttribute="trailing" constant="8" id="h1v-HS-kzp"/>
|
||||
<constraint firstItem="DE7-uC-Oz2" firstAttribute="leading" secondItem="hCm-wd-Yup" secondAttribute="leading" constant="8" id="qse-r7-x6e"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<connections>
|
||||
<outlet property="mxkLabel" destination="DE7-uC-Oz2" id="CTb-my-hkV"/>
|
||||
<outlet property="mxkLabelLeadingConstraint" destination="qse-r7-x6e" id="WiE-p0-3PB"/>
|
||||
<outlet property="mxkLabelMinWidthConstraint" destination="Qzq-Ej-Wdb" id="SJc-IC-N5T"/>
|
||||
<outlet property="mxkTextField" destination="SBE-PS-i6p" id="jLi-27-mbO"/>
|
||||
<outlet property="mxkTextFieldLeadingConstraint" destination="h1v-HS-kzp" id="Sx7-JU-SeG"/>
|
||||
<outlet property="mxkTextFieldTrailingConstraint" destination="7NM-6p-4fc" id="tBw-Gt-9pm"/>
|
||||
</connections>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
Copyright 2015 OpenMarket Ltd
|
||||
|
||||
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 "MXKTableViewCell.h"
|
||||
|
||||
/**
|
||||
'MXKTableViewCellWithLabelTextFieldAndButton' inherits 'MXKTableViewCell' class.
|
||||
It constains a 'UILabel' on the first line. The second line is composed with a 'UITextField' and a 'UIButton'
|
||||
vertically aligned.
|
||||
*/
|
||||
@interface MXKTableViewCellWithLabelTextFieldAndButton : MXKTableViewCell <UITextFieldDelegate>
|
||||
{
|
||||
@protected
|
||||
UIView *inputAccessoryView;
|
||||
}
|
||||
|
||||
@property (strong, nonatomic) IBOutlet UILabel *mxkLabel;
|
||||
@property (strong, nonatomic) IBOutlet UITextField *mxkTextField;
|
||||
@property (strong, nonatomic) IBOutlet UIButton *mxkButton;
|
||||
|
||||
/**
|
||||
The custom accessory view associated with the text field. This view is
|
||||
actually used to retrieve the keyboard view. Indeed the keyboard view is the superview of
|
||||
the accessory view when the text field become the first responder.
|
||||
*/
|
||||
@property (readonly) UIView *inputAccessoryView;
|
||||
|
||||
/**
|
||||
Leading/Trailing constraints define here spacing to nearest neighbor (no relative to margin)
|
||||
*/
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkLabelTopConstraint;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkLabelLeadingConstraint;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkLabelTrailingConstraint;
|
||||
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkTextFieldLeadingConstraint;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkTextFieldTopConstraint;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkTextFieldBottomConstraint;
|
||||
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkButtonLeadingConstraint;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkButtonTrailingConstraint;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkButtonMinWidthConstraint;
|
||||
|
||||
- (IBAction)textFieldEditingChanged:(id)sender;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
Copyright 2015 OpenMarket Ltd
|
||||
|
||||
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 "MXKTableViewCellWithLabelTextFieldAndButton.h"
|
||||
|
||||
@implementation MXKTableViewCellWithLabelTextFieldAndButton
|
||||
@synthesize inputAccessoryView;
|
||||
|
||||
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
|
||||
{
|
||||
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
|
||||
if (self)
|
||||
{
|
||||
// Add an accessory view to the text view in order to retrieve keyboard view.
|
||||
inputAccessoryView = [[UIView alloc] initWithFrame:CGRectZero];
|
||||
_mxkTextField.inputAccessoryView = inputAccessoryView;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
inputAccessoryView = nil;
|
||||
}
|
||||
|
||||
#pragma mark - UITextField delegate
|
||||
|
||||
- (BOOL)textFieldShouldReturn:(UITextField*)textField
|
||||
{
|
||||
// "Done" key has been pressed
|
||||
[self.mxkTextField resignFirstResponder];
|
||||
return YES;
|
||||
}
|
||||
|
||||
#pragma mark - Action
|
||||
|
||||
- (IBAction)textFieldEditingChanged:(id)sender
|
||||
{
|
||||
self.mxkButton.enabled = (self.mxkTextField.text.length != 0);
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="16C67" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" rowHeight="70" id="R1k-d9-UZq" customClass="MXKTableViewCellWithLabelTextFieldAndButton">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="70"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="R1k-d9-UZq" id="TrF-Sd-htc">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="69"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" horizontalHuggingPriority="249" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="HwF-3u-e5Q">
|
||||
<rect key="frame" x="8" y="33" width="527" height="30"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<textInputTraits key="textInputTraits" returnKeyType="done"/>
|
||||
<connections>
|
||||
<action selector="textFieldEditingChanged:" destination="R1k-d9-UZq" eventType="editingChanged" id="LeA-rJ-pcV"/>
|
||||
<outlet property="delegate" destination="R1k-d9-UZq" id="X6b-0x-2HJ"/>
|
||||
</connections>
|
||||
</textField>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="KoB-y6-MAj">
|
||||
<rect key="frame" x="543" y="33" width="49" height="30"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="40" id="8Yl-vg-asf"/>
|
||||
</constraints>
|
||||
<state key="normal" title="Submit">
|
||||
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</state>
|
||||
</button>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="14" translatesAutoresizingMaskIntoConstraints="NO" id="9Ez-M7-s8I">
|
||||
<rect key="frame" x="8" y="8" width="584" height="21"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="KoB-y6-MAj" firstAttribute="centerY" secondItem="HwF-3u-e5Q" secondAttribute="centerY" id="0j3-Pg-l0f"/>
|
||||
<constraint firstAttribute="trailing" secondItem="KoB-y6-MAj" secondAttribute="trailing" constant="8" id="Bed-gz-IoV"/>
|
||||
<constraint firstItem="9Ez-M7-s8I" firstAttribute="top" secondItem="TrF-Sd-htc" secondAttribute="top" constant="8" id="UiT-hp-y64"/>
|
||||
<constraint firstAttribute="bottom" secondItem="HwF-3u-e5Q" secondAttribute="bottom" constant="6" id="VBI-N7-ubO"/>
|
||||
<constraint firstAttribute="trailing" secondItem="9Ez-M7-s8I" secondAttribute="trailing" constant="8" id="cKm-EC-j6C"/>
|
||||
<constraint firstItem="HwF-3u-e5Q" firstAttribute="top" secondItem="9Ez-M7-s8I" secondAttribute="bottom" constant="4" id="hsT-zv-aFU"/>
|
||||
<constraint firstItem="HwF-3u-e5Q" firstAttribute="leading" secondItem="TrF-Sd-htc" secondAttribute="leading" constant="8" id="uYR-ZY-FTK"/>
|
||||
<constraint firstItem="KoB-y6-MAj" firstAttribute="leading" secondItem="HwF-3u-e5Q" secondAttribute="trailing" constant="8" id="vZw-2I-IYg"/>
|
||||
<constraint firstItem="9Ez-M7-s8I" firstAttribute="leading" secondItem="TrF-Sd-htc" secondAttribute="leading" constant="8" id="z1S-ho-Niu"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<connections>
|
||||
<outlet property="mxkButton" destination="KoB-y6-MAj" id="HtV-Hu-sJB"/>
|
||||
<outlet property="mxkButtonLeadingConstraint" destination="vZw-2I-IYg" id="tSD-e8-387"/>
|
||||
<outlet property="mxkButtonMinWidthConstraint" destination="8Yl-vg-asf" id="Ysh-Vs-QYO"/>
|
||||
<outlet property="mxkButtonTrailingConstraint" destination="Bed-gz-IoV" id="3KC-1v-buQ"/>
|
||||
<outlet property="mxkLabel" destination="9Ez-M7-s8I" id="RAD-Qz-GHK"/>
|
||||
<outlet property="mxkLabelLeadingConstraint" destination="z1S-ho-Niu" id="nPj-Hs-eA6"/>
|
||||
<outlet property="mxkLabelTopConstraint" destination="UiT-hp-y64" id="Fq9-DJ-zQN"/>
|
||||
<outlet property="mxkLabelTrailingConstraint" destination="cKm-EC-j6C" id="nA3-he-Wll"/>
|
||||
<outlet property="mxkTextField" destination="HwF-3u-e5Q" id="aTc-9G-9BE"/>
|
||||
<outlet property="mxkTextFieldBottomConstraint" destination="VBI-N7-ubO" id="iwS-Hp-9EQ"/>
|
||||
<outlet property="mxkTextFieldLeadingConstraint" destination="uYR-ZY-FTK" id="kOH-F3-xGk"/>
|
||||
<outlet property="mxkTextFieldTopConstraint" destination="hsT-zv-aFU" id="n5u-Lo-TOd"/>
|
||||
</connections>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
Copyright 2015 OpenMarket Ltd
|
||||
|
||||
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 "MXKTableViewCell.h"
|
||||
|
||||
/**
|
||||
'MXKTableViewCellWithPicker' inherits 'MXKTableViewCell' class.
|
||||
It constains a 'UIPickerView' vertically centered.
|
||||
*/
|
||||
@interface MXKTableViewCellWithPicker : MXKTableViewCell
|
||||
|
||||
@property (strong, nonatomic) IBOutlet UIPickerView* mxkPickerView;
|
||||
|
||||
/**
|
||||
Leading/Trailing constraints define here spacing to nearest neighbor (no relative to margin)
|
||||
*/
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkPickerViewLeadingConstraint;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkPickerViewTopConstraint;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkPickerViewBottomConstraint;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkPickerViewTrailingConstraint;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
Copyright 2015 OpenMarket Ltd
|
||||
|
||||
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 "MXKTableViewCellWithPicker.h"
|
||||
|
||||
@implementation MXKTableViewCellWithPicker
|
||||
|
||||
@end
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="16C67" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="164" id="q82-Um-cU7" customClass="MXKTableViewCellWithPicker">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="164"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="q82-Um-cU7" id="aBM-uR-U5E">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="163"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<pickerView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="hrr-rd-eoA">
|
||||
<rect key="frame" x="8" y="8" width="584" height="147"/>
|
||||
</pickerView>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="hrr-rd-eoA" firstAttribute="top" secondItem="aBM-uR-U5E" secondAttribute="top" constant="8" id="J6o-ID-bDs"/>
|
||||
<constraint firstAttribute="trailing" secondItem="hrr-rd-eoA" secondAttribute="trailing" constant="8" id="SSs-GG-jvP"/>
|
||||
<constraint firstItem="hrr-rd-eoA" firstAttribute="leading" secondItem="aBM-uR-U5E" secondAttribute="leading" constant="8" id="V0R-Eb-PWo"/>
|
||||
<constraint firstAttribute="bottom" secondItem="hrr-rd-eoA" secondAttribute="bottom" constant="8" id="h2E-4o-qec"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<connections>
|
||||
<outlet property="mxkPickerView" destination="hrr-rd-eoA" id="HBG-aN-sZg"/>
|
||||
<outlet property="mxkPickerViewBottomConstraint" destination="h2E-4o-qec" id="2eo-oT-tUZ"/>
|
||||
<outlet property="mxkPickerViewLeadingConstraint" destination="V0R-Eb-PWo" id="uBh-Jo-oOn"/>
|
||||
<outlet property="mxkPickerViewTopConstraint" destination="J6o-ID-bDs" id="pEK-EQ-1IJ"/>
|
||||
<outlet property="mxkPickerViewTrailingConstraint" destination="SSs-GG-jvP" id="8JI-Zy-LfB"/>
|
||||
</connections>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
Copyright 2015 OpenMarket Ltd
|
||||
|
||||
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 "MXKTableViewCell.h"
|
||||
|
||||
/**
|
||||
'MXKTableViewCellWithSearchBar' inherits 'MXKTableViewCell' class.
|
||||
It constains a 'UISearchBar' vertically centered.
|
||||
*/
|
||||
@interface MXKTableViewCellWithSearchBar : MXKTableViewCell
|
||||
|
||||
@property (strong, nonatomic) IBOutlet UISearchBar *mxkSearchBar;
|
||||
|
||||
/**
|
||||
Leading/Trailing constraints define here spacing to nearest neighbor (no relative to margin)
|
||||
*/
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkSearchBarLeadingConstraint;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkSearchBarTopConstraint;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkSearchBarBottomConstraint;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkSearchBarTrailingConstraint;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
Copyright 2015 OpenMarket Ltd
|
||||
|
||||
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 "MXKTableViewCellWithSearchBar.h"
|
||||
|
||||
@implementation MXKTableViewCellWithSearchBar
|
||||
|
||||
@end
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="16C67" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" id="20U-7H-xmi" customClass="MXKTableViewCellWithSearchBar">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="20U-7H-xmi" id="cFw-g7-Cgn">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<searchBar contentMode="redraw" translatesAutoresizingMaskIntoConstraints="NO" id="HgP-TQ-bd1">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/>
|
||||
<textInputTraits key="textInputTraits"/>
|
||||
</searchBar>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="bottom" secondItem="HgP-TQ-bd1" secondAttribute="bottom" id="9RG-MY-amb"/>
|
||||
<constraint firstItem="HgP-TQ-bd1" firstAttribute="top" secondItem="cFw-g7-Cgn" secondAttribute="top" id="csH-4b-32a"/>
|
||||
<constraint firstItem="HgP-TQ-bd1" firstAttribute="leading" secondItem="cFw-g7-Cgn" secondAttribute="leading" id="duA-9h-WEA"/>
|
||||
<constraint firstAttribute="trailing" secondItem="HgP-TQ-bd1" secondAttribute="trailing" id="y0I-NU-96o"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<connections>
|
||||
<outlet property="mxkSearchBar" destination="HgP-TQ-bd1" id="2YT-dI-X4U"/>
|
||||
<outlet property="mxkSearchBarBottomConstraint" destination="9RG-MY-amb" id="CFM-k7-uGe"/>
|
||||
<outlet property="mxkSearchBarLeadingConstraint" destination="duA-9h-WEA" id="5vm-V4-Qsu"/>
|
||||
<outlet property="mxkSearchBarTopConstraint" destination="csH-4b-32a" id="NHJ-WR-9Hm"/>
|
||||
<outlet property="mxkSearchBarTrailingConstraint" destination="y0I-NU-96o" id="lb1-cE-sE0"/>
|
||||
</connections>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
Copyright 2015 OpenMarket Ltd
|
||||
|
||||
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 "MXKTableViewCell.h"
|
||||
|
||||
/**
|
||||
'MXKTableViewCellWithTextFieldAndButton' inherits 'MXKTableViewCell' class.
|
||||
It constains a 'UITextField' and a 'UIButton' vertically centered.
|
||||
*/
|
||||
@interface MXKTableViewCellWithTextFieldAndButton : MXKTableViewCell <UITextFieldDelegate>
|
||||
{
|
||||
@protected
|
||||
UIView *inputAccessoryView;
|
||||
}
|
||||
|
||||
@property (strong, nonatomic) IBOutlet UITextField *mxkTextField;
|
||||
@property (strong, nonatomic) IBOutlet UIButton *mxkButton;
|
||||
|
||||
/**
|
||||
The custom accessory view associated with the text field. This view is
|
||||
actually used to retrieve the keyboard view. Indeed the keyboard view is the superview of
|
||||
the accessory view when the text field become the first responder.
|
||||
*/
|
||||
@property (readonly) UIView *inputAccessoryView;
|
||||
|
||||
/**
|
||||
Leading/Trailing constraints define here spacing to nearest neighbor (no relative to margin)
|
||||
*/
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkTextFieldLeadingConstraint;
|
||||
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkButtonLeadingConstraint;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkButtonTrailingConstraint;
|
||||
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkButtonMinWidthConstraint;
|
||||
|
||||
- (IBAction)textFieldEditingChanged:(id)sender;
|
||||
@end
|
||||
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
Copyright 2015 OpenMarket Ltd
|
||||
|
||||
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 "MXKTableViewCellWithTextFieldAndButton.h"
|
||||
|
||||
@implementation MXKTableViewCellWithTextFieldAndButton
|
||||
@synthesize inputAccessoryView;
|
||||
|
||||
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
|
||||
{
|
||||
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
|
||||
if (self)
|
||||
{
|
||||
// Add an accessory view to the text view in order to retrieve keyboard view.
|
||||
inputAccessoryView = [[UIView alloc] initWithFrame:CGRectZero];
|
||||
_mxkTextField.inputAccessoryView = inputAccessoryView;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
inputAccessoryView = nil;
|
||||
}
|
||||
|
||||
#pragma mark - UITextField delegate
|
||||
|
||||
- (BOOL)textFieldShouldReturn:(UITextField*)textField
|
||||
{
|
||||
// "Done" key has been pressed
|
||||
[self.mxkTextField resignFirstResponder];
|
||||
return YES;
|
||||
}
|
||||
|
||||
#pragma mark - Action
|
||||
|
||||
- (IBAction)textFieldEditingChanged:(id)sender
|
||||
{
|
||||
self.mxkButton.enabled = (self.mxkTextField.text.length != 0);
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="16C67" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" id="20U-7H-xmi" customClass="MXKTableViewCellWithTextFieldAndButton">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="20U-7H-xmi" id="cFw-g7-Cgn">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" horizontalHuggingPriority="249" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="XWh-rM-iqf">
|
||||
<rect key="frame" x="8" y="7" width="527" height="30"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<textInputTraits key="textInputTraits" returnKeyType="done"/>
|
||||
<connections>
|
||||
<action selector="textFieldEditingChanged:" destination="20U-7H-xmi" eventType="editingChanged" id="XUA-5O-AC8"/>
|
||||
<outlet property="delegate" destination="20U-7H-xmi" id="IIR-M2-klm"/>
|
||||
</connections>
|
||||
</textField>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Ycy-33-7Zq">
|
||||
<rect key="frame" x="543" y="7" width="49" height="30"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="40" id="bvf-cL-4kz"/>
|
||||
</constraints>
|
||||
<state key="normal" title="Submit">
|
||||
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</state>
|
||||
</button>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailing" secondItem="Ycy-33-7Zq" secondAttribute="trailing" constant="8" id="PaG-vi-8XK"/>
|
||||
<constraint firstAttribute="centerY" secondItem="XWh-rM-iqf" secondAttribute="centerY" id="TMe-P5-cPy"/>
|
||||
<constraint firstAttribute="centerY" secondItem="Ycy-33-7Zq" secondAttribute="centerY" id="WRy-Ga-ivi"/>
|
||||
<constraint firstItem="XWh-rM-iqf" firstAttribute="leading" secondItem="cFw-g7-Cgn" secondAttribute="leading" constant="8" id="Ydc-ON-VIq"/>
|
||||
<constraint firstItem="Ycy-33-7Zq" firstAttribute="leading" secondItem="XWh-rM-iqf" secondAttribute="trailing" constant="8" id="vw8-zU-VJt"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<connections>
|
||||
<outlet property="mxkButton" destination="Ycy-33-7Zq" id="fwp-cx-faQ"/>
|
||||
<outlet property="mxkButtonLeadingConstraint" destination="vw8-zU-VJt" id="Lep-jf-4Sa"/>
|
||||
<outlet property="mxkButtonMinWidthConstraint" destination="bvf-cL-4kz" id="Q0x-ro-SjH"/>
|
||||
<outlet property="mxkButtonTrailingConstraint" destination="PaG-vi-8XK" id="fYB-xQ-ppJ"/>
|
||||
<outlet property="mxkTextField" destination="XWh-rM-iqf" id="2Bm-Ks-lAr"/>
|
||||
<outlet property="mxkTextFieldLeadingConstraint" destination="Ydc-ON-VIq" id="Jap-J5-Vno"/>
|
||||
</connections>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
Copyright 2015 OpenMarket Ltd
|
||||
|
||||
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 "MXKTableViewCell.h"
|
||||
|
||||
/**
|
||||
'MXKTableViewCellWithTextView' inherits 'MXKTableViewCell' class.
|
||||
It constains a 'UITextView' vertically centered.
|
||||
*/
|
||||
@interface MXKTableViewCellWithTextView : MXKTableViewCell
|
||||
|
||||
@property (strong, nonatomic) IBOutlet UITextView *mxkTextView;
|
||||
|
||||
/**
|
||||
Leading/Trailing constraints define here spacing to nearest neighbor (no relative to margin)
|
||||
*/
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkTextViewLeadingConstraint;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkTextViewTopConstraint;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkTextViewBottomConstraint;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *mxkTextViewTrailingConstraint;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
Copyright 2015 OpenMarket Ltd
|
||||
|
||||
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 "MXKTableViewCellWithTextView.h"
|
||||
|
||||
@implementation MXKTableViewCellWithTextView
|
||||
|
||||
@end
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="16C67" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" id="s7g-kx-9uy" customClass="MXKTableViewCellWithTextView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="s7g-kx-9uy" id="mT3-eb-yVs">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" scrollEnabled="NO" editable="NO" translatesAutoresizingMaskIntoConstraints="NO" id="VW8-Lj-jTg">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<string key="text">Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.</string>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
|
||||
</textView>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailing" secondItem="VW8-Lj-jTg" secondAttribute="trailing" id="4IP-hg-2gT"/>
|
||||
<constraint firstItem="VW8-Lj-jTg" firstAttribute="top" secondItem="mT3-eb-yVs" secondAttribute="top" id="KfR-At-oco"/>
|
||||
<constraint firstItem="VW8-Lj-jTg" firstAttribute="leading" secondItem="mT3-eb-yVs" secondAttribute="leading" id="RzU-IB-SOg"/>
|
||||
<constraint firstAttribute="bottom" secondItem="VW8-Lj-jTg" secondAttribute="bottom" id="cGd-Tr-QQc"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<connections>
|
||||
<outlet property="mxkTextView" destination="VW8-Lj-jTg" id="5ET-Yw-VFe"/>
|
||||
<outlet property="mxkTextViewBottomConstraint" destination="cGd-Tr-QQc" id="S9q-zW-dMh"/>
|
||||
<outlet property="mxkTextViewLeadingConstraint" destination="RzU-IB-SOg" id="iq3-pW-vbQ"/>
|
||||
<outlet property="mxkTextViewTopConstraint" destination="KfR-At-oco" id="I7f-NE-FSb"/>
|
||||
<outlet property="mxkTextViewTrailingConstraint" destination="4IP-hg-2gT" id="mlo-8q-mmg"/>
|
||||
</connections>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
</document>
|
||||
Reference in New Issue
Block a user