Display text fetched from html page in UILabel - ios

I'm parsing a HTML page in Swift and I got a list of titles. However, the titles couldn't be displayed properly in a UILabel. I've parsed other pages and all of them is OK to show, except this page. Following are some of titles:
Vô trÆ°á»ng công tá»­
Vô tự thần bi
Vô ưu kiếm
Vong má»nh thiên nhai
I'm not sure what kind of encoding the page uses for its text, but all the titles display well in my browser. Can you help me fix this?

Related

swift search contents of local HTML files via search bar and display results in tableview

I have a very simple iOS swift app (storyboards) that displays a tableView controller to show a list of items, let's say in this case a list of fruits (Bananas, Cherries, Strawberries, Grapes, Pears).
Tapping on any table cell opens another viewController, loading a webView which displays a local HTML page (located in a directory within the app) of formatted content with respect to that item. So if you tape on "Bananas", it will load a local HTML file with a ton of formatted content regarding Bananas.
I am trying to add a search bar to the tableView controller to allow me to search the contents all of the HTML files within the app for a particular string, and returning a filtered tableView list including only those results that match the string appearing in the end HTML files.
For example, the HTML pages for "Cherries" and "Strawberries" contain the word "red," so if I search for "red" via the search bar, the tableView would filter and only show "Cherries" and "Strawberries" because only those pages have the search term in their respective HTML contents.
Basically, I am trying to make a very simple search engine within the app.
There are a ton of tutorials about how to filter a tableView based on search bar, but those only talk about filtering by the Label, not by the end content.
Is something like this even possible? I don't know where to start.
Trying to avoid databases or anything too complicated as it is a very simple app that just needs a basic content search feature.

how to show html content for md-selected-item in md-autocomplete

We are trying to use md-autocomplete in our application. Things are working as expected, but we have a specific requirement for displaying the selected item.
Instead of just displaying a text, we need to display a HTML content with some avatar and formatted content.
md-item-text only displays any text provided, I tried the html content, but it does not work.
md-item-template works for the items displayed in the list, but the same styling is not applied to selected item.
Is there anyway to show the html content in Selected Item ? Any suggestions ?

One page website: Rewrite URL in address-bar when clicking an anchor-link

I have set up a one-page, horizontal scrolling website with several anchors combined with DIV-id's. The website has five pages side-by-side that automatically render full-page based on the visitors browser-window.
The menu contains seven hyperlinks that address different anchors (div-id's) on the page (for example: http://www.url.com/#partsix). When they are clicked, the visitor will automatically be scrolled to the anchor part of the page. This works fine and really smooth.
The problem i'm dealing with is that, since the page is not being reloaded, the address-bar is not updated. So if a visitor wants to link to a page, or, for example, like the URL with a facebook button, it will be very difficult.
Is there a way to rewrite the address bar with the anchorlink without reloading the page?
EDIT: I have found out that i can user the action onclick="window.location.hash = hash;" on the hyperlinks. This will return the hash of the anchor it is scrolling to in the address bar. Works like a charm. But: my menu plugin does not let me add this action to the hyperlinks. So i wanted to check if i can use javascript to apply this action to all hyperlinks in the same li class. Does anyone know how?
The li class that contains all menu links is 'mc_menu mc_depth_2'

TinyMCE Printing HTML

TinyMCE...
when I save form data, the text that was entered through the editor is being displayed with all of the tags in my index and detail view. Any idea how I can display the data as normal without html mark up?
How are you outputting the text ?
I'd guess you should be using this:
#Html.Raw(Model.MceText)

JasperReports page footer only printed on last page

For some reason my page footer with the date and page x/y gets only printed on the very last page. Does anyone have an idea why?
I am using JasperReports 3.1.2 and iReport 3.0.0.
EDIT: just for the record: it worked after I moved two subreports and two page breaks from the Title band to the Detail band. Don't know why I put them there, but now it works..
You can select which band to add. just use page footer instead last page footer. Last page footer is used when you want something to be printed at last, but the contain is so much that it overflows to many pages.
Most probably you are using the `Last Page Footer' band, instead of the 'Page Footer' band.

Resources