Skip to content

Commit

Permalink
Updated for version 3.7 of the Adonit iOS SDK.
Browse files Browse the repository at this point in the history
  • Loading branch information
adonitDevel committed Aug 19, 2019
1 parent 673783b commit 8ba9087
Show file tree
Hide file tree
Showing 32 changed files with 190 additions and 40 deletions.
Binary file modified AdonitSDK.bundle/DebugOptionsTableViewCell.nib
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified AdonitSDK.bundle/JotSettings.storyboardc/Info.plist
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified AdonitSDK.framework/Versions/A/AdonitSDK
Binary file not shown.
18 changes: 17 additions & 1 deletion AdonitSDK.framework/Versions/A/Headers/JotStroke.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
/*! A value of 0 radians indicates that the stylus is parallel to the surface; when the stylus is perpendicular to the surface, altitudeAngle is Pi/2.
Styluses that do not support altitude angle (Such as Jot Script and Jot Touch 4) will return a value of Pi/4.
*/
@property (nonatomic, readonly) CGFloat altitudeAngle;
@property (nonatomic) CGFloat altitudeAngle;

/*! An array of coalescedJotStrokes similar to the concept of coalesced UITouches. If you do not enable coalescedJotStrokes, this will return an array populated by this jotStroke instead. To enable coalescedJotStrokes turn on "coalescedJotStrokesEnabled" on an instance of JotStylusManager. Note: Coalesced strokes are snapshots, and each instance is a separate object. For tracking a persistent stroke across events, use the non-coalesced parent jotStroke instead of strokes from this array.
*/
Expand All @@ -61,4 +61,20 @@
*/
@property (nonatomic, readonly) NSArray *predictedJotStrokes;

/*! A value of 0 radians points along the positive x axis; when the stylus tip is pointing towards the bottom of the view, azimuthAngle is Pi/2.
Styluses that do not support azimuth angle (Such as Jot Script and Jot Touch 4) will return a value of Pi/4.
*
* @param view The view that contains the stylus’s touch. Pass nil to get the azimuth angle that is relative to the touch’s window
* @return The azimuth angle of the stylus, in radians.
*/
- (CGFloat)azimuthAngleInView:(UIView *)view;

/*! Returns a unit vector that points in the direction of the azimuth of the stylus.
*
* @param view The view that contains the stylus’s touch. Pass nil to get the unit vector for the azimuth that is relative to the touch’s window.
* @return The unit vector that points in the direction of the azimuth of the stylus.
*/
- (CGVector)azimuthUnitVectorInView:(UIView *)view;


@end
21 changes: 17 additions & 4 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
#Change Log for AdonitSDK (iOS)

#v3.7

**SDK**
- Implement azimuthAngleInView, azimuthUnitVectorInView, altitudeAngle for note plus.
- Fix disable offset can't get altitudeAngle.

#v3.6

**SDK**
- Fixed issue that online configuration file from persisting updating.
- Add note plus support.
- Add iPad mini5, iPad Air 3, iPad Pro (11-inch), iPad 2018 configuration.

#v3.5

**SDK**
Expand Down Expand Up @@ -88,7 +101,7 @@
- Improved responsiveness of altitudeAngle on jotStroke with compatible styluses.
- Updated default primaryColor of JotSettings UI to match Adonit Branding. (Can still be changed to match your apps palette.)

#v3.1
#v3.1
- Support for upcoming Adonit Stylus
- Predictive jotStrokes.
- JotStroke pressure is now an adonit calibrated pressure curve that returns a float value beween 0.0 and 1.0
Expand All @@ -114,7 +127,7 @@
# V3.0.1
- Fixed an issue that could cause a crash in the iOS Simulator.

# V3.0
# V3.0
- Fixed a crash around switching in and out of an app in iOS 9 with a connected Stylus.

#V3.0 Beta 4 / Release Canidate
Expand Down Expand Up @@ -205,7 +218,7 @@
# V2.5 Public Release
- see UPDATE.md for a rundown of API changes in this release
- fixed numerous bugs when running on legacy iOS 6 devices
- added ability for SDK to update configuration settings.
- added ability for SDK to update configuration settings.
this will allow us to support future iOS devices without
requiring apps to distribute new builds.
- updated example app to support new API changes
Expand Down Expand Up @@ -310,7 +323,7 @@ requiring apps to distribute new builds.
- JotSettingsViewController no longer shows the shortcut buttons list item if no shortcuts have been registered.

##JotTouchSDK V1.0.3
- Removed a leftover NSLog
- Removed a leftover NSLog

##JotTouchSDK V1.0.2
- Added an unregisterView: method
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
13 changes: 10 additions & 3 deletions JotTouchExample/JotTouchExample/CanvasView.m
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@ - (void)jotStylusStrokeBegan:(JotStroke *)stylusStroke
coalesedCounter++;
CGFloat pressure = coalescedJotStroke.pressure;
CGPoint location = [coalescedJotStroke locationInView:self];
//NSLog(@"jotStylusStrokeBegan point %@",NSStringFromCGPoint(location));
self.viewController.radianLabel.text = [NSString stringWithFormat:@"%.5f",[coalescedJotStroke altitudeAngle]];
self.viewController.angleLabel.text = [NSString stringWithFormat:@"%.5f",[coalescedJotStroke altitudeAngle] * 180 / M_PI];
CGFloat offset = 0;//[self widthForPressure:pressure tilt:coalescedJotStroke.altitudeAngle] / 10;

[self addLineToAndRenderStroke:currentStroke
Expand Down Expand Up @@ -274,7 +275,9 @@ - (void)jotStylusStrokeMoved:(JotStroke *)stylusStroke
for (JotStroke *coalescedJotStroke in stylusStroke.coalescedJotStrokes) {

CGPoint location = [coalescedJotStroke locationInView:self];
//NSLog(@"jotStylusStrokeMoved point %@",NSStringFromCGPoint(location));
NSLog(@"azimuthAngleInView = %f , azimuthUnitVectorInView = %@ , altitudeAngle = %f",[coalescedJotStroke azimuthAngleInView:self] ,NSStringFromCGVector([coalescedJotStroke azimuthUnitVectorInView:self]), [coalescedJotStroke altitudeAngle] );
self.viewController.radianLabel.text = [NSString stringWithFormat:@"%.5f",[coalescedJotStroke altitudeAngle]];
self.viewController.angleLabel.text = [NSString stringWithFormat:@"%.5f",[coalescedJotStroke altitudeAngle] * 180 / M_PI];
CGFloat pressure = coalescedJotStroke.pressure;
CGFloat width = [self widthForPressure:pressure tilt:coalescedJotStroke.altitudeAngle];
CGFloat offset = 0;//[self widthForPressure:pressure tilt:coalescedJotStroke.altitudeAngle] / 10;
Expand Down Expand Up @@ -377,7 +380,8 @@ - (void)jotStylusStrokeEnded:(JotStroke *)stylusStroke

for (JotStroke *coalescedJotStroke in stylusStroke.coalescedJotStrokes) {
CGPoint location = [coalescedJotStroke locationInView:self];

self.viewController.radianLabel.text = [NSString stringWithFormat:@"%.5f",[coalescedJotStroke altitudeAngle]];
self.viewController.angleLabel.text = [NSString stringWithFormat:@"%.5f",[coalescedJotStroke altitudeAngle] * 180 / M_PI];
CGFloat stylusPressure = coalescedJotStroke.pressure / 2.0; // Setting end of each stroke to zero pressure can cause a more organic stroke roll off with fast strokes.
[self addLineToAndRenderStroke:currentStroke
toPoint:location
Expand Down Expand Up @@ -493,6 +497,9 @@ - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
// AbstractBezierPathElement* last = currentStroke.segments.lastObject;
for (UITouch *coalescedTouch in coalescedTouches) {
CGPoint location = [coalescedTouch locationInView:self];
NSLog(@"azimuthAngleInView = %f , azimuthUnitVectorInView = %@ , altitudeAngle = %f",[coalescedTouch azimuthAngleInView:self] ,NSStringFromCGVector([coalescedTouch azimuthUnitVectorInView:self]), [coalescedTouch altitudeAngle] );
self.viewController.radianLabel.text = [NSString stringWithFormat:@"%.5f",[coalescedTouch altitudeAngle]];
self.viewController.angleLabel.text = [NSString stringWithFormat:@"%.5f",[coalescedTouch altitudeAngle] * 180 / M_PI];
if (currentStroke) {
[self addLineToAndRenderStroke:currentStroke
toPoint:location
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "PencilTexture.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 42 additions & 5 deletions JotTouchExample/JotTouchExample/MainStoryboard.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -41,32 +41,67 @@
<view contentMode="redraw" translatesAutoresizingMaskIntoConstraints="NO" id="czy-jY-al6" customClass="CanvasView">
<rect key="frame" x="-128" y="0.0" width="1024" height="1024"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="RgQ-TG-B9R">
<rect key="frame" x="486" y="28" width="42" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Platform:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9hr-pZ-elE">
<rect key="frame" x="209" y="28" width="70" height="21"/>
<rect key="frame" x="209" y="28" width="69.5" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2Ap-Sz-sSr">
<rect key="frame" x="224" y="49" width="69" height="21"/>
<rect key="frame" x="298.5" y="28" width="69" height="20.5"/>
<constraints>
<constraint firstAttribute="width" constant="69" id="yEk-lc-i6Y"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Angle:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="OEf-3P-7k2">
<rect key="frame" x="417.5" y="28" width="48.5" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Radian:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xAi-23-469">
<rect key="frame" x="417.5" y="57" width="57" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="To0-7Q-ea0">
<rect key="frame" x="486.5" y="57" width="42" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="2Ap-Sz-sSr" firstAttribute="top" secondItem="9hr-pZ-elE" secondAttribute="top" id="0fh-VM-tu2"/>
<constraint firstItem="OEf-3P-7k2" firstAttribute="leading" secondItem="2Ap-Sz-sSr" secondAttribute="trailing" constant="50" id="9ND-Z7-4LM"/>
<constraint firstItem="xAi-23-469" firstAttribute="leading" secondItem="OEf-3P-7k2" secondAttribute="leading" id="BUY-nm-Mh1"/>
<constraint firstItem="2Ap-Sz-sSr" firstAttribute="leading" secondItem="9hr-pZ-elE" secondAttribute="trailing" constant="20" id="ECT-Bs-khF"/>
<constraint firstItem="To0-7Q-ea0" firstAttribute="leading" secondItem="xAi-23-469" secondAttribute="trailing" constant="12" id="J8J-f9-gRD"/>
<constraint firstItem="xAi-23-469" firstAttribute="top" secondItem="OEf-3P-7k2" secondAttribute="bottom" constant="8" id="K4P-Lp-u4k"/>
<constraint firstItem="RgQ-TG-B9R" firstAttribute="top" secondItem="OEf-3P-7k2" secondAttribute="top" id="M9q-cC-Zht"/>
<constraint firstAttribute="width" constant="1024" id="Mjm-E6-YZs"/>
<constraint firstItem="To0-7Q-ea0" firstAttribute="top" secondItem="xAi-23-469" secondAttribute="top" id="Ow1-oI-v9l"/>
<constraint firstItem="9hr-pZ-elE" firstAttribute="top" secondItem="czy-jY-al6" secondAttribute="topMargin" id="SYc-ou-6Qa"/>
<constraint firstItem="2Ap-Sz-sSr" firstAttribute="baseline" secondItem="9hr-pZ-elE" secondAttribute="baseline" constant="21" id="Tkh-xK-MwF"/>
<constraint firstItem="2Ap-Sz-sSr" firstAttribute="leading" secondItem="9hr-pZ-elE" secondAttribute="trailing" constant="-55" id="Xhp-ja-TiB"/>
<constraint firstItem="RgQ-TG-B9R" firstAttribute="leading" secondItem="OEf-3P-7k2" secondAttribute="trailing" constant="20" id="UjQ-0b-UzU"/>
<constraint firstAttribute="height" constant="1024" id="ejQ-mn-lKn"/>
<constraint firstItem="9hr-pZ-elE" firstAttribute="leading" secondItem="czy-jY-al6" secondAttribute="leading" constant="209" id="hq1-nz-YqO"/>
</constraints>
</view>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="mxE-I5-uqE">
<rect key="frame" x="-128" y="0.0" width="1024" height="1024"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="jId-Mr-D6Y" userLabel="AdonitLogo - Button">
<rect key="frame" x="20" y="20" width="51" height="50"/>
<constraints>
Expand Down Expand Up @@ -245,7 +280,7 @@
</connections>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Ber-RQ-cKu" userLabel="Interface Container View">
<rect key="frame" x="528" y="10" width="225" height="150"/>
<rect key="frame" x="528" y="0.0" width="225" height="150"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="hpm-GL-lSi" userLabel="Button - Clear">
<rect key="frame" x="169" y="0.0" width="64" height="64"/>
Expand Down Expand Up @@ -427,6 +462,7 @@
<nil key="simulatedStatusBarMetrics"/>
<connections>
<outlet property="adonitLogo" destination="jId-Mr-D6Y" id="E56-Ht-ZU8"/>
<outlet property="angleLabel" destination="RgQ-TG-B9R" id="qi7-Fm-GGj"/>
<outlet property="brushButton" destination="Jo2-Zv-qAw" id="n0A-S4-q2c"/>
<outlet property="brushColorPreview" destination="Twz-RT-IeJ" id="wvz-4F-8zj"/>
<outlet property="canvasView" destination="czy-jY-al6" id="OzP-d6-O2n"/>
Expand All @@ -436,6 +472,7 @@
<outlet property="jotStatusIndicatorContainerView" destination="FEC-vc-dff" id="gIN-Rz-yWx"/>
<outlet property="penButton" destination="hnq-kF-DiM" id="ohb-Dw-D4Y"/>
<outlet property="platformLabel" destination="2Ap-Sz-sSr" id="lzt-a7-IAy"/>
<outlet property="radianLabel" destination="To0-7Q-ea0" id="ZSh-Py-rih"/>
<outlet property="resetCanvasButton" destination="hpm-GL-lSi" id="QV0-t0-aOs"/>
</connections>
</viewController>
Expand Down
2 changes: 2 additions & 0 deletions JotTouchExample/JotTouchExample/ViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
@property (weak, nonatomic) IBOutlet UIView *connectionStatusView;

@property (strong, nonatomic) IBOutlet UILabel *platformLabel;
@property (weak, nonatomic) IBOutlet UILabel *angleLabel;
@property (weak, nonatomic) IBOutlet UILabel *radianLabel;

// JotStatusIndicators Properties & Methods
@property (nonatomic, weak) IBOutlet JotStatusIndicatorView* jotStatusIndicatorContainerView;
Expand Down
Loading

0 comments on commit 8ba9087

Please sign in to comment.