├── MarkdownTextEditor.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── xcuserdata │ └── aheze.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist ├── MarkdownTextEditor ├── Assets.xcassets │ ├── AccentColor.colorset │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json ├── ContentView.swift ├── MarkdownTextEditorApp.swift └── Preview Content │ └── Preview Assets.xcassets │ └── Contents.json └── README.md /MarkdownTextEditor.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 55; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 3C16FB46267147CE0020A44D /* MarkdownTextEditorApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C16FB45267147CE0020A44D /* MarkdownTextEditorApp.swift */; }; 11 | 3C16FB48267147CE0020A44D /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C16FB47267147CE0020A44D /* ContentView.swift */; }; 12 | 3C16FB4A267147CF0020A44D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3C16FB49267147CF0020A44D /* Assets.xcassets */; }; 13 | 3C16FB4D267147CF0020A44D /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3C16FB4C267147CF0020A44D /* Preview Assets.xcassets */; }; 14 | /* End PBXBuildFile section */ 15 | 16 | /* Begin PBXFileReference section */ 17 | 3C16FB42267147CE0020A44D /* MarkdownTextEditor.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MarkdownTextEditor.app; sourceTree = BUILT_PRODUCTS_DIR; }; 18 | 3C16FB45267147CE0020A44D /* MarkdownTextEditorApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MarkdownTextEditorApp.swift; sourceTree = ""; }; 19 | 3C16FB47267147CE0020A44D /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 20 | 3C16FB49267147CF0020A44D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 21 | 3C16FB4C267147CF0020A44D /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 22 | /* End PBXFileReference section */ 23 | 24 | /* Begin PBXFrameworksBuildPhase section */ 25 | 3C16FB3F267147CE0020A44D /* Frameworks */ = { 26 | isa = PBXFrameworksBuildPhase; 27 | buildActionMask = 2147483647; 28 | files = ( 29 | ); 30 | runOnlyForDeploymentPostprocessing = 0; 31 | }; 32 | /* End PBXFrameworksBuildPhase section */ 33 | 34 | /* Begin PBXGroup section */ 35 | 3C16FB39267147CE0020A44D = { 36 | isa = PBXGroup; 37 | children = ( 38 | 3C16FB44267147CE0020A44D /* MarkdownTextEditor */, 39 | 3C16FB43267147CE0020A44D /* Products */, 40 | ); 41 | sourceTree = ""; 42 | }; 43 | 3C16FB43267147CE0020A44D /* Products */ = { 44 | isa = PBXGroup; 45 | children = ( 46 | 3C16FB42267147CE0020A44D /* MarkdownTextEditor.app */, 47 | ); 48 | name = Products; 49 | sourceTree = ""; 50 | }; 51 | 3C16FB44267147CE0020A44D /* MarkdownTextEditor */ = { 52 | isa = PBXGroup; 53 | children = ( 54 | 3C16FB45267147CE0020A44D /* MarkdownTextEditorApp.swift */, 55 | 3C16FB47267147CE0020A44D /* ContentView.swift */, 56 | 3C16FB49267147CF0020A44D /* Assets.xcassets */, 57 | 3C16FB4B267147CF0020A44D /* Preview Content */, 58 | ); 59 | path = MarkdownTextEditor; 60 | sourceTree = ""; 61 | }; 62 | 3C16FB4B267147CF0020A44D /* Preview Content */ = { 63 | isa = PBXGroup; 64 | children = ( 65 | 3C16FB4C267147CF0020A44D /* Preview Assets.xcassets */, 66 | ); 67 | path = "Preview Content"; 68 | sourceTree = ""; 69 | }; 70 | /* End PBXGroup section */ 71 | 72 | /* Begin PBXNativeTarget section */ 73 | 3C16FB41267147CE0020A44D /* MarkdownTextEditor */ = { 74 | isa = PBXNativeTarget; 75 | buildConfigurationList = 3C16FB50267147CF0020A44D /* Build configuration list for PBXNativeTarget "MarkdownTextEditor" */; 76 | buildPhases = ( 77 | 3C16FB3E267147CE0020A44D /* Sources */, 78 | 3C16FB3F267147CE0020A44D /* Frameworks */, 79 | 3C16FB40267147CE0020A44D /* Resources */, 80 | ); 81 | buildRules = ( 82 | ); 83 | dependencies = ( 84 | ); 85 | name = MarkdownTextEditor; 86 | productName = MarkdownTextEditor; 87 | productReference = 3C16FB42267147CE0020A44D /* MarkdownTextEditor.app */; 88 | productType = "com.apple.product-type.application"; 89 | }; 90 | /* End PBXNativeTarget section */ 91 | 92 | /* Begin PBXProject section */ 93 | 3C16FB3A267147CE0020A44D /* Project object */ = { 94 | isa = PBXProject; 95 | attributes = { 96 | BuildIndependentTargetsInParallel = 1; 97 | LastSwiftUpdateCheck = 1300; 98 | LastUpgradeCheck = 1300; 99 | TargetAttributes = { 100 | 3C16FB41267147CE0020A44D = { 101 | CreatedOnToolsVersion = 13.0; 102 | }; 103 | }; 104 | }; 105 | buildConfigurationList = 3C16FB3D267147CE0020A44D /* Build configuration list for PBXProject "MarkdownTextEditor" */; 106 | compatibilityVersion = "Xcode 13.0"; 107 | developmentRegion = en; 108 | hasScannedForEncodings = 0; 109 | knownRegions = ( 110 | en, 111 | Base, 112 | ); 113 | mainGroup = 3C16FB39267147CE0020A44D; 114 | productRefGroup = 3C16FB43267147CE0020A44D /* Products */; 115 | projectDirPath = ""; 116 | projectRoot = ""; 117 | targets = ( 118 | 3C16FB41267147CE0020A44D /* MarkdownTextEditor */, 119 | ); 120 | }; 121 | /* End PBXProject section */ 122 | 123 | /* Begin PBXResourcesBuildPhase section */ 124 | 3C16FB40267147CE0020A44D /* Resources */ = { 125 | isa = PBXResourcesBuildPhase; 126 | buildActionMask = 2147483647; 127 | files = ( 128 | 3C16FB4D267147CF0020A44D /* Preview Assets.xcassets in Resources */, 129 | 3C16FB4A267147CF0020A44D /* Assets.xcassets in Resources */, 130 | ); 131 | runOnlyForDeploymentPostprocessing = 0; 132 | }; 133 | /* End PBXResourcesBuildPhase section */ 134 | 135 | /* Begin PBXSourcesBuildPhase section */ 136 | 3C16FB3E267147CE0020A44D /* Sources */ = { 137 | isa = PBXSourcesBuildPhase; 138 | buildActionMask = 2147483647; 139 | files = ( 140 | 3C16FB48267147CE0020A44D /* ContentView.swift in Sources */, 141 | 3C16FB46267147CE0020A44D /* MarkdownTextEditorApp.swift in Sources */, 142 | ); 143 | runOnlyForDeploymentPostprocessing = 0; 144 | }; 145 | /* End PBXSourcesBuildPhase section */ 146 | 147 | /* Begin XCBuildConfiguration section */ 148 | 3C16FB4E267147CF0020A44D /* Debug */ = { 149 | isa = XCBuildConfiguration; 150 | buildSettings = { 151 | ALWAYS_SEARCH_USER_PATHS = NO; 152 | CLANG_ANALYZER_NONNULL = YES; 153 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 154 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 155 | CLANG_CXX_LIBRARY = "libc++"; 156 | CLANG_ENABLE_MODULES = YES; 157 | CLANG_ENABLE_OBJC_ARC = YES; 158 | CLANG_ENABLE_OBJC_WEAK = YES; 159 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 160 | CLANG_WARN_BOOL_CONVERSION = YES; 161 | CLANG_WARN_COMMA = YES; 162 | CLANG_WARN_CONSTANT_CONVERSION = YES; 163 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 164 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 165 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 166 | CLANG_WARN_EMPTY_BODY = YES; 167 | CLANG_WARN_ENUM_CONVERSION = YES; 168 | CLANG_WARN_INFINITE_RECURSION = YES; 169 | CLANG_WARN_INT_CONVERSION = YES; 170 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 171 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 172 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 173 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 174 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 175 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 176 | CLANG_WARN_STRICT_PROTOTYPES = YES; 177 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 178 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 179 | CLANG_WARN_UNREACHABLE_CODE = YES; 180 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 181 | COPY_PHASE_STRIP = NO; 182 | DEBUG_INFORMATION_FORMAT = dwarf; 183 | ENABLE_STRICT_OBJC_MSGSEND = YES; 184 | ENABLE_TESTABILITY = YES; 185 | GCC_C_LANGUAGE_STANDARD = gnu11; 186 | GCC_DYNAMIC_NO_PIC = NO; 187 | GCC_NO_COMMON_BLOCKS = YES; 188 | GCC_OPTIMIZATION_LEVEL = 0; 189 | GCC_PREPROCESSOR_DEFINITIONS = ( 190 | "DEBUG=1", 191 | "$(inherited)", 192 | ); 193 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 194 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 195 | GCC_WARN_UNDECLARED_SELECTOR = YES; 196 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 197 | GCC_WARN_UNUSED_FUNCTION = YES; 198 | GCC_WARN_UNUSED_VARIABLE = YES; 199 | IPHONEOS_DEPLOYMENT_TARGET = 15.0; 200 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 201 | MTL_FAST_MATH = YES; 202 | ONLY_ACTIVE_ARCH = YES; 203 | SDKROOT = iphoneos; 204 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 205 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 206 | }; 207 | name = Debug; 208 | }; 209 | 3C16FB4F267147CF0020A44D /* Release */ = { 210 | isa = XCBuildConfiguration; 211 | buildSettings = { 212 | ALWAYS_SEARCH_USER_PATHS = NO; 213 | CLANG_ANALYZER_NONNULL = YES; 214 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 215 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 216 | CLANG_CXX_LIBRARY = "libc++"; 217 | CLANG_ENABLE_MODULES = YES; 218 | CLANG_ENABLE_OBJC_ARC = YES; 219 | CLANG_ENABLE_OBJC_WEAK = YES; 220 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 221 | CLANG_WARN_BOOL_CONVERSION = YES; 222 | CLANG_WARN_COMMA = YES; 223 | CLANG_WARN_CONSTANT_CONVERSION = YES; 224 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 225 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 226 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 227 | CLANG_WARN_EMPTY_BODY = YES; 228 | CLANG_WARN_ENUM_CONVERSION = YES; 229 | CLANG_WARN_INFINITE_RECURSION = YES; 230 | CLANG_WARN_INT_CONVERSION = YES; 231 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 232 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 233 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 234 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 235 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 236 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 237 | CLANG_WARN_STRICT_PROTOTYPES = YES; 238 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 239 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 240 | CLANG_WARN_UNREACHABLE_CODE = YES; 241 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 242 | COPY_PHASE_STRIP = NO; 243 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 244 | ENABLE_NS_ASSERTIONS = NO; 245 | ENABLE_STRICT_OBJC_MSGSEND = YES; 246 | GCC_C_LANGUAGE_STANDARD = gnu11; 247 | GCC_NO_COMMON_BLOCKS = YES; 248 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 249 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 250 | GCC_WARN_UNDECLARED_SELECTOR = YES; 251 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 252 | GCC_WARN_UNUSED_FUNCTION = YES; 253 | GCC_WARN_UNUSED_VARIABLE = YES; 254 | IPHONEOS_DEPLOYMENT_TARGET = 15.0; 255 | MTL_ENABLE_DEBUG_INFO = NO; 256 | MTL_FAST_MATH = YES; 257 | SDKROOT = iphoneos; 258 | SWIFT_COMPILATION_MODE = wholemodule; 259 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 260 | VALIDATE_PRODUCT = YES; 261 | }; 262 | name = Release; 263 | }; 264 | 3C16FB51267147CF0020A44D /* Debug */ = { 265 | isa = XCBuildConfiguration; 266 | buildSettings = { 267 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 268 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 269 | CODE_SIGN_STYLE = Automatic; 270 | CURRENT_PROJECT_VERSION = 1; 271 | DEVELOPMENT_ASSET_PATHS = "\"MarkdownTextEditor/Preview Content\""; 272 | DEVELOPMENT_TEAM = YA533DMD5J; 273 | ENABLE_PREVIEWS = YES; 274 | GENERATE_INFOPLIST_FILE = YES; 275 | INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; 276 | INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; 277 | INFOPLIST_KEY_UILaunchScreen_Generation = YES; 278 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 279 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 280 | IPHONEOS_DEPLOYMENT_TARGET = 15.0; 281 | LD_RUNPATH_SEARCH_PATHS = ( 282 | "$(inherited)", 283 | "@executable_path/Frameworks", 284 | ); 285 | MARKETING_VERSION = 1.0; 286 | PRODUCT_BUNDLE_IDENTIFIER = com.aheze.MarkdownTextEditor; 287 | PRODUCT_NAME = "$(TARGET_NAME)"; 288 | SWIFT_EMIT_LOC_STRINGS = YES; 289 | SWIFT_VERSION = 5.0; 290 | TARGETED_DEVICE_FAMILY = "1,2"; 291 | }; 292 | name = Debug; 293 | }; 294 | 3C16FB52267147CF0020A44D /* Release */ = { 295 | isa = XCBuildConfiguration; 296 | buildSettings = { 297 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 298 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 299 | CODE_SIGN_STYLE = Automatic; 300 | CURRENT_PROJECT_VERSION = 1; 301 | DEVELOPMENT_ASSET_PATHS = "\"MarkdownTextEditor/Preview Content\""; 302 | DEVELOPMENT_TEAM = YA533DMD5J; 303 | ENABLE_PREVIEWS = YES; 304 | GENERATE_INFOPLIST_FILE = YES; 305 | INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; 306 | INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; 307 | INFOPLIST_KEY_UILaunchScreen_Generation = YES; 308 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 309 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 310 | IPHONEOS_DEPLOYMENT_TARGET = 15.0; 311 | LD_RUNPATH_SEARCH_PATHS = ( 312 | "$(inherited)", 313 | "@executable_path/Frameworks", 314 | ); 315 | MARKETING_VERSION = 1.0; 316 | PRODUCT_BUNDLE_IDENTIFIER = com.aheze.MarkdownTextEditor; 317 | PRODUCT_NAME = "$(TARGET_NAME)"; 318 | SWIFT_EMIT_LOC_STRINGS = YES; 319 | SWIFT_VERSION = 5.0; 320 | TARGETED_DEVICE_FAMILY = "1,2"; 321 | }; 322 | name = Release; 323 | }; 324 | /* End XCBuildConfiguration section */ 325 | 326 | /* Begin XCConfigurationList section */ 327 | 3C16FB3D267147CE0020A44D /* Build configuration list for PBXProject "MarkdownTextEditor" */ = { 328 | isa = XCConfigurationList; 329 | buildConfigurations = ( 330 | 3C16FB4E267147CF0020A44D /* Debug */, 331 | 3C16FB4F267147CF0020A44D /* Release */, 332 | ); 333 | defaultConfigurationIsVisible = 0; 334 | defaultConfigurationName = Release; 335 | }; 336 | 3C16FB50267147CF0020A44D /* Build configuration list for PBXNativeTarget "MarkdownTextEditor" */ = { 337 | isa = XCConfigurationList; 338 | buildConfigurations = ( 339 | 3C16FB51267147CF0020A44D /* Debug */, 340 | 3C16FB52267147CF0020A44D /* Release */, 341 | ); 342 | defaultConfigurationIsVisible = 0; 343 | defaultConfigurationName = Release; 344 | }; 345 | /* End XCConfigurationList section */ 346 | }; 347 | rootObject = 3C16FB3A267147CE0020A44D /* Project object */; 348 | } 349 | -------------------------------------------------------------------------------- /MarkdownTextEditor.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /MarkdownTextEditor.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /MarkdownTextEditor.xcodeproj/xcuserdata/aheze.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | MarkdownTextEditor.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /MarkdownTextEditor/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /MarkdownTextEditor/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "scale" : "1x", 46 | "size" : "20x20" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "scale" : "2x", 51 | "size" : "20x20" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "scale" : "1x", 56 | "size" : "29x29" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "scale" : "2x", 61 | "size" : "29x29" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "scale" : "1x", 66 | "size" : "40x40" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "scale" : "2x", 71 | "size" : "40x40" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "scale" : "1x", 76 | "size" : "76x76" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "scale" : "2x", 81 | "size" : "76x76" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "scale" : "2x", 86 | "size" : "83.5x83.5" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "scale" : "1x", 91 | "size" : "1024x1024" 92 | } 93 | ], 94 | "info" : { 95 | "author" : "xcode", 96 | "version" : 1 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /MarkdownTextEditor/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /MarkdownTextEditor/ContentView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // MarkdownTextEditor 4 | // 5 | // Created by Zheng on 6/9/21. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct ContentView: View { 11 | @State var markdownText = "" 12 | 13 | var body: some View { 14 | HStack { 15 | VStack { 16 | Text("Markdown") 17 | .fontWeight(.bold) 18 | 19 | TextEditor(text: $markdownText) 20 | .frame(width: 400) 21 | .padding() 22 | .background(Color(uiColor: .secondarySystemBackground)) 23 | .cornerRadius(16) 24 | .padding(.bottom, 16) 25 | } 26 | 27 | VStack { 28 | Text("Output") 29 | .fontWeight(.bold) 30 | 31 | Text(getAttributedString(markdownText)) 32 | .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading) 33 | .padding() 34 | .background(Color(uiColor: .secondarySystemBackground)) 35 | .cornerRadius(16) 36 | .padding(.bottom, 16) 37 | } 38 | } 39 | .font(.title2) 40 | .padding() 41 | } 42 | 43 | func getAttributedString(_ markdown: String) -> AttributedString { 44 | do { 45 | let attributedString = try AttributedString(markdown: markdown) 46 | return attributedString 47 | } catch { 48 | print("Couldn't parse: \(error)") 49 | } 50 | return AttributedString("Error parsing markdown") 51 | } 52 | } 53 | 54 | 55 | struct ContentView_Previews: PreviewProvider { 56 | static var previews: some View { 57 | ContentView() 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /MarkdownTextEditor/MarkdownTextEditorApp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MarkdownTextEditorApp.swift 3 | // MarkdownTextEditor 4 | // 5 | // Created by Zheng on 6/9/21. 6 | // 7 | 8 | import SwiftUI 9 | 10 | @main 11 | struct MarkdownTextEditorApp: App { 12 | var body: some Scene { 13 | WindowGroup { 14 | ContentView() 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /MarkdownTextEditor/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MarkdownTextEditor 2 | A simple text editor for Markdown, written in SwiftUI 3.0. Check out the [article](https://betterprogramming.pub/build-a-markdown-editor-with-swiftui-in-ios-15-767a2e9348a9?source=friends_link&sk=c3de1a7ea9ac215b0fd9ac22df391944)! 3 | 4 | ![Screenshot of editor and output](https://raw.githubusercontent.com/aheze/DeveloperAssets/master/Screen%20Shot%202021-06-09%20at%2012.54.33%20PM.png) 5 | --------------------------------------------------------------------------------