mirror of
https://github.com/wnagrodzki/CocoaProgrammingGuidelines.git
synced 2025-05-03 17:41:51 +02:00
Adds syntax highlighting.
This commit is contained in:
parent
5156651b8e
commit
3bc5a8d7e9
2 changed files with 8 additions and 6 deletions
Binary file not shown.
|
@ -23,6 +23,7 @@
|
|||
\usepackage[framemethod=TikZ]{mdframed}
|
||||
\usepackage{hyperref}
|
||||
\usepackage{tabto}
|
||||
\usepackage{minted}
|
||||
|
||||
|
||||
% Define section, subsection and subsubsection font size and color
|
||||
|
@ -84,9 +85,10 @@
|
|||
|
||||
% Lists a code inside of a blue border
|
||||
\definecolor{BaliHaiColor}{HTML}{7CA1B3}
|
||||
\newenvironment{codelisting}
|
||||
{\footnotesize\mdframed[middlelinewidth=0.5pt, middlelinecolor=BaliHaiColor, skipabove=15pt]\verbatim}
|
||||
{\endverbatim\endmdframed\vspace{12pt}\normalsize}
|
||||
\newminted[codelisting]{objective-c}{tabsize=4, fontsize=\footnotesize}
|
||||
\usemintedstyle{xcode}
|
||||
\BeforeBeginEnvironment{codelisting}{\footnotesize\mdframed[middlelinewidth=0.5pt, middlelinecolor=BaliHaiColor, skipabove=15pt]}%
|
||||
\AfterEndEnvironment{codelisting}{\endmdframed\vspace{12pt}\normalsize}
|
||||
|
||||
|
||||
% Lists text inside yellow border
|
||||
|
@ -384,7 +386,7 @@ This approach has one more advantage, it is easier to add an error handling late
|
|||
if (error != NULL)
|
||||
*error = [NSError errorWithDomain:ExampleDomain
|
||||
code:1001
|
||||
userInfo:@{NSLocalizedDescriptionKey: @"User name must have..."}];
|
||||
userInfo:@{NSLocalizedDescriptionKey: @"User has to..."}];
|
||||
return NO;
|
||||
}
|
||||
|
||||
|
@ -392,11 +394,11 @@ This approach has one more advantage, it is easier to add an error handling late
|
|||
if (error != NULL)
|
||||
*error = [NSError errorWithDomain:ExampleDomain
|
||||
code:1002
|
||||
userInfo:@{NSLocalizedDescriptionKey: @"Password must have..."}];
|
||||
userInfo:@{NSLocalizedDescriptionKey: @"Password has to..."}];
|
||||
return NO;
|
||||
}
|
||||
|
||||
// logging in code
|
||||
// actual logging code
|
||||
}
|
||||
\end{codelisting}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue