-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Improve Markymark's way of URL opening by allowing customisation of the url opening behavior. - Support running Extensions and using extensionContext to open url's - Support i.e. opening urls in a internal Safari View Controller instead of the open url behavior
- Loading branch information
1 parent
bf07575
commit 76a00f2
Showing
19 changed files
with
482 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
PODS: | ||
- markymark (7.1) | ||
- markymark (8.0.0) | ||
|
||
DEPENDENCIES: | ||
- markymark (from `../`) | ||
|
||
EXTERNAL SOURCES: | ||
markymark: | ||
:path: ../ | ||
:path: "../" | ||
|
||
SPEC CHECKSUMS: | ||
markymark: 2dbd0f000579b1992d0e6355d5cdd83b097d03f7 | ||
markymark: 47a730450bc0c583f877a26ba3d77c3f7f930059 | ||
|
||
PODFILE CHECKSUM: 702819c9a9352a2969fd49865aabe1f21e7c3404 | ||
PODFILE CHECKSUM: b777cb29f5ff9935c02362ec42fa8a45e73dcf8f | ||
|
||
COCOAPODS: 1.4.0 | ||
COCOAPODS: 1.5.3 |
46 changes: 46 additions & 0 deletions
46
Example/TodayExtension/Base.lproj/MainInterface.storyboard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="M4Y-Lb-cyx"> | ||
<device id="retina4_7" orientation="portrait"> | ||
<adaptation id="fullscreen"/> | ||
</device> | ||
<dependencies> | ||
<deployment identifier="iOS"/> | ||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/> | ||
<capability name="Safe area layout guides" minToolsVersion="9.0"/> | ||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | ||
</dependencies> | ||
<scenes> | ||
<!--Today View Controller--> | ||
<scene sceneID="cwh-vc-ff4"> | ||
<objects> | ||
<viewController id="M4Y-Lb-cyx" customClass="TodayViewController" customModule="TodayExtension" customModuleProvider="target" sceneMemberID="viewController"> | ||
<view key="view" contentMode="scaleToFill" simulatedAppContext="notificationCenter" id="S3S-Oj-5AN"> | ||
<rect key="frame" x="0.0" y="0.0" width="320" height="37"/> | ||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
<subviews> | ||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="rR0-pe-hmH" customClass="MarkDownTextView" customModule="markymark"> | ||
<rect key="frame" x="0.0" y="0.0" width="320" height="37"/> | ||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> | ||
</view> | ||
</subviews> | ||
<constraints> | ||
<constraint firstItem="ssy-KU-ocm" firstAttribute="bottom" secondItem="rR0-pe-hmH" secondAttribute="bottom" id="Sgy-ET-v8k"/> | ||
<constraint firstItem="rR0-pe-hmH" firstAttribute="top" secondItem="ssy-KU-ocm" secondAttribute="top" id="Vos-mV-XS2"/> | ||
<constraint firstItem="rR0-pe-hmH" firstAttribute="leading" secondItem="ssy-KU-ocm" secondAttribute="leading" id="cx4-WT-whY"/> | ||
<constraint firstItem="ssy-KU-ocm" firstAttribute="trailing" secondItem="rR0-pe-hmH" secondAttribute="trailing" id="hLA-Yo-WJ4"/> | ||
</constraints> | ||
<viewLayoutGuide key="safeArea" id="ssy-KU-ocm"/> | ||
</view> | ||
<extendedEdge key="edgesForExtendedLayout"/> | ||
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/> | ||
<size key="freeformSize" width="320" height="37"/> | ||
<connections> | ||
<outlet property="markDownTextView" destination="rR0-pe-hmH" id="EZ1-yL-blg"/> | ||
</connections> | ||
</viewController> | ||
<placeholder placeholderIdentifier="IBFirstResponder" id="vXp-U4-Rya" userLabel="First Responder" sceneMemberID="firstResponder"/> | ||
</objects> | ||
<point key="canvasLocation" x="137.59999999999999" y="129.98500749625188"/> | ||
</scene> | ||
</scenes> | ||
</document> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?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>CFBundleDevelopmentRegion</key> | ||
<string>$(DEVELOPMENT_LANGUAGE)</string> | ||
<key>CFBundleDisplayName</key> | ||
<string>TodayExtension</string> | ||
<key>CFBundleExecutable</key> | ||
<string>$(EXECUTABLE_NAME)</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> | ||
<key>CFBundleInfoDictionaryVersion</key> | ||
<string>6.0</string> | ||
<key>CFBundleName</key> | ||
<string>$(PRODUCT_NAME)</string> | ||
<key>CFBundlePackageType</key> | ||
<string>XPC!</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>1.0</string> | ||
<key>CFBundleVersion</key> | ||
<string>1</string> | ||
<key>NSExtension</key> | ||
<dict> | ||
<key>NSExtensionMainStoryboard</key> | ||
<string>MainInterface</string> | ||
<key>NSExtensionPointIdentifier</key> | ||
<string>com.apple.widget-extension</string> | ||
</dict> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// | ||
// TodayViewController.swift | ||
// TodayExtension | ||
// | ||
// Created by Jim van Zummeren on 21/11/2018. | ||
// Copyright © 2018 CocoaPods. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
import NotificationCenter | ||
import markymark | ||
|
||
class TodayViewController: UIViewController, NCWidgetProviding { | ||
|
||
@IBOutlet var markDownTextView: MarkDownTextView? | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
markDownTextView?.text = """ | ||
# Some header | ||
A paragraph with a **link** to [Google](https://www.google.com) | ||
""" | ||
|
||
markDownTextView?.urlOpener = ExtensionContextURLOpener(extensionContext: self.extensionContext) | ||
} | ||
} | ||
|
Oops, something went wrong.