From 3c52809a99b63dd1bbec4324af3f1f7c30d79e36 Mon Sep 17 00:00:00 2001 From: jz709u Date: Tue, 21 Feb 2017 23:24:20 +0900 Subject: [PATCH] Mark Down View MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - need to manage observers now because with tab view controllers they don’t fully load the view controller into memory when they are in the tabs that’s not yet displayed so when de init could be executed without initial adding of observers. - added external library for converting to mark down text - tested various memory leaks, since adding tab bar as the base. - mark down view --- standardnotes.xcodeproj/project.pbxproj | 16 ++++ standardnotes/Base.lproj/Main.storyboard | 87 ++++++++++++++++++---- standardnotes/ComposeViewController.swift | 56 +++++++++++--- standardnotes/MarkDownViewController.swift | 87 ++++++++++++++++++++++ standardnotes/Note+CoreDataClass.swift | 1 - standardnotes/NotesViewController.swift | 11 ++- 6 files changed, 228 insertions(+), 30 deletions(-) create mode 100644 standardnotes/MarkDownViewController.swift diff --git a/standardnotes.xcodeproj/project.pbxproj b/standardnotes.xcodeproj/project.pbxproj index 4e815b6..d533973 100644 --- a/standardnotes.xcodeproj/project.pbxproj +++ b/standardnotes.xcodeproj/project.pbxproj @@ -8,6 +8,8 @@ /* Begin PBXBuildFile section */ 6928F05B1E45F7A300A05DB9 /* SyncController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6928F05A1E45F7A300A05DB9 /* SyncController.swift */; }; + 69462FFE1E5C53A30097EBE8 /* Markdown.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69462FFD1E5C53A30097EBE8 /* Markdown.swift */; }; + 694630141E5C59060097EBE8 /* MarkDownViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 694630131E5C59060097EBE8 /* MarkDownViewController.swift */; }; B8046A731E2A8074006A5F03 /* Theme.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8046A721E2A8074006A5F03 /* Theme.swift */; }; B809F2B81E0B5164007D5700 /* ComposeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B809F2B71E0B5164007D5700 /* ComposeViewController.swift */; }; B82B6DFB1E08AA660025C3EC /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B82B6DFA1E08AA660025C3EC /* AppDelegate.swift */; }; @@ -113,6 +115,8 @@ /* Begin PBXFileReference section */ 6928F05A1E45F7A300A05DB9 /* SyncController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SyncController.swift; sourceTree = ""; }; + 69462FFD1E5C53A30097EBE8 /* Markdown.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Markdown.swift; path = ../../standardNotes/standardnotes/Markdown.swift; sourceTree = ""; }; + 694630131E5C59060097EBE8 /* MarkDownViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MarkDownViewController.swift; sourceTree = ""; }; B8046A721E2A8074006A5F03 /* Theme.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Theme.swift; sourceTree = ""; }; B809F2B71E0B5164007D5700 /* ComposeViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ComposeViewController.swift; sourceTree = ""; }; B82B6DF71E08AA660025C3EC /* standardnotes.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = standardnotes.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -158,6 +162,14 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 6946300B1E5C58D80097EBE8 /* Markdown */ = { + isa = PBXGroup; + children = ( + 694630131E5C59060097EBE8 /* MarkDownViewController.swift */, + ); + name = Markdown; + sourceTree = ""; + }; B80140921E12FFA00046082C /* Compose */ = { isa = PBXGroup; children = ( @@ -173,6 +185,7 @@ B89178E51E0DBDC800163EA7 /* Notes */, B89178E61E0DC80600163EA7 /* Tags */, B80140921E12FFA00046082C /* Compose */, + 6946300B1E5C58D80097EBE8 /* Markdown */, B89178E11E0D86D500163EA7 /* TabBarViewController.swift */, B89178DD1E0D7D8300163EA7 /* AccountViewController.swift */, ); @@ -290,6 +303,7 @@ CDAAB6421E0DE4DE0033487A /* Supporting Files */ = { isa = PBXGroup; children = ( + 69462FFD1E5C53A30097EBE8 /* Markdown.swift */, B872EC871E08D00400CC7656 /* standardnotes-Bridging-Header.h */, B82B6E041E08AA660025C3EC /* Assets.xcassets */, B82B6E061E08AA660025C3EC /* LaunchScreen.storyboard */, @@ -438,6 +452,8 @@ B89178DE1E0D7D8300163EA7 /* AccountViewController.swift in Sources */, B8046A731E2A8074006A5F03 /* Theme.swift in Sources */, B89178DA1E0C9B9D00163EA7 /* Tag+CoreDataProperties.swift in Sources */, + 69462FFE1E5C53A30097EBE8 /* Markdown.swift in Sources */, + 694630141E5C59060097EBE8 /* MarkDownViewController.swift in Sources */, B89178E81E0DC81500163EA7 /* TagTableViewCell.swift in Sources */, B89178CE1E0C9A4D00163EA7 /* Tag+CoreDataClass.swift in Sources */, B82B6E181E08AC8C0025C3EC /* ApiController.swift in Sources */, diff --git a/standardnotes/Base.lproj/Main.storyboard b/standardnotes/Base.lproj/Main.storyboard index 7659ce5..697f7c3 100644 --- a/standardnotes/Base.lproj/Main.storyboard +++ b/standardnotes/Base.lproj/Main.storyboard @@ -1,5 +1,5 @@ - - + + @@ -102,6 +102,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -123,7 +176,7 @@ - + @@ -177,6 +230,7 @@ + @@ -186,7 +240,7 @@ - + @@ -213,7 +267,7 @@ - + @@ -221,7 +275,7 @@ - + + @@ -292,7 +347,7 @@ - + @@ -309,7 +364,7 @@ - + @@ -326,7 +381,7 @@ - + @@ -343,7 +398,7 @@